>I am interested in R as an alternative for a statistical tool >at our firm.Ditto... I have recently moved to this agency from a company where I had access to Splus. There is also a coworker here who had used Splus at a previous employer. We both would like some access to the S language. We are considering either begging loud and long to try to get the agency to purchase two copies of Splus or trying to convert to R. This is not an easy decision under the circumstances and purchasing Splus will mean giving up something else. On the other hand I have never used R before and I fear the learning curve for using R plus possibly ESS. There are a few things I am trying to determine before I really decide what to do. I have been trying to convert some of my old Splus script files at home to run under R 1.7.0. Small (less than 50 lines or so) script files that I have tested run exactly as before. I tried to run one large simulation and it took about a week of screaming hell to get the error messages out (well all but one error message anyway). 1) I want a test suite for R. I noted in the messages (Date: Mon Feb 24 2003 - 22:18:03 EST) that Prof Ripley wrote "Well, R itself has lots of tests in its test suite (see directory tests in the sources) packages..." but I was too stupid to find them. Q1: Can someone provide directions to this test suite that even an idiot can follow? 2) Most of the problems I ran into had to do with missing values (in effect I have ragged arrays). One silly example is that I had made use of which.na 'which' apparently is not defined in R 1.7.0. There are multiple workarounds such as simply defining a function which.na but of course it would be untested and you can loop back to 1). The problem in my script files is the same I had in Splus. I want the defaults on all of the functions (such as mean, median, etc.) I am using to be reset GLOBALLY so that the default is to ignore missing values or not. Q2: Can the missing defaults be set globally for all functions. In other words, I want the default for how to treat NAs in all functions to be set at startup. 3) What I really want to do is pass a function name and extra arguments to another function. For example, in Splus, you can pass a function such as median to the bootstrap function. The bootstrap function says that you can pass arguments to the median function through the bootstrap function but unfortunately I could never make this work. This functionality would probably solve most of my NA problems if I could make it work. (I don't seem to be able to properly use the ellipses:) Pseudo-Example: The Splus bootstrap can be called as Bootstrap(variable-name, median, sampler=sample-function, na.rm=T) But I never figured out how to pass the na.rm=T as an argument to median so that the function being bootstrapped is median(variable-name, na.rm=T). Q3: Is there some way in R to pass alternative arguments through a function to another? 4) Any general thoughts on Splus versus R that you are willing to share? This is way too much blithering for one day but thanks in advance for any thoughts. Bob Baskin All the usual disclaimers that my statements don't represent the agency etc. etc. -----Original Message----- From: Marc Schwartz [mailto:mschwartz@medanalytics.com] Sent: Thursday, June 05, 2003 1:19 PM To: 'Fohr, Marc [AM]'; 'R-help@lists.R-project.org' Subject: RE: [R] Introductory Resources>-----Original Message----- >From: r-help-bounces@stat.math.ethz.ch >[mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Fohr, Marc[AM]>Sent: Thursday, June 05, 2003 11:46 AM >To: 'R-help@lists.R-project.org' >Subject: [R] (no subject) > > >Hello, > >I am interested in R as an alternative for a statistical tool >at our firm. I >do know RATS an SPSS but not S+. As I read that R is close to >S+, I would >like to know if you could recommend me any books as an >introduction to S+ or >R. > >Best regards > >MarcMarc, Reviewing R FAQs 2.7 and 3.x on the main R site would be a good place to start. The former lists books and other documents (some online) that serve as excellent introductions, while the latter helps to differentiate R and S/S+. Spending some time with those references and the R FAQs will serve as a good foundation, with keyword searches of the R-help list archive serving as an additional strong resource. HTH, Another Marc ______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help [[alternate HTML version deleted]]
I've been using S-Plus almost daily for roughly 7 years and testing R daily for the past 4 months. In my opinion, roughly 90% of the differences I've seen are in R's favor, e.g., the "log" options in the probability functions. I think the future lies with R, because I guessing that much of the most advanced algorithm development must be in R: I can modify an R function and give it to the world; if others find my modification useful, I get recognized for having made a contribution to science and humanity. If I do that with an S-Plus function, I'm a thief, because I've stolen Insightful's intellectual property. In brief, I believe that R is already superior to S-Plus, and the difference is increasing. I'm telling my collaborators who use S-Plus that our new software development should be tested in both R and S-Plus so we can switch whenever we need to. Hope this helps. Spencer Graves p.s. You'll find much more discussion of this by searching the r-news archives, "http://www.r-project.org/" -> Search -> "R Search Site". RBaskin at ahrq.gov wrote:>>I am interested in R as an alternative for a statistical tool >>at our firm. > > Ditto... > > I have recently moved to this agency from a company where I had access to > Splus. There is also a coworker here who had used Splus at a previous > employer. We both would like some access to the S language. We are > considering either begging loud and long to try to get the agency to > purchase two copies of Splus or trying to convert to R. This is not an easy > decision under the circumstances and purchasing Splus will mean giving up > something else. On the other hand I have never used R before and I fear the > learning curve for using R plus possibly ESS. > > There are a few things I am trying to determine before I really decide what > to do. I have been trying to convert some of my old Splus script files at > home to run under R 1.7.0. Small (less than 50 lines or so) script files > that I have tested run exactly as before. I tried to run one large > simulation and it took about a week of screaming hell to get the error > messages out (well all but one error message anyway). > > > 1) I want a test suite for R. I noted in the messages (Date: Mon Feb 24 > 2003 - 22:18:03 EST) that Prof Ripley wrote "Well, R itself has lots of > tests in its test suite (see directory tests in the sources) packages..." > but I was too stupid to find them. > Q1: Can someone provide directions to this test suite that even an idiot can > follow? > > > 2) Most of the problems I ran into had to do with missing values (in effect > I have ragged arrays). One silly example is that I had made use of which.na > 'which' apparently is not defined in R 1.7.0. There are multiple > workarounds such as simply defining a function which.na but of course it > would be untested and you can loop back to 1). The problem in my script > files is the same I had in Splus. I want the defaults on all of the > functions (such as mean, median, etc.) I am using to be reset GLOBALLY so > that the default is to ignore missing values or not. > Q2: Can the missing defaults be set globally for all functions. In other > words, I want the default for how to treat NAs in all functions to be set at > startup. > > > 3) What I really want to do is pass a function name and extra arguments to > another function. For example, in Splus, you can pass a function such as > median to the bootstrap function. The bootstrap function says that you can > pass arguments to the median function through the bootstrap function but > unfortunately I could never make this work. This functionality would > probably solve most of my NA problems if I could make it work. (I don't > seem to be able to properly use the ellipses:) > Pseudo-Example: The Splus bootstrap can be called as > Bootstrap(variable-name, median, sampler=sample-function, na.rm=T) > But I never figured out how to pass the na.rm=T as an argument to median so > that the function being bootstrapped is median(variable-name, na.rm=T). > Q3: Is there some way in R to pass alternative arguments through a function > to another? > > 4) Any general thoughts on Splus versus R that you are willing to share? > > > This is way too much blithering for one day but thanks in advance for any > thoughts. > > Bob Baskin > All the usual disclaimers that my statements don't represent the agency etc. > etc. > > > > > -----Original Message----- > From: Marc Schwartz [mailto:mschwartz at medanalytics.com] > Sent: Thursday, June 05, 2003 1:19 PM > To: 'Fohr, Marc [AM]'; 'R-help at lists.R-project.org' > Subject: RE: [R] Introductory Resources > > >>-----Original Message----- >>From: r-help-bounces at stat.math.ethz.ch >>[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Fohr, Marc > > [AM] > >>Sent: Thursday, June 05, 2003 11:46 AM >>To: 'R-help at lists.R-project.org' >>Subject: [R] (no subject) >> >> >>Hello, >> >>I am interested in R as an alternative for a statistical tool >>at our firm. I >>do know RATS an SPSS but not S+. As I read that R is close to >>S+, I would >>like to know if you could recommend me any books as an >>introduction to S+ or >>R. >> >>Best regards >> >>Marc > > > > Marc, > > Reviewing R FAQs 2.7 and 3.x on the main R site would be a good place > to start. The former lists books and other documents (some online) > that serve as excellent introductions, while the latter helps to > differentiate R and S/S+. > > Spending some time with those references and the R FAQs will serve as > a good foundation, with keyword searches of the R-help list archive > serving as an additional strong resource. > > HTH, > > Another Marc > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > > [[alternate HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
On Fri, 6 Jun 2003 12:04:47 -0400 , you wrote in message <3598558AD728D41183350008C7CF291C0F16B7F6 at exchange1.ahrq.gov>:>1) I want a test suite for R. I noted in the messages (Date: Mon Feb 24 >2003 - 22:18:03 EST) that Prof Ripley wrote "Well, R itself has lots of >tests in its test suite (see directory tests in the sources) packages..." >but I was too stupid to find them. >Q1: Can someone provide directions to this test suite that even an idiot can >follow?You need to download the source code to R from CRAN (e.g. cran.mirrors.pair.com), it's not in the precompiled binaries. You'll find the tests in the "tests" subdirectory. They consist of pairs of foo.R and foo.Rout.save files. When you run the tests via "make check", foo.Rout will be produced, and you'll be warned about differences from foo.Rout.save. Testing also runs almost all of the examples in every help file, and aborts if any generate errors (or warnings, I forget just now...). Package writers can include their own test scripts and saved output files.>Q2: Can the missing defaults be set globally for all functions. In other >words, I want the default for how to treat NAs in all functions to be set at >startup.option(na.action=<some function>) will control how all well-behaved functions handle NAs, but not all functions are well-behaved. Complain about those that should be but aren't (to the package maintainer in case of a contributed package, here or to r-bugs in case of a built-in package).>3) What I really want to do is pass a function name and extra arguments to >another function. For example, in Splus, you can pass a function such as >median to the bootstrap function. The bootstrap function says that you can >pass arguments to the median function through the bootstrap function but >unfortunately I could never make this work. This functionality would >probably solve most of my NA problems if I could make it work. (I don't >seem to be able to properly use the ellipses:) >Pseudo-Example: The Splus bootstrap can be called as >Bootstrap(variable-name, median, sampler=sample-function, na.rm=T) >But I never figured out how to pass the na.rm=T as an argument to median so >that the function being bootstrapped is median(variable-name, na.rm=T).>Q3: Is there some way in R to pass alternative arguments through a function >to another?Yes, I think this is similar in R and S-PLUS, so you might run into the same problems. Generally it's easy using ellipses, but if the argument name for your function happens to be the prefix of an argument name for the Bootstrap function, then you'll get a match there, instead of where you want it. For example, in R bootstrapping can be done using the function boot() in library(boot). It has arguments: boot(data, statistic, R, sim="ordinary", stype="i", strata=rep(1,n), L=NULL, m=0, weights=NULL, ran.gen=function(d, p) d, mle=NULL, ...) The ellipses will pass other arguments to the function passed as the statistic argument, but if you named them "str" they'd match "strata" instead of being passed to "...". Thus boot(vname, median, na.rm=T) should work, but myfunc <- function(x, str) median(x, na.rm=str) boot(vname, myfunc, str=T) would not.>4) Any general thoughts on Splus versus R that you are willing to share?S-PLUS has a more polished GUI. R is more responsive to bug reports. Duncan Murdoch
Thank you for your detailed response. < R is more responsive to bug reports.> and blithering from frustrated code converters :) < boot(vname, median, na.rm=T) should work, ...> agreed < but myfunc <- function(x, str) median(x, na.rm=str) boot(vname, myfunc, str=T) would not.> agreed What I actually wanted to do was more like: Myfunc <- function(vname, statistic, reps, ...) { some code boot(vname, statistic, ...) } myfunc(vname, median, 1000, na.rm=T) I never seemed to be able to convince Splus that I wanted the ellipses in myfunc to pass to the ellipses in boot (actually bootstrap). Thank you very much for your response - I have a lot of work to do now. Bob -----Original Message----- From: Duncan Murdoch [mailto:murdoch@stats.uwo.ca] Sent: Friday, June 06, 2003 1:51 PM To: Baskin, Robert Cc: R-help@stat.math.ethz.ch Subject: Re: [R] Introductory Resources On Fri, 6 Jun 2003 12:04:47 -0400 , you wrote in message <3598558AD728D41183350008C7CF291C0F16B7F6@exchange1.ahrq.gov>:>1) I want a test suite for R. I noted in the messages (Date: Mon Feb 24 >2003 - 22:18:03 EST) that Prof Ripley wrote "Well, R itself has lots of >tests in its test suite (see directory tests in the sources) packages..." >but I was too stupid to find them. >Q1: Can someone provide directions to this test suite that even an idiotcan>follow?You need to download the source code to R from CRAN (e.g. cran.mirrors.pair.com), it's not in the precompiled binaries. You'll find the tests in the "tests" subdirectory. They consist of pairs of foo.R and foo.Rout.save files. When you run the tests via "make check", foo.Rout will be produced, and you'll be warned about differences from foo.Rout.save. Testing also runs almost all of the examples in every help file, and aborts if any generate errors (or warnings, I forget just now...). Package writers can include their own test scripts and saved output files.>Q2: Can the missing defaults be set globally for all functions. In other >words, I want the default for how to treat NAs in all functions to be setat>startup.option(na.action=<some function>) will control how all well-behaved functions handle NAs, but not all functions are well-behaved. Complain about those that should be but aren't (to the package maintainer in case of a contributed package, here or to r-bugs in case of a built-in package).>3) What I really want to do is pass a function name and extra arguments to >another function. For example, in Splus, you can pass a function such as >median to the bootstrap function. The bootstrap function says that you can >pass arguments to the median function through the bootstrap function but >unfortunately I could never make this work. This functionality would >probably solve most of my NA problems if I could make it work. (I don't >seem to be able to properly use the ellipses:) >Pseudo-Example: The Splus bootstrap can be called as >Bootstrap(variable-name, median, sampler=sample-function, na.rm=T) >But I never figured out how to pass the na.rm=T as an argument to median so >that the function being bootstrapped is median(variable-name, na.rm=T).>Q3: Is there some way in R to pass alternative arguments through a function >to another?Yes, I think this is similar in R and S-PLUS, so you might run into the same problems. Generally it's easy using ellipses, but if the argument name for your function happens to be the prefix of an argument name for the Bootstrap function, then you'll get a match there, instead of where you want it. For example, in R bootstrapping can be done using the function boot() in library(boot). It has arguments: boot(data, statistic, R, sim="ordinary", stype="i", strata=rep(1,n), L=NULL, m=0, weights=NULL, ran.gen=function(d, p) d, mle=NULL, ...) The ellipses will pass other arguments to the function passed as the statistic argument, but if you named them "str" they'd match "strata" instead of being passed to "...". Thus boot(vname, median, na.rm=T) should work, but myfunc <- function(x, str) median(x, na.rm=str) boot(vname, myfunc, str=T) would not.>4) Any general thoughts on Splus versus R that you are willing to share?S-PLUS has a more polished GUI. R is more responsive to bug reports. Duncan Murdoch [[alternate HTML version deleted]]
RBaskin at ahrq.gov wrote>... > 1) I want a test suite for R. I noted in the messages (Date: Mon Feb 24 > 2003 - 22:18:03 EST) that Prof Ripley wrote "Well, R itself has lots of > tests in its test suite (see directory tests in the sources) packages..." > but I was too stupid to find them. > Q1: Can someone provide directions to this test suite that > even an idiot can follow?This is an area where R really shines. I still test my code with Splus (3.3) but I switched to maintaining it in R because of the test (quality assurance) facilities for packages. The tests indicated above are in $(RHOME)/tests and can be run when you build from source (in Linux or Unix) with ./configure make make check I expect what you really want is your own test suite. To do this put your code in an R package (see "Writing R Extensions") and put the tests in the tests directory. If the test code executes stop() or ends abnormally for another reason, then checking or building the package will fail with an error message indicating a problem. If you are really interested in this I will expand sometime. Paul Gilbert Head Statistician/Statisticien en chef, Department of Monetary and Financial Analysis, /D?partement des ?tudes mon?taires et financiers, Bank of Canada/Banque du Canada 234 Wellington St., Ottawa, Canada K1A 0G9 (613) 782-7346