I am a new user of R software, and at the moment I am interested in applying
"R" to calculate Credit Risk measures.
I have already been in contact with Andreas Wittmann (responsible for
CreditMetrics package). Nevertheless, there are some doubts that I have which
Andreas could not help me.
Is
Hi
I am new to this software, Please tell me how to save the result to a word
or text format from R console.
For example, if I run a regression, and I want to save the result in the
word what should I do for that. Please do reply for my query.
Thanks
Arun Sathiya.
--
View this message in conte
The "micEcon" package has been split into three packages: miscTools,
micEconAids, and micEcon.
a) miscTools (version 0.6-0) includes miscellaneous small tools and
utilities that are not related to (micro)economics, e.g. colMedians(),
rowMedians(), insertCol(), insertRow(), vecli(), symMatrix(),
tr
Dear All,
Let A is a matrix which is:
A <- matrix(c(1,2,3,4),nrow=2)
How could we find the inverse of A? I try to use ginv(A), but it didn't worked.
Thanks
Fir
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
Try:
solve(a)
On Mon, Dec 28, 2009 at 8:53 AM, FMH wrote:
> Dear All,
>
> Let A is a matrix which is:
> A <- matrix(c(1,2,3,4),nrow=2)
>
> How could we find the inverse of A? I try to use ginv(A), but it didn't
> worked.
>
> Thanks
>
> Fir
>
> __
> R-
Hi all,
I've got a project where I have to calculate weight-for-age Z-scores,
preferably using the WHO standards.
WHO have been very nice to publish macros for doing this in both
STATA,SPSS, SAS and Splus formats
(see http://www.who.int/childgrowth/software/en/), but for some reason
have chosen n
Dear friends,
I have run an ANOVA using a linear variable as dependent and a nominal variable
with five groups as independent (factor). The F test is statistically
significant F(4, 431)=2.54, p=0.036.However, the multiple comparisons have
shown no difference between any two groups (no matter w
let consider following matrix :
mat <- matrix(rnorm(45), 15)
Now I want to convert it to a list object "mat_list", which will have 15
elements and each element will again be a matrix with 3 rows and 3 columns.
How can I do that?
Thanks,
--
View this message in context:
http://n4.nabble.com/
> write.table(x2, "filename.txt", col.name=FALSE, row.name=FALSE)
# where x2 = variable you want to save
Muhammad Rahiz | Doctoral Student in Regional Climate Modeling
Climate Research Laboratory, School of Geography & the Environment
Oxford Universi
Try this:
mat_list <- lapply(split(mat, seq(nrow(mat))), matrix, ncol = 3)
On Mon, Dec 28, 2009 at 9:20 AM, Ron_M wrote:
>
> let consider following matrix :
>
> mat <- matrix(rnorm(45), 15)
>
> Now I want to convert it to a list object "mat_list", which will have 15
> elements and each element
I need to check if there is an auto regression in the data that I have. I
did find 'R functions for regression analysis', but I can't find the 'right'
one for me in there.
What would be the correct command to use in this case?
Thanks,
EZ
[[alternative HTML version deleted]]
How can I resolve this problem?...
As a general example,
plot (1:4)
polygon(c(0,0,5,5),c(0,5,5,0), border="lavenderblush1", col =
"lavenderblush1")
###see how this overlays the axes lines
#I have tried...
for (k in 1:4) axis(k, lwd.ticks=0, label=F)
#...but this misses the corners
Any suggest
thanks, man. And what a stupid mistake!!!
Plus, do you know any package in R that perform good rolling estimation?
--
View this message in context:
http://n4.nabble.com/Help-with-Moving-Average-in-R-tp989627p989764.html
Sent from the R help mailing list archive at Nabble.com.
_
Try this:
plot (1:4)
polygon(c(0,0,5,5),c(0,5,5,0), border="lavenderblush1", col =
"lavenderblush1")
###see how this overlays the axes lines
box()
On Mon, Dec 28, 2009 at 6:38 AM, Dean1 wrote:
>
> How can I resolve this problem?...
>
> As a general example,
> plot (1:4)
> polygon(c(0,0,5,5),c
Thanks Liu,
You are right, my concerning is Basel II, and I was wondering to find a R
package for this.
But I also can't find any package.
By the way, since I'm in banking industry, I need to use the portfolio approach.
Any other hints still welcome.
Rick
From: Wensui Liu
Sent: Sunday, Decem
For your problem A, why do you want to create so many variables? Leave the
data in the 'newrate' list and reference the information from there. It
will be much easier. Think about the data structures that you want to work
with, especially if you have a variable number of objects/files that you a
Dear Sir,
Thanks a lot for your guidance. Definitely I will go through lists. The no of
variables for any given rate say rate1 are three different ranges.
e.g. rate1 has three ranges
Range1 = (1.05 - 1.30) Range2 = (1.30 - 1.65) Range3 = (1.65 -
1.99)
Likewise rate2 has three r
I would still think you should look at lists. For example, your ranges
could be specified with:
> ranges <- list(list(c(1.05, 1.3), c(1.3,.65), c(1.65, 1.99)),
+list(c(2.05, 2.3), c(2.3, 2.65), c(2.65, 2.99)))
>
> ranges
[[1]]
[[1]][[1]]
[1] 1.05 1.30
[[1]][[2]]
[1] 1.30 0.65
On Dec 28, 2009, at 12:19 AM, sathiya_mtm wrote:
Hi
I am new to this software, Please tell me how to save the result to
a word
or text format from R console.
For example, if I run a regression, and I want to save the result in
the
word what should I do for that. Please do reply for my
I have defined boolean methods for bit and bitwhich objects, for example
|.bit <- function(e1,e2)
and
|.bitwhich <- function(e1,e2)
Both methods coerce their arguments to the respective class, however if I do
something like
bit_obj | bitwhich_obj
then I get a warning
Warning message:
Incompa
Good Morning:
I have attached a text file with one hundred thirty six observations. I would
like to create a qq plot with the following features:
1. Observed values on the y-axis.
2. Normal approximation line on the plot.
3. X-axis with vertical reference lines at the following percentiles of th
This email list is about R, not introductory statistics. But the
answer to your question is: reject the 4 df hypothesis that the
population means of the 5 groups are all equal. Retain each single df
hypothesis about pairwise population mean differences.
-Ista
On Mon, Dec 28, 2009 at 6:02 AM, Iaso
My machine has 8GB memory. I had quit all other programs that might
take a lot of memory when I try the script (before I post the first
message in this thread). The cdf file is of only 741 MB. It is strange
to me to see the error.
On Mon, Dec 28, 2009 at 2:38 AM, Wolfgang Huber wrote:
> Dear Peng
Hi,
I have a data.frame containing a Date column. When using write.csv()
function to generate a CSV file, I always get the Date column formatted as
"-MM-DD". I would like to have it formatted as "MM/DD/", but
could not find an easy way to do it.Here is the test code:
d <- data.
On 28-12-2009, at 13:53, Saji Ren [via R] wrote:
> thanks, man. And what a stupid mistake!!!
>
My pleasure.
> Plus, do you know any package in R that perform good rolling estimation?
>
No.
But I did a search on "rolling estimation" in the R-help mailing list on Nabble
and found this
http
try this:
d <- data.frame(ticker=c("IBM", "IBM"), date = as.Date(c("2009-12-03",
"2009-12-04")), price=c(120.00, 123.00))
# convert to your desired format
d$mydate <- format(d$date, "%m/%d/%Y")
write.csv(subset(d, select=-date), file="C:/temp/test.csv", row.names=FALSE)
On Mon, Dec 28, 2009 at 1
Try this:
newD <- replace(d, sapply(d, function(x)inherits(x, "Date")),
format(d[sapply(d, function(x)inherits(x, "Date"))], "%m/%d/%Y"))
write.csv(newD, file="C:/temp/test.csv", row.names=FALSE)
On Mon, Dec 28, 2009 at 1:19 PM, wrote:
> Hi,
>
> I have a data.frame containing a Date column. Wh
Try this:
> write.csv(transform(d, date = format(date, "%m/%d/%Y")))
"","ticker","date","price"
"1","IBM","12/03/2009",120
"2","IBM","12/04/2009",123
On Mon, Dec 28, 2009 at 10:19 AM, wrote:
> Hi,
>
> I have a data.frame containing a Date column. When using write.csv()
> function to generate
Gustaf,
I would be advisable to first check that such z scores are valid
statistically (I have my doubts). They make a number of assumptions,
chief among them being that un-normalized weight is not a proper
physiologic summary. It is almost always the case that joint modeling
of age and wei
Thanks, this solves the problem
--
View this message in context:
http://n4.nabble.com/graph-shading-is-overlaying-axes-tp989750p989787.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz
Hi,
I want to extract individual names from a single string that contains all
names. My problem is not the extraction itself, but the looping over the
extraction start and end points, which I try to realize with apply.
#Say, I have a string with names.
authors=c("Schleyer T, Spallek H, Butler BS,
Please see this code for a demonstration of my problem...
xlim <- c(-1,5)
plot(1:4, xlim=xlim)
abline(v=xlim[1])
abline(v=xlim[2])
When I refer to xlim, it is not referring to the boundaries of the graphical
region, it refers to the maximum and minimum xticks. My question is how can
I refer to
On Mon, 28 Dec 2009, Gustaf Rydevik wrote:
Hi all,
I've got a project where I have to calculate weight-for-age Z-scores,
preferably using the WHO standards.
WHO have been very nice to publish macros for doing this in both
STATA,SPSS, SAS and Splus formats
(see http://www.who.int/childgrowth/so
Hi,
This problem might be a little harder than it appears.
I receive a few emails all suggesting that convert the Date field to
character by calling format(date, "%m/%d/%Y") in one way or another. Well,
this is not the solution I'm looking for and it doesn't work for me. All
the date fields
Try this:
par("usr") give the boundaries.
abline(v = par("usr")[1], col = "red", lwd = 2)
abline(v = par("usr")[2], col = "red", lwd = 2)
On Mon, Dec 28, 2009 at 11:55 AM, Dean1 wrote:
>
> Please see this code for a demonstration of my problem...
>
> xlim <- c(-1,5)
> plot(1:4, xlim=xlim)
> abl
Try this. It picks out each string of word characters (\w+) followed
by a space followed by a word character:
> library(gsubfn)
> strapply(authors, "\\w+ \\w", c)[[1]]
[1] "Schleyer T" "Spallek H" "Butler B""Subramanian S"
[5] "Weiss D" "Poythress M" "Rattanathikun P
Use the quote argument:
write.csv(d, file="C:/temp/test.csv", row.names=FALSE, quote = FALSE)
On Mon, Dec 28, 2009 at 2:17 PM, wrote:
> Hi,
>
> This problem might be a little harder than it appears.
>
> I receive a few emails all suggesting that convert the Date field to
> character by calling
Nice try, but that will turn off quote for all fields. I want quotes for
text fields, and no quotes for date and numeric fields. Please see the
desired CSV output in my previous email.
George
From:
Henrique Dallazuanna
To:
george@bnymellon.com
Cc:
r-help@r-project.org
Date:
12/28/200
Try this:
cat('"', paste(names(newD), collapse = '","'), '"\n', sep = '', file =
'temp.txt', append = TRUE)
cat(paste(apply(newD, 1,
function(l)paste('"', l[1], '",', l[2], ',', l[3], sep = "")),
collapse = "\n"), file = 'temp.txt', append = TRUE)
Using newD object from my prev
Peng Yu wrote:
> My machine has 8GB memory. I had quit all other programs that might
> take a lot of memory when I try the script (before I post the first
> message in this thread). The cdf file is of only 741 MB. It is strange
> to me to see the error.
For me this tops out at about 13 gigs.
The
Try this:
mapply(substr, x = authors, start = starts, stop = ends)
On Mon, Dec 28, 2009 at 10:46 AM, Daniel Malter wrote:
> Hi,
>
> I want to extract individual names from a single string that contains all
> names. My problem is not the extraction itself, but the looping over the
> extraction st
Works a charme, thanks.
Daniel
-
cuncta stricte discussurus
-
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Gabor Grothendieck
Sent: Monday, December 28, 2009 12:34 PM
To: Daniel Mal
I work in a US government office, where regular computer users are not allowed
Admin access to their computers, and all software must go through an extensive
evaluation to be approved for installation and use. Several of us in my office
would greatly benefit from R, so I'd like to request that
Sorry for the dumb question, but I couldn't figure this out myself.
Consider the following:
> str <- c("abc","def")
> array(str, c(2,1))
[,1]
[1,] "abc"
[2,] "def"
How can i obtain the outcome of the second instruction without
specifying the number of rows?
Thank you in advance,
Francesco.
On Dec 28, 2009, at 12:23 PM, Peterson, Eric B. wrote:
I work in a US government office, where regular computer users are
not allowed Admin access to their computers, and all software must
go through an extensive evaluation to be approved for installation
and use. Several of us in my offic
matrix(str, ncol=1)
Francesco Napolitano wrote:
Sorry for the dumb question, but I couldn't figure this out myself.
Consider the following:
str <- c("abc","def")
array(str, c(2,1))
[,1]
[1,] "abc"
[2,] "def"
How can i obtain the outcome of the second instruction without
specifying the
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of
> george@bnymellon.com
> Sent: Monday, December 28, 2009 8:18 AM
> To: r-help@r-project.org
> Subject: Re: [R] How to change the default Date format for
> write.csvfunction
Hi Francesco,
Be carefull with create a object named str, because you crash str()
function. I don't know if it have implications on any package or functions.
bests
milton
On Mon, Dec 28, 2009 at 4:32 PM, Francesco Napolitano
wrote:
> Sorry for the dumb question, but I couldn't figure this out
I think what you are encountering is a standard R default. R, by default, adds
4% to the axes. I suspect that this is to avoid graphing points right on the x
or x axis and thus obscuring them.
Have a look at ?par xaxs for more information and how to change the default.
--- On Mon, 12/28/
When I try to run the following non-linear regression with variables
index1 and prl3:
> beta = 4
> nls(index1~beta*(1/prl3),start = list(beta = 4))
I get this error message:
Error in nls(index1 ~ beta * (1/prl3), start = list(beta = 4)) :
REAL() can only be applied to a 'numeric', not a 'lo
I have the following code
fileList <-list.files(path = ".", pattern = "[^a-z].txt$", all.files =
FALSE, full.names = FALSE, recursive = FALSE, ignore.case = FALSE)
for (x in 1:length(fileList)){
fileLines <- data.frame(read.table(fileList[x]))
print(string)
}
the lines of the file all hav
You can use a numeric value for the quote= argument to write.table to specify
which columns should have quotes.
d <- data.frame(ticker=c("IBM", "IBM"), date = as.Date(c("2009-12-03",
"2009-12-04")), price=c(120.00, 123.00))
d1 <- as.data.frame(lapply(d, function(x) if (is(x, "Date")) format(x,
Consider the following
> fileLines
V1 V2V3V4 V5 V6V7 V8
1 AB 20091224 156.0 156.0 154.00 154.0055 1198
2 AB.C 20091224 156.0 156.0 156.00 156.00 0 0
3 ABF10 20091224 156.0 156.0 156.00 156.0055444
4 ABH10 20091224 156.0 156.0 1
On Mon, Dec 28, 2009 at 6:23 PM, Peterson, Eric B. wrote:
> My guess is that we may run into problems due to R being open-source, leading
> to a potential perception that the code might be poorly controlled. This
> could be further complicated by the need for downloading additional
> open-sour
Hi Nick,
Your first column is being stored as a factor. You can either take
care when creating the matrix to keep the values in this column as
characters, or you might want to convert the result using
as.character().
HTH,
Tom
On Dec 28, 2009, at 1:14 PM, Nick Torenvliet wrote:
Conside
Assuming the data set is called xx
subset (xx, xx$V1=="AB")
or
xx[1,]
if you now AB is the first row of the data.
--- On Mon, 12/28/09, Nick Torenvliet wrote:
> From: Nick Torenvliet
> Subject: [R] Accessing members
> To: r-help@r-project.org
> Received: Monday, December 28, 2009, 6:
Dear Adrian
Are you able to help me with problems that I am having with RGoogleData? I
would greatly appreciate it if you could give me some general trouble
shooting ideas or better yet if you could fix the problem.
I believe that I updated to the latest version of RGoogleData as evidenced
by
>
Hello Dennis:
Thanks for the reply and for your help. I apologize for the errant TUS in the
data. Your statement about the quantiles of the data belonging to the vertical
axis is correct of course and it helped me realize an error of mine: the
quantiles plotted as vertical reference lines are f
?read.csv
On Mon, Dec 28, 2009 at 5:31 PM, Nick Torenvliet
wrote:
> I have the following code
>
> fileList <-list.files(path = ".", pattern = "[^a-z].txt$", all.files =
> FALSE, full.names = FALSE, recursive = FALSE, ignore.case = FALSE)
> for (x in 1:length(fileList)){
>fileLines <- data.fra
I have a data set similar to this:
P1idVeg1Veg2AreaPoly2 P2ID
1 p p 1 1
1 p p 1.5 2
2 p p 2 3
2 p h 3.5 4
For each group of "Poly1id" records, I wish to ou
On Dec 28, 2009, at 4:24 PM, milton ruser wrote:
Hi Francesco,
Be carefull with create a object named str, because you crash str()
function. I don't know if it have implications on any package or
functions.
Agree that is not a good idea, but don't agree with why. The action of
creating a
try this:
> x <- read.table(textConnection("P1idVeg1Veg2AreaPoly2
P2ID
+ 1 p p 1 1
+ 1 p p 1.5 2
+ 2 p p 2 3
+ 2 p h 3.5 4"), header=TRUE, as.is=TRUE)
> # split t
Assuming your data frame is called DF we can use sqldf like this. The
inner select calculates the maximum AreaPoly2 for each group such that
Veg1 = Veg2 and the outer select returns the corresponding row.
library(sqldf)
sqldf("select * from DF a where AreaPoly2 =
(select max(AreaPoly2) fro
On Dec 28, 2009, at 7:03 PM, Seth W Bigelow wrote:
I have a data set similar to this:
P1idVeg1Veg2AreaPoly2 P2ID
1 p p 1 1
1 p p 1.5 2
2 p p 2 3
2 p h 3.5
This is a result of how R treats factors.
There's more than one way to do what I think you're asking for.
I've constructed a smaller version of your data frame to illustrate one
quick way if that's all you need:
> smdat<-
> data.frame(V1=c("AB","AB.C","ABF10"),V2=rep("20091224",3),V3=rep(156.0
On Dec 28, 2009, at 5:14 PM, Nick Torenvliet wrote:
Consider the following
fileLines
V1 V2V3V4 V5 V6V7 V8
1 AB 20091224 156.0 156.0 154.00 154.0055 1198
2 AB.C 20091224 156.0 156.0 156.00 156.00 0 0
3 ABF10 20091224 156.0 156.0 156
I¹m trying to build a simple formula interface to work with a function using
ggplot2. The following scheme ³works² up until the plot(p) request, at which
point there are complaints about xlim¹s and a blank graphics window.
Looking at str(p) I do see the limits are NULL, plus layer 1 claims to have
You may need to look at some other contrasts than the pairwise.
For example,
3(x.bar_A + x.bar_B) - 2(x.bar_C + x.bar_D + x.bar_E)
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http:
Thanks everyone... the as.character(fileLines[1][1]) solution worked well...
Factors??? the treatment is so far away from what I know.
Cool though...
On Mon, Dec 28, 2009 at 8:55 PM, David Winsemius wrote:
>
> On Dec 28, 2009, at 5:14 PM, Nick Torenvliet wrote:
>
> Consider the following
Yet another question...
I'm wondering if there is a built in facility to log errors. I've got this
statement that gives me verbose DBI errors as they come up (to standard
output), but I'd like to trap and log them to a file as I running about
300 sql statements through this particular piece
Try this:
logfile <- file("logfile")
open(logfile, "w")
sink(logfile, type = "message")
1/"a" # generate an error
On Mon, Dec 28, 2009 at 11:11 PM, Nick Torenvliet
wrote:
> Yet another question...
>
> I'm wondering if there is a built in facility to log errors. I've got this
> statement that
Beauty thank-you... I'm crashing but I'll check that out in a couple when I
get back. Must go snowboarding tomorrow!
On Mon, Dec 28, 2009 at 11:20 PM, Gabor Grothendieck <
ggrothendi...@gmail.com> wrote:
> Try this:
>
> logfile <- file("logfile")
> open(logfile, "w")
> sink(logfile, type = "mess
Hi everyone,
I tried to write the code of computing R2 for a regression system but I failed.
This is the code I use for computing RMSE:
my_svm_model <- function(myformula, mydata, mytestdata)
{
mymodel <- svm(myformula, data=mydata)
mytest <- predict(mymodel, mytestdata
Hi all,
Is there a way that I can import R functions into Fortran? Especially, I
want to generate random numbers from some not-so-common distributions (e.g.
inverted chi square) but did not find any routines written in Fortran that
deal with distributions other than uniform and normal.
Thanks.
An
You can read the manual below.
good luck!
http://www.biometrics.mtu.edu/CRAN/doc/manuals/R-exts.html#The-R-API
For example, suppose we want to call R's normal random numbers from FORTRAN.
We need a C wrapper along the lines of
#include
void F77_SUB(rndstart)(void) { GetRNGstate();
75 matches
Mail list logo