[R] FW: Questions related to R- Credit Risk

2009-12-28 Thread Lisete Fernandes de Noronha (DGR)
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

[R] To export results

2009-12-28 Thread sathiya_mtm
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

[R] [R-pkgs] micEcon split into miscTools, micEconAids, and micEcon

2009-12-28 Thread Arne Henningsen
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(),

[R] Inverse matrix

2009-12-28 Thread FMH
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

Re: [R] Inverse matrix

2009-12-28 Thread Henrique Dallazuanna
Try: solve(a) On Mon, Dec 28, 2009 at 8:53 AM, FMH kagba2...@yahoo.com 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] WHO Anthro growth curve macros and R

2009-12-28 Thread Gustaf Rydevik
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

Re: [R] anova

2009-12-28 Thread Iasonas Lamprianou
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

[R] Matrix to list object

2009-12-28 Thread Ron_M
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:

Re: [R] To export results

2009-12-28 Thread Muhammad Rahiz
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 University

Re: [R] Matrix to list object

2009-12-28 Thread Henrique Dallazuanna
Try this: mat_list - lapply(split(mat, seq(nrow(mat))), matrix, ncol = 3) On Mon, Dec 28, 2009 at 9:20 AM, Ron_M ron_michae...@yahoo.com 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

[R] auto regression

2009-12-28 Thread Gavriel Esti Zoladz
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]]

[R] graph shading is overlaying axes

2009-12-28 Thread Dean1
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

Re: [R] Help with Moving Average in R

2009-12-28 Thread Saji Ren
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.

Re: [R] graph shading is overlaying axes

2009-12-28 Thread jim holtman
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 web13s...@yahoo.co.uk wrote: How can I resolve this problem?... As a general example, plot (1:4)

Re: [R] R and Finance - EAD, LGD, PD

2009-12-28 Thread Ricardo Gonçalves Silva
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,

Re: [R] Modified R Code

2009-12-28 Thread jim holtman
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

Re: [R] Modified R Code

2009-12-28 Thread Maithili Shiva
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

Re: [R] Modified R Code

2009-12-28 Thread jim holtman
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

Re: [R] To export results

2009-12-28 Thread David Winsemius
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

[R] Ops method does not dispatch on either of two classes

2009-12-28 Thread Jens Oehlschlägel
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:

[R] Help With Custom QQ Plot

2009-12-28 Thread Adam Carr
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

Re: [R] anova

2009-12-28 Thread Ista Zahn
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,

Re: [R] [BioC] make.cdf.package: Error: cannot allocate vector of size 1 Kb

2009-12-28 Thread Peng Yu
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 whu...@embl.de

[R] How to change the default Date format for write.csv function?

2009-12-28 Thread George . Zou
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 -

Re: [R] Help with Moving Average in R

2009-12-28 Thread Berend Hasselman
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

Re: [R] How to change the default Date format for write.csv function?

2009-12-28 Thread jim holtman
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 10:19 AM,

Re: [R] How to change the default Date format for write.csv function?

2009-12-28 Thread Henrique Dallazuanna
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, george@bnymellon.com wrote: Hi, I have a data.frame containing a

Re: [R] How to change the default Date format for write.csv function?

2009-12-28 Thread Gabor Grothendieck
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, george@bnymellon.com wrote: Hi, I have a data.frame containing a Date column.  When using write.csv() function to generate a

Re: [R] WHO Anthro growth curve macros and R

2009-12-28 Thread Frank E Harrell Jr
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

Re: [R] graph shading is overlaying axes

2009-12-28 Thread Dean1
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

[R] apply loop - using/providing a data frame to loop over

2009-12-28 Thread Daniel Malter
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,

[R] refering to the 'boundaries' of a graph

2009-12-28 Thread Dean1
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

Re: [R] WHO Anthro growth curve macros and R

2009-12-28 Thread Thomas Lumley
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

Re: [R] How to change the default Date format for write.csv function?

2009-12-28 Thread George . Zou
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

Re: [R] refering to the 'boundaries' of a graph

2009-12-28 Thread Henrique Dallazuanna
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 web13s...@yahoo.co.uk wrote: Please see this code for a demonstration of my problem... xlim - c(-1,5) plot(1:4, xlim=xlim)

Re: [R] apply loop - using/providing a data frame to loop over

2009-12-28 Thread Gabor Grothendieck
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 BSubramanian S [5] Weiss D Poythress M Rattanathikun P Mueller G You

Re: [R] How to change the default Date format for write.csv function?

2009-12-28 Thread Henrique Dallazuanna
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, george@bnymellon.com 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

Re: [R] How to change the default Date format for write.csv function?

2009-12-28 Thread George . Zou
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 www...@gmail.com To: george@bnymellon.com Cc:

Re: [R] How to change the default Date format for write.csv function?

2009-12-28 Thread Henrique Dallazuanna
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 previous

Re: [R] [BioC] make.cdf.package: Error: cannot allocate vector of size 1 Kb

2009-12-28 Thread Martin Morgan
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

Re: [R] apply loop - using/providing a data frame to loop over

2009-12-28 Thread Daniel Malter
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

[R] What might be the security issues from installing R?

2009-12-28 Thread Peterson, Eric B.
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

Re: [R] What might be the security issues from installing R?

2009-12-28 Thread Marc Schwartz
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

Re: [R] 2D array of strings

2009-12-28 Thread Tony Plate
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 number

Re: [R] How to change the default Date format for write.csvfunction?

2009-12-28 Thread William Dunlap
-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?

Re: [R] 2D array of strings

2009-12-28 Thread milton ruser
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 franap...@gmail.comwrote: Sorry for the dumb question, but I

Re: [R] refering to the 'boundaries' of a graph

2009-12-28 Thread John Kane
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,

[R] nls error message

2009-12-28 Thread Jim Bouldin
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

[R] accessing members of a data.frame

2009-12-28 Thread Nick Torenvliet
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 have the

Re: [R] How to change the default Date format for write.csvfunction?

2009-12-28 Thread Tony Plate
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, %m/%d/%Y)

[R] Accessing members

2009-12-28 Thread Nick Torenvliet
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

Re: [R] What might be the security issues from installing R?

2009-12-28 Thread Barry Rowlingson
On Mon, Dec 28, 2009 at 6:23 PM, Peterson, Eric B. ebpeter...@usbr.gov 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

Re: [R] Accessing members

2009-12-28 Thread Thomas S. Dye
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:

Re: [R] Accessing member

2009-12-28 Thread John Kane
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 nick.torenvl...@gmail.com wrote: From: Nick Torenvliet nick.torenvl...@gmail.com Subject: [R] Accessing members To:

Re: [R] Have you used RGoogleDocs and RGoogleData?

2009-12-28 Thread Farrel Buchinsky
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

Re: [R] Help With Custom QQ Plot

2009-12-28 Thread Adam Carr
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

Re: [R] accessing members of a data.frame

2009-12-28 Thread jim holtman
?read.csv On Mon, Dec 28, 2009 at 5:31 PM, Nick Torenvliet nick.torenvl...@gmail.comwrote: 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)){

[R] subsetting by groups, with conditions

2009-12-28 Thread Seth W Bigelow
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

Re: [R] 2D array of strings

2009-12-28 Thread David Winsemius
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

Re: [R] subsetting by groups, with conditions

2009-12-28 Thread jim holtman
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 the

Re: [R] subsetting by groups, with conditions

2009-12-28 Thread Gabor Grothendieck
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)

Re: [R] subsetting by groups, with conditions

2009-12-28 Thread David Winsemius
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

Re: [R] Accessing members

2009-12-28 Thread GlenB
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,3))

Re: [R] Accessing members

2009-12-28 Thread David Winsemius
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

[R] ggplot2, building a simple formula interface

2009-12-28 Thread Bryan Hanson
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

Re: [R] anova

2009-12-28 Thread Richard M. Heiberger
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

Re: [R] Accessing members

2009-12-28 Thread Nick Torenvliet
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 dwinsem...@comcast.netwrote: On Dec 28, 2009, at 5:14 PM, Nick Torenvliet wrote:

[R] error logging

2009-12-28 Thread Nick Torenvliet
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

Re: [R] error logging

2009-12-28 Thread Gabor Grothendieck
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 nick.torenvl...@gmail.com wrote: Yet another question... I'm wondering if there is a built in facility to log errors.   I've got this

Re: [R] error logging

2009-12-28 Thread Nick Torenvliet
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 = message) 1/a #

[R] R2

2009-12-28 Thread Nancy Adam
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)

[R] how can I use R functions in Fortran 90

2009-12-28 Thread Anny Huang
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.

Re: [R] how can I use R functions in Fortran 90

2009-12-28 Thread Guo-Hao Huang
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 R.h void F77_SUB(rndstart)(void) {