Re: [R] R sumo package suggestion
Let them fail. Not all of the elisp code installed is self contained in the XEmacs bundles, but you won't use or know about them if you don't care. That's exactly what that snippet that I wrote before did -- ignored errors. best, -tony On Thu, 11 Nov 2004 15:59:09 -0500, Liaw, Andy [EMAIL PROTECTED] wrote: Good idea, IMHO, but there are some practical difficulties: I guess the XEmacs packages are (most, if not all) pure elisp code, and do not need other stuff to work. However, quite a few CRAN packages depend on external libraries or programs, and do not necessarily work on all platforms that R runs on. How would such dependencies be resolved in such a kitchen sink bundle? I have a somewhat related idea: Start labelling packages with a set of pre-defined categories, and a package can be labelled with more than one categories (especially those *misc type packages). It is then possible to have facility to let people install all packages that fall in a particular category (e.g., `spatial statistics'). I believe several systems have such facilities, Debian being one of them, TeXLive being another. Just my $0.02... Andy From: Rodney Sparapani r-help: I have an R package suggestion. After spending several hours the other day installing about a dozen packages, I had an idea. In xemacs, there is a sumo package which allows me to install a large bundle of xemacs packages at one time (about a 120 modes including ESS). I think R should have a similar bundle. It would be so much easier than hunting/downloading/installing. Martin encouraged me to send this suggestion to r-help. In addition, he put together a few comments relating to the previous times that this, or a similar suggestion, has been brought up here. Martin wrote: If you search for install all CRAN packages on http://maths.newcastle.edu.au/~rking/R/ (the URL which is quickly found from the [Search] sidebar of http://www.R-project.org/) You find things like Greg Warnes 'Makefile' http://tolstoy.newcastle.edu.au/R/help/04/04/0723.html and http://tolstoy.newcastle.edu.au/R/help/04/04/0616.html which is from Tony and has the following small function: installNewCRANPackages - function() { ## (C) A.J. Rossini, 2002--2004 test2 - packageStatus()$avail[Status] install.packages(row.names(test2)[which(test2$Status==not installed)]) } -- Rodney Sparapani Medical College of Wisconsin Sr. Biostatistician Patient Care Outcomes Research [EMAIL PROTECTED] http://www.mcw.edu/pcor Was 'Name That Tune' rigged? WWLD -- What Would Lombardi Do __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- best, -tony --- A.J. Rossini [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Problems installing ncdf package into R
Hello Can someone please look into the problem with installing ncdf package into R. I get this message when I try install it: install.packages(ncdf) trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 22827 bytes opened URL downloaded 22Kb Warning message: No package ncdf on CRAN. in: download.packages(pkgs, destdir = tmpd, available = available, I checked with the homepage cran.r-project.org, and the package is there. I have installed packages earlier into R with no problems. In advance, thanks for all help! Best Wishes Dag Johan Steinskog Bjerknes Center of Climate Research - University of Bergen, Norway __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] OLS error
On Thu, 11 Nov 2004, DrakeGis wrote: Thanks for the help. -I'm really sorry, but I'm affraid I can't publish any data in order to allow a reproduction of the results (enterprise policies :( ). The author of the Design package has already replied to this point. If the function only fails with your data, the data are the problem, not the function. -I'm using ols() from Design (Is there another ?) The posting guide does say read the appropriate documentation. R is distributed with lots of documentation, including An Introduction to R, see - Statistical models in R - Linear models. Reading the help page for the ols() function from the Design package will show that it adds functionality to the base lm() function, which your example is not using, so you can certainly use lm() until you need more. -Does version of R influence on the behavior of the packages ? I didn't know, I'm using Version 2.0.0 (2004-10-04), ISBN 3-900051-07-0 Yes, but this isn't the case here. If you had read the posting guide, you would understand that some questions are easier to answer when the version is known, and the version is found by typing version at the R prompt, surprisingly, and shows basic information about the OS too. So in addition to telling us which version of R you are using, you could say which package you are using, and provide a reproducible example. If you look at help(La.chol2inv), you will see that the function takes arguments: La.chol2inv(x, size = ncol(x)), where the x provided within the ols() function with your data has only one row. Could you perhaps make a data frame out of your variables, and use the data= argument? Are there many missing values in your variables? Have you tried complete.cases() on your input data? -I have no missing values. I previously try to use a data.frame but the was other error message, and because of that I split the data.frame, finally after you suggestions, I create a new data.frame and still didn't work until I attached a the new data.frame and it works. Please copy the contents of the console to your messages. Any of this could be caused by simple mistakes, attach() is not needed often (I never use it), and especially not for lm() and friends, which have the data= argument to be sure that the object in the formula is the one in the data= object, not any other with the same name that might be lying around. Try running in a fresh session too without loading your old workspace - one or other of your RHS variables is not what you think it is. There is very little doubt that you have problems with your data. However, you have not bothered to show the error messages to the list. Try to go through the same steps using lm() and making the data from runif() and rnorm() - simulated data using set.seed() - and then run the examples for lm(), etc, and if you can demonstrate that the functions still return errors, the cause should be easier to establish. Thanks D. - Stay ahead of the information curve. Receive GIS news and jobs on your desktop daily. Subscribe today to the GIS CafeNews newsletter. [ http://www10.giscafe.com/nl/newsletter_subscribe.php ] It's informative and essential. -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 e-mail: [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] wrong answer for simple expressions
Hi On 11 Nov 2004 at 12:24, Drew Hoysak wrote: I am experiencing strange (to me) output when trying to do simple calculations. Expressions that should equal zero yield non-zero values. Examples: a - 4.1-3.1 b - 5.1-4.1 a-b [1] -4.440892e-16 (4.1-3.1)-(5.1-4.1) [1] -4.440892e-16 When this last expression is expanded, I get the right answer: 4.1-3.1-5.1+4.1 [1] 0 I am using the binary packaged version R-2.0.0-0.fdr.1.fc2.i386.rpm for Linux Fedora Core 2. I had the same problem with version 1.9.0-0 Can anyone tell me what is going on? Floating point arithmetic is imprecise. Cheers Petr Thanks, Drew Hoysak __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Petr Pikal [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] R sumo package suggestion
Hello, I think Achim suggestion is more realistic: it does not imply automatic installation of all packages, but just a restricted list of packages available on CRAN about a specific topic. An easy way to get this result is to propose separate lists of packages. It means separate lists than http://cran.r-project.org/src/contrib/PACKAGES.html (and 'PACKAGES' in the Windows packages binaries). I don't see the problem to propose other lists that could be called 'SpatialStats.html' (in packages sources)/'SpatialStats' (in Windows binaries)... and the same for 'MachineLearning', 'Biostats', etc... Then, of course the various functions that install packages should be adapted to use these lists. It does not look like an unsurmontable task. Of course, if this is not done yet by the R Core Team, I presume that there must be difficulties that I don't see. It is obvious that, either we need a list maintainer for each topic, or we have to propose keywords for packages (similar to the keywords for functions) that will be used to automatically generate those separate lists. An alternative that can currently be used for groups of users in an institution is to maintain a local copy of R packages repository, which contains only the packages of interest for this group. I do so for my students. Under Windows, in the new R 2.0.1 beta, there is a new menu entry in packages - Set CRAN mirror... (in my version it does not work yet, looking for a missing .\doc\CRAN_mirrors.csv file), but I can easily figure out how it works and how I could append my own repository to the list to ease installation of a restricted list of R packages by my students. This is only for Windows, but a similar approach can also be used on other platforms with a little bit of coding. Best, Philippe ..°})) ) ) ) ) ) ( ( ( ( (Prof. Philippe Grosjean ) ) ) ) ) ( ( ( ( (Numerical Ecology of Aquatic Systems ) ) ) ) ) Mons-Hainaut University, Pentagone ( ( ( ( (Academie Universitaire Wallonie-Bruxelles ) ) ) ) ) 6, av du Champ de Mars, 7000 Mons, Belgium ( ( ( ( ( ) ) ) ) ) phone: + 32.65.37.34.97, fax: + 32.65.37.33.12 ( ( ( ( (email: [EMAIL PROTECTED] ) ) ) ) ) ( ( ( ( (web: http://www.umh.ac.be/~econum ) ) ) ) ) .. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Achim Zeileis Sent: Thursday, November 11, 2004 10:21 PM To: Liaw, Andy Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [R] R sumo package suggestion On Thu, 11 Nov 2004 15:59:09 -0500 Liaw, Andy wrote: Good idea, IMHO, but there are some practical difficulties: I guess the XEmacs packages are (most, if not all) pure elisp code, and do not need other stuff to work. However, quite a few CRAN packages depend on external libraries or programs, and do not necessarily work on all platforms that R runs on. How would such dependencies be resolved in such a kitchen sink bundle? I have a somewhat related idea: Start labelling packages with a set of pre-defined categories, and a package can be labelled with more than one categories (especially those *misc type packages). It is then possible to have facility to let people install all packages that fall in a particular category (e.g., `spatial statistics'). I believe several systems have such facilities, Debian being one of them, TeXLive being another. This is similar to idea that has been discussed from time to time for several years now: it would be nice to have maintained CRAN task views (or something like that), i.e., we could have a maintainer for, say spatial stats, another one for machine learning, biostats which can of course be overlapping. Then the maintainers would have to produce some sort of list of packages (in a standardized format) with a little bit of markup such that a web page can be generated from it and that the information could be used by install.packages(). I think most users would profit from that, but nobody has done the work to provide the infrastructure so far. I've just discussed this with Kurt again, a week ago or so...I wanted to play around with some ideas, but didn't get round to really do something yet. But hopefully, I'll get round to work on this in the next weeks. Z Just my $0.02... Andy From: Rodney Sparapani r-help: I have an R package suggestion. After spending several hours the other day installing about a dozen packages, I had an idea. In xemacs, there is a sumo package which allows me to install a large bundle of xemacs packages at one time (about a 120 modes including ESS). I think R should have a similar bundle. It would be so much easier than hunting/downloading/installing. Martin encouraged me to send this suggestion to r-help. In
Re: [R] R sumo package suggestion
One place to look, linked to the R development community, is the Bioconductor project where their GetBioC() function has package groupings (see http://www.bioconductor.org/getBioC.R) as an option. Perhaps, because of the specific focus of the Bioconductor suite, this is easier, but at least a template with R functionality already exists. andrew On 12 Nov 2004, at 09:48, Philippe Grosjean wrote: Hello, I think Achim suggestion is more realistic: it does not imply automatic installation of all packages, but just a restricted list of packages available on CRAN about a specific topic. An easy way to get this result is to propose separate lists of packages. It means separate lists than http://cran.r-project.org/src/contrib/PACKAGES.html (and 'PACKAGES' in the Windows packages binaries). I don't see the problem to propose other lists that could be called 'SpatialStats.html' (in packages sources)/'SpatialStats' (in Windows binaries)... and the same for 'MachineLearning', 'Biostats', etc... Then, of course the various functions that install packages should be adapted to use these lists. It does not look like an unsurmontable task. Of course, if this is not done yet by the R Core Team, I presume that there must be difficulties that I don't see. It is obvious that, either we need a list maintainer for each topic, or we have to propose keywords for packages (similar to the keywords for functions) that will be used to automatically generate those separate lists. An alternative that can currently be used for groups of users in an institution is to maintain a local copy of R packages repository, which contains only the packages of interest for this group. I do so for my students. Under Windows, in the new R 2.0.1 beta, there is a new menu entry in packages - Set CRAN mirror... (in my version it does not work yet, looking for a missing .\doc\CRAN_mirrors.csv file), but I can easily figure out how it works and how I could append my own repository to the list to ease installation of a restricted list of R packages by my students. This is only for Windows, but a similar approach can also be used on other platforms with a little bit of coding. Best, Philippe ..°})) ) ) ) ) ) ( ( ( ( (Prof. Philippe Grosjean ) ) ) ) ) ( ( ( ( (Numerical Ecology of Aquatic Systems ) ) ) ) ) Mons-Hainaut University, Pentagone ( ( ( ( (Academie Universitaire Wallonie-Bruxelles ) ) ) ) ) 6, av du Champ de Mars, 7000 Mons, Belgium ( ( ( ( ( ) ) ) ) ) phone: + 32.65.37.34.97, fax: + 32.65.37.33.12 ( ( ( ( (email: [EMAIL PROTECTED] ) ) ) ) ) ( ( ( ( (web: http://www.umh.ac.be/~econum ) ) ) ) ) .. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Achim Zeileis Sent: Thursday, November 11, 2004 10:21 PM To: Liaw, Andy Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [R] R sumo package suggestion On Thu, 11 Nov 2004 15:59:09 -0500 Liaw, Andy wrote: Good idea, IMHO, but there are some practical difficulties: I guess the XEmacs packages are (most, if not all) pure elisp code, and do not need other stuff to work. However, quite a few CRAN packages depend on external libraries or programs, and do not necessarily work on all platforms that R runs on. How would such dependencies be resolved in such a kitchen sink bundle? I have a somewhat related idea: Start labelling packages with a set of pre-defined categories, and a package can be labelled with more than one categories (especially those *misc type packages). It is then possible to have facility to let people install all packages that fall in a particular category (e.g., `spatial statistics'). I believe several systems have such facilities, Debian being one of them, TeXLive being another. This is similar to idea that has been discussed from time to time for several years now: it would be nice to have maintained CRAN task views (or something like that), i.e., we could have a maintainer for, say spatial stats, another one for machine learning, biostats which can of course be overlapping. Then the maintainers would have to produce some sort of list of packages (in a standardized format) with a little bit of markup such that a web page can be generated from it and that the information could be used by install.packages(). I think most users would profit from that, but nobody has done the work to provide the infrastructure so far. I've just discussed this with Kurt again, a week ago or so...I wanted to play around with some ideas, but didn't get round to really do something yet. But hopefully, I'll get round to work on this in the next weeks. Z Just my $0.02... Andy From: Rodney Sparapani r-help: I have an R package suggestion. After spending several hours the other day installing about a dozen packages, I had an idea. In xemacs, there is a sumo package which allows me to
[R] How to get mode (the most frequent value in distribution)?
Hello! I have a continous distribution and would like to get mode (the most frequent value in distribution). I easily found mean, median and other basic thing but not mode function. Can anyone help? I know there my might be problems with multiple modes, but still I think that there should be a mode function in R. Please send mail to R-help list and me, so I can get response faster. Thank you! -- Lep pozdrav / With regards, Gregor GORJANC --- University of Ljubljana Biotechnical Faculty URI: http://www.bfro.uni-lj.si Zootechnical Departmentmail: gregor.gorjanc at bfro.uni-lj.si Groblje 3 tel: +386 (0)1 72 17 861 SI-1230 Domzalefax: +386 (0)1 72 41 005 Slovenia __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] expressions and paste
The existence of bold function in base R library is a news for me! I think that you have to read something about plotmath function (with it you can write latex-like expressions). Best. A.S. Alessandro Semeria Models and Simulations Laboratory Montecatini Environmental Research Center (Edison Group), Via Ciro Menotti 48, 48023 Marina di Ravenna (RA), Italy Tel. +39 544 536811 Fax. +39 544 538663 E-mail: [EMAIL PROTECTED] Emily Baldock [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 12/11/2004 12.26 Please respond to emily.baldock To: Roger D. Peng [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject:Re: [R] expressions and paste I am trying to get a subscript into the title. My expression is quote(bold(apoA[bold(1)])) I have managed to get something near to what I want with sd2 -1.882 measure - g/L direction - increase chem - quote(bold(apoA[bold(1)])) plot(0,0) titletxt - substitute(paste(per , sd2, ,measure, , direction, \n in usual ,chem), list(chem = chem,sd2=sd2,measure=measure,direction=direction)) title(main=titletxt,cex.main=1.4,font.main=2) However, I can't get bold text this way. Emily. On 11 Nov 2004 at 12:58, Roger D. Peng wrote: Can you be a bit more specific? Exactly what kind of symbol are you trying to put in the title? -roger Emily Baldock wrote: I have written a function to plot data which will be used for various different chemistries. A simplified version is: plot_data - function(risk,levels,chem,sd2,measure){ plot(risk, levels,main=paste (per, sd2, measure, \n in usual, chem)) } The problem is with the title. This works fine if the variable chem is just text, but if it is an expression then obviously it won't work. I have experimented with various things and I am at a complete loss for how to insert an expression into the middle of a title. If the expression was going in directly I would use main=expression(paste(text , expression, text)) but again this doesn't work. Can anyone help? thanks Emily. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng/ __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Simple operation on a subset of data
Sorry for the silly question. I am trying to perform a simple operation on a subsample of my data loaded as data and attached: data-read.dta(name file) attach(data) Say x=1,2 and y=4,5 I want to summarize z only if x=1 y=4. I thought that the way to do that would be to write if((x=1) (y=4)) summary(z) butwhen I do this the result I get is for the whole data (irrespective of the conditions imposed). Can anyone help? Thanks Giacomo [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] dyn.load problem
Hi R-Users I wrote 1 week ago asking about a message that appears when I try run dyn.load. I'm trying to do an example in C code from Writing R Extension to learn how to do it. I have R 2.0.0, Rtools, Perl and MinGW as describe in http://www.murdoch-sutherland.com/Rtools/ with path sets. When I use C:\R\rw2000\binRCMD SHLIB -o C:/dev-cpp/teste.dll C:/dev-cpp/conv.c a teste.dll is created without error and located in that directory, but when I use it in RGui with Change dir set to C:/dev-cpp : dyn.load(teste.dll) results: Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library C:/Dev-Cpp/teste: LoadLibrary failure: Parâmetro incorreto. (Incorrect Parameter) My C code is (extracted form Writing R Extension): #include R.h #include Rinternals.h SEXP convolve2(SEXP a, SEXP b) { R_len_t i, j, na, nb, nab; double *xa, *xb, *xab; SEXP ab; PROTECT(a = coerceVector(a, REALSXP)); PROTECT(b = coerceVector(b, REALSXP)); na = length(a); nb = length(b); nab = na + nb - 1; PROTECT(ab = allocVector(REALSXP, nab)); xa = REAL(a); xb = REAL(b); xab = REAL(ab); for(i = 0; i nab; i++) xab[i] = 0.0; for(i = 0; i na; i++) for(j = 0; j nb; j++) xab[i + j] += xa[i] * xb[j]; UNPROTECT(3); return(ab); } I´m using RCMD under Windows ME. How can I fix this? Someone can help me ? Prof. Ripley told me to catch more information debbuging this DLL. Is it hard to do this one under Windows? It´s necessary modify files SHLIB or MkDLL? Thanks O. Neto __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Simple operation on a subset of data
Hi Giacomo, An Introduction to R is very useful document for all these things! Look at ?subset and try: dat - data.frame(x=sample(1:2, 10, TRUE), y=sample(c(4,5), 10, TRUE), z=rnorm(10)) ## summary(dat$z) summary(subset(dat, x==1 y==4, select=z)) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/396887 Fax: +32/16/337015 Web: http://www.med.kuleuven.ac.be/biostat http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm - Original Message - From: Giacomo De Giorgi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 12, 2004 1:04 PM Subject: [R] Simple operation on a subset of data Sorry for the silly question. I am trying to perform a simple operation on a subsample of my data loaded as data and attached: data-read.dta(name file) attach(data) Say x=1,2 and y=4,5 I want to summarize z only if x=1 y=4. I thought that the way to do that would be to write if((x=1) (y=4)) summary(z) butwhen I do this the result I get is for the whole data (irrespective of the conditions imposed). Can anyone help? Thanks Giacomo [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Problems installing ncdf package into R
Did you look at http://cran.us.r-project.org/bin/windows/contrib/2.0/ReadMe ? -roger [EMAIL PROTECTED] wrote: Hello Can someone please look into the problem with installing ncdf package into R. I get this message when I try install it: install.packages(ncdf) trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 22827 bytes opened URL downloaded 22Kb Warning message: No package ncdf on CRAN. in: download.packages(pkgs, destdir = tmpd, available = available, I checked with the homepage cran.r-project.org, and the package is there. I have installed packages earlier into R with no problems. In advance, thanks for all help! Best Wishes Dag Johan Steinskog Bjerknes Center of Climate Research - University of Bergen, Norway __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng/ __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to get mode (the most frequent value in distribution)?
__ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Re: How to get mode (the most frequent value in distribution)?
Hi Gregor, if you have a continous distribution is rather difficult that the same value is repeated many times. In this case I believe you could not find the mode (the most frequent value in distribution) as your distribution is continous, but only the modal class/interval (the interval of the distribution having the most frequency). See this example: set.seed(13) x-rnorm(100) xcut-cut(x, breaks=c(-4,-3,-2,-1,0,1,2,3,4)) table(xcut) xcut (-4,-3] (-3,-2] (-2,-1] (-1,0] (0,1] (1,2] (2,3] (3,4] 0 1 19 33 30 17 0 0 max(table(xcut)) [1] 33 the modal class/interval is (-1,0]. I hope I give a little help. Best Vito You wrote: Hello! I have a continous distribution and would like to get mode (the most frequent value in distribution). I easily found mean, median and other basic thing but not mode function. Can anyone help? I know there my might be problems with multiple modes, but still I think that there should be a mode function in R. Please send mail to R-help list and me, so I can get response faster. Thank you! -- Lep pozdrav / With regards, Gregor GORJANC = Diventare costruttori di soluzioni Became solutions' constructors The business of the statistician is to catalyze the scientific learning process. George E. P. Box Visitate il portale http://www.modugno.it/ e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_palese.shtml __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] How to get mode (the most frequent value in distribution) ?
A sample from a continuous distribution most likely has no meaningful sample mode. Shown below is a way to estimate the location of mode from a kernel density estimate (using the locfit package): x - rnorm(50) library(locfit) Locfit for R. August 3, 2000. (Updated for R 1.7.0, March 21, 2003) Attaching package 'locfit': The following object(s) are masked from package:stats : knots x.den - locfit(~x) x[which.max(predict(x.den, newdata=x))] [1] -0.615337 HTH, Andy From: Gregor GORJANC Hello! I have a continous distribution and would like to get mode (the most frequent value in distribution). I easily found mean, median and other basic thing but not mode function. Can anyone help? I know there my might be problems with multiple modes, but still I think that there should be a mode function in R. Please send mail to R-help list and me, so I can get response faster. Thank you! -- Lep pozdrav / With regards, Gregor GORJANC --- University of Ljubljana Biotechnical Faculty URI: http://www.bfro.uni-lj.si Zootechnical Departmentmail: gregor.gorjanc at bfro.uni-lj.si Groblje 3 tel: +386 (0)1 72 17 861 SI-1230 Domzalefax: +386 (0)1 72 41 005 Slovenia __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] How to get mode in case of discrete or categorial data
Dear all, in a previuos message was asked how get the mode of continous distribution. Now I'm asking if there an R function to obtain the mode in case of a discrete distribution or categorial data. The only way is to use table(): x-rep(1:5,100) s-sample(x,40) t-table(s) t s 1 2 3 4 5 13 10 5 4 8 the mode is value=1 Thanks Cordially Vito = Diventare costruttori di soluzioni Became solutions' constructors The business of the statistician is to catalyze the scientific learning process. George E. P. Box Visitate il portale http://www.modugno.it/ e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_palese.shtml __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] How to get mode in case of discrete or categorial data
Dear Vito, How about names(t)[t == max(t)], which will pick up multiple modes if there's a tie. By the way, I recall a discussion of this question on r-help not too long ago. I hope this helps, John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vito Ricci Sent: Friday, November 12, 2004 8:21 AM To: [EMAIL PROTECTED] Subject: [R] How to get mode in case of discrete or categorial data Dear all, in a previuos message was asked how get the mode of continous distribution. Now I'm asking if there an R function to obtain the mode in case of a discrete distribution or categorial data. The only way is to use table(): x-rep(1:5,100) s-sample(x,40) t-table(s) t s 1 2 3 4 5 13 10 5 4 8 the mode is value=1 Thanks Cordially Vito __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] an off-topic question - model validation
Assuming you have enough data, usually 1/4 to 1/2 is used for validation. One reference would be Picard, R.R. and Berk, K.N. (1990) Data Splitting, The American Statistician, 44;140-147. hth, b. -Original Message- From: Wensui Liu [mailto:[EMAIL PROTECTED] Sent: Thursday, November 11, 2004 10:20 PM To: [EMAIL PROTECTED] Subject: [R] an off-topic question - model validation Currently, I am working on a data mining project and plan to divide the data table into 2 parts, one for modeling and the other for validation to compare several models. But I am not sure about the percentage of data I should use to build the model and the one I should keep to validate the model. Is there any literature reference about this topic? Thank you so much! __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] R sumo package suggestion
Dear list member, sorry, for jumping in this thread and/or the gun. What springs immediately to my mind is: if such a functionality should be realised, it might be beneficial too to have something similar to Thomas Ruedas `texdocTK' at hand; i.e. the retrieval of the pdf-package documentations sorted by category and of course the manuals that are shipped with a base installation. Well, but one after the other... Best Regards, Bernhard Hello, I think Achim suggestion is more realistic: it does not imply automatic installation of all packages, but just a restricted list of packages available on CRAN about a specific topic. An easy way to get this result is to propose separate lists of packages. It means separate lists than http://cran.r-project.org/src/contrib/PACKAGES.html (and 'PACKAGES' in the Windows packages binaries). I don't see the problem to propose other lists that could be called 'SpatialStats.html' (in packages sources)/'SpatialStats' (in Windows binaries)... and the same for 'MachineLearning', 'Biostats', etc... Then, of course the various functions that install packages should be adapted to use these lists. It does not look like an unsurmontable task. Of course, if this is not done yet by the R Core Team, I presume that there must be difficulties that I don't see. It is obvious that, either we need a list maintainer for each topic, or we have to propose keywords for packages (similar to the keywords for functions) that will be used to automatically generate those separate lists. An alternative that can currently be used for groups of users in an institution is to maintain a local copy of R packages repository, which contains only the packages of interest for this group. I do so for my students. Under Windows, in the new R 2.0.1 beta, there is a new menu entry in packages - Set CRAN mirror... (in my version it does not work yet, looking for a missing .\doc\CRAN_mirrors.csv file), but I can easily figure out how it works and how I could append my own repository to the list to ease installation of a restricted list of R packages by my students. This is only for Windows, but a similar approach can also be used on other platforms with a little bit of coding. Best, Philippe ..°})) ) ) ) ) ) ( ( ( ( (Prof. Philippe Grosjean ) ) ) ) ) ( ( ( ( (Numerical Ecology of Aquatic Systems ) ) ) ) ) Mons-Hainaut University, Pentagone ( ( ( ( (Academie Universitaire Wallonie-Bruxelles ) ) ) ) ) 6, av du Champ de Mars, 7000 Mons, Belgium ( ( ( ( ( ) ) ) ) ) phone: + 32.65.37.34.97, fax: + 32.65.37.33.12 ( ( ( ( (email: [EMAIL PROTECTED] ) ) ) ) ) ( ( ( ( (web: http://www.umh.ac.be/~econum ) ) ) ) ) .. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Achim Zeileis Sent: Thursday, November 11, 2004 10:21 PM To: Liaw, Andy Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [R] R sumo package suggestion On Thu, 11 Nov 2004 15:59:09 -0500 Liaw, Andy wrote: Good idea, IMHO, but there are some practical difficulties: I guess the XEmacs packages are (most, if not all) pure elisp code, and do not need other stuff to work. However, quite a few CRAN packages depend on external libraries or programs, and do not necessarily work on all platforms that R runs on. How would such dependencies be resolved in such a kitchen sink bundle? I have a somewhat related idea: Start labelling packages with a set of pre-defined categories, and a package can be labelled with more than one categories (especially those *misc type packages). It is then possible to have facility to let people install all packages that fall in a particular category (e.g., `spatial statistics'). I believe several systems have such facilities, Debian being one of them, TeXLive being another. This is similar to idea that has been discussed from time to time for several years now: it would be nice to have maintained CRAN task views (or something like that), i.e., we could have a maintainer for, say spatial stats, another one for machine learning, biostats which can of course be overlapping. Then the maintainers would have to produce some sort of list of packages (in a standardized format) with a little bit of markup such that a web page can be generated from it and that the information could be used by install.packages(). I think most users would profit from that, but nobody has done the work to provide the infrastructure so far. I've just discussed this with Kurt again, a week ago or so...I wanted to play around with some ideas, but didn't get round to really do something yet. But hopefully, I'll
[R] whether R can import netcdf file format data ?
Hello R Users, Whether 'R' can import Netcdf format data files ?? Any package in 'R' that can help me on this front ?? Many thanks in advance, Regards, Yogesh -- === Yogesh K. Tiwari, Max-Planck Institute for Biogeochemistry, Postfach 10 01 64, D-07701 Jena, Germany Office : +49 3641 576376 Fax : +49 3641 577300 Home : +49 3641 672232 Mobile : +49 1736988789 e-mail : [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Mode in case of discrete or categorial data
Thanking John for his suggestion I build this function which get the mode of both categorial and discrete data. Mode-function(x){t-table(x) if (is.numeric(x)) as.numeric(names(t)[t == max(t)]) else (names(t)[t == max(t)]) } Any other improvement and suggestion will welcome. Best Vito s [1] 1 1 6 1 1 7 6 5 6 2 1 4 5 6 6 7 3 5 4 1 7 3 7 3 3 7 7 2 1 4 4 2 7 7 6 6 1 2 [39] 5 1 7 7 5 5 7 3 5 6 5 6 3 6 6 4 2 1 5 3 3 3 6 5 2 4 3 2 2 1 5 3 4 3 1 3 3 Mode(s) [1] 3 ss [1] C A C D B A B B B A D D A D D A D C B [20] D C B D C B C D A C A A A C A D A B B [39] A B Mode(ss) [1] A = Diventare costruttori di soluzioni Became solutions' constructors The business of the statistician is to catalyze the scientific learning process. George E. P. Box Visitate il portale http://www.modugno.it/ e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_palese.shtml __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] whether R can import netcdf file format data ?
On Fri, 12 Nov 2004, Yogesh K. Tiwari wrote: Whether 'R' can import Netcdf format data files ?? It can read from and write to them, at least. Any package in 'R' that can help me on this front ?? Do look at the `R Data Import/Export' manual that ships with R (a recent version is needed), or the R FAQ or the list of packages on CRAN. You will find RNetCDF, ncdf and ncvar. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] expressions and paste
Emily, are you right your code work, but this one maybe work better for you : sd2 -1.882 measure - (g/L) direction - increase chem - quote(apoA[bold(1)]) plot(0,0) titletxt - substitute(paste(bold(per) , , bold(sd2), ,bold(measure), , bold(direction), ,,bold(in usual ),bold(chem)),list(chem = chem,sd2=sd2,measure=measure,direction=direction)) title(main=titletxt) Is not elegant but it work! Best regard A.S. Alessandro Semeria Models and Simulations Laboratory Montecatini Environmental Research Center (Edison Group), Via Ciro Menotti 48, 48023 Marina di Ravenna (RA), Italy Tel. +39 544 536811 Fax. +39 544 538663 E-mail: [EMAIL PROTECTED] Emily Baldock [EMAIL PROTECTED] 12/11/2004 13.04 Please respond to emily.baldock To: [EMAIL PROTECTED] cc: Subject:Re: [R] expressions and paste I am using the plotmath function and have read a lot about it! If you run my code, you will find that it works, the problem isn't with creating the expression, but with including it in the title - the chemistry part of the title is bold, it is the rest of the title I want to get bold. Emily. On 12 Nov 2004 at 13:12, [EMAIL PROTECTED] wrote: The existence of bold function in base R library is a news for me! I think that you have to read something about plotmath function (with it you can write latex-like expressions). Best. A.S. Alessandro Semeria Models and Simulations Laboratory Montecatini Environmental Research Center (Edison Group), Via Ciro Menotti 48, 48023 Marina di Ravenna (RA), Italy Tel. +39 544 536811 Fax. +39 544 538663 E-mail: [EMAIL PROTECTED] [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Mode in case of discrete or categorial data
You might want to do a bit to handle NAs, as table() excludes them by default. Also, you could write it a bit cleaner as: Mode - function(x) { tab - table(x) m - names(tab)[tab == max(tab)] if (is.numeric(x)) m - as.numeric(m) m } (Generally I try avoiding constructs like: if (cond) var - alt1 else var - alt2 especially when alt1 and alt2 are very similar. If you need to make changes later, it's easy to change one and forget the other, etc. I believe Martin also made this point in his talk at useR! 2004.) HTH, Andy From: Vito Ricci Thanking John for his suggestion I build this function which get the mode of both categorial and discrete data. Mode-function(x){t-table(x) if (is.numeric(x)) as.numeric(names(t)[t == max(t)]) else (names(t)[t == max(t)]) } Any other improvement and suggestion will welcome. Best Vito s [1] 1 1 6 1 1 7 6 5 6 2 1 4 5 6 6 7 3 5 4 1 7 3 7 3 3 7 7 2 1 4 4 2 7 7 6 6 1 2 [39] 5 1 7 7 5 5 7 3 5 6 5 6 3 6 6 4 2 1 5 3 3 3 6 5 2 4 3 2 2 1 5 3 4 3 1 3 3 Mode(s) [1] 3 ss [1] C A C D B A B B B A D D A D D A D C B [20] D C B D C B C D A C A A A C A D A B B [39] A B Mode(ss) [1] A = Diventare costruttori di soluzioni Became solutions' constructors The business of the statistician is to catalyze the scientific learning process. George E. P. Box Visitate il portale http://www.modugno.it/ e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_palese.shtm l __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Simple operation on a subset of data
On Fri, 12 Nov 2004, Giacomo De Giorgi wrote: Say x=1,2 and y=4,5 I want to summarize z only if x=1 y=4. I thought that the way to do that would be to write if((x=1) (y=4)) summary(z) butwhen I do this the result I get is for the whole data (irrespective of the conditions imposed). Can anyone help? There are actually worse problems with if((x=1) (y=4)) summary(z) than that: you have just set x to 1 and y to 4. You can do summary(z[(x==1) (y==4)]) to get the answer you want (or various other things) You really need to read the Introduction to R, which will tell you, among other things, what the = operator does. -thomas __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Mode in case of discrete or categorial data
On Fri, 12 Nov 2004, Liaw, Andy wrote: You might want to do a bit to handle NAs, as table() excludes them by default. Also, you could write it a bit cleaner as: Mode - function(x) { tab - table(x) m - names(tab)[tab == max(tab)] if (is.numeric(x)) m - as.numeric(m) m } (Generally I try avoiding constructs like: if (cond) var - alt1 else var - alt2 especially when alt1 and alt2 are very similar. If you need to make changes later, it's easy to change one and forget the other, etc. I believe Martin also made this point in his talk at useR! 2004.) Also, var - if(cond) alt1 else alt2 is more idiomatic S (and easier to read). -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Mode in case of discrete or categorial data
On Fri, 12 Nov 2004, Vito Ricci wrote: Mode-function(x){t-table(x) if (is.numeric(x)) as.numeric(names(t)[t == max(t)]) else (names(t)[t == max(t)]) } Any other improvement and suggestion will welcome. which.max is design for finding the maximum, so names(t)[which.max(t)] -thomas __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] whether R can import netcdf file format data ?
I've been using the ncdf package for reading climate data (mostly, NCEP/NCAR and ECMWF reanalysis stuff). The package does what it says on the tin, but can become quite slow when working with large data sets (e.g. a stack of daily grids say 144x73 elements 1970-to date). Does anyone have any tips for speedy retrieval? I'm thinking about typical drilling/slicing type operations. Cheers, Ben -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Prof Brian Ripley Sent: 12 November 2004 15:05 To: Yogesh K. Tiwari Cc: [EMAIL PROTECTED] Subject: Re: [R] whether R can import netcdf file format data ? On Fri, 12 Nov 2004, Yogesh K. Tiwari wrote: Whether 'R' can import Netcdf format data files ?? It can read from and write to them, at least. Any package in 'R' that can help me on this front ?? Do look at the `R Data Import/Export' manual that ships with R (a recent version is needed), or the R FAQ or the list of packages on CRAN. You will find RNetCDF, ncdf and ncvar. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] email result as attachement
Ramzi == Ramzi TEMANNI [EMAIL PROTECTED] on Tue, 9 Nov 2004 12:55:50 +0100 writes: Ramzi Hi, Id like to know if it's possible to mail a file Ramzi (image generated with R) in attachments a similar to Ramzi bug.report Thanks in advance. I don't understand what attachments a similar to bug.report should mean. However the posting guide tells you to look here for more details http://www.r-project.org/mail#instructions and there it says, that image/png is an allowed attachment type (and application/pdf is too). Regards, Martin Maechler ETH Zurich; mailing lists' maintainer __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] RODBC POSIX Daylight Saving blues
Many thanks for the responses about how to read datetimes into POSIXct which refer to straight GMT times without regard to Daylight Saving. To reiterate, I''m using R 2.0.0 on win2000. I have tried Gabor's suggestion,see below, which did not work for me. The fundamental setting (for me) appears to be in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation The values here are most readily altered using the 'Date/ TIme properties' window (just double click the wee digital clock on the right of the window task bar). When I disable Daylight Saving a registry variable called DisableAutoDaylightTimeSet is created and is set to 1. This can be observed with regedit. Now all works perfectly with my date handling. So it seems that setting the timezone to GMT is necessary but not sufficient for my needs I confess that I do not understand the relationship between setting registry variables and environment (eg TZ=GMT). In practice I would like to keep my win200 machine with Daylight Saving enabled - for the sake of other applications. One strategy is to make the required registry alterations immediately before and after any R code which handles dates. But then I'm rather worried whether continuously enabling / disabling Daylight Saving would have dire consequences for other applications and the well-being of my already shaky OS. Is this the right route - and if so could someone please guide me how to achieve this in R for win2000? Perhaps a better strategy would be to introduce some set-able option within R that forced date handling to ignore Daylight Saving. But here I have insufficient expertise and can only appeal to the continuing generosity of the developer community. I am sure that there are many R users in the same position as me - but perhaps they don't all realize it! Many thanks Bernie McConnell [EMAIL PROTECTED] Sea Mammal Reserach Unit University of St Andrews -- Gabor Grothendieck ggrothendieck at myway.com writes: : : Prof Brian Ripley ripley at stats.ox.ac.uk writes: : : : If you set it to GMT for the duration of the sqlFetch call, it should do : : as you intended (but had not told R, which is not clairvoyant). : : : : On Windows you have to set the whole computer to GMT which has Paul Roebuck pointed out to me offlist that this can be done per process in Windows too so I was wrong on this point. ... start up Windows console ... cd \Program Files\rw2001beta set TZ=GMT bin\Rgui In R, Sys.time() # displays date and time in GMT time zone I also tried doing this from within R but was unsuccessful: R Sys.time() [1] 2004-11-11 11:37:53 Eastern Standard Time R Sys.putenv(TZ = GMT) R Sys.time() # wanted GMT result but did not get it [1] 2004-11-11 11:38:08 Eastern Standard Time R R.version.string # Windows XP [1] R version 2.0.1, 2004-11-04 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Mode in case of discrete or categorial data
Dear Thomas, I believe that which.max() will report only the first maximum in case of ties [which is why I suggested the more awkward t == max(t)]. Regards, John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Lumley Sent: Friday, November 12, 2004 10:44 AM To: Vito Ricci Cc: [EMAIL PROTECTED] Subject: Re: [R] Mode in case of discrete or categorial data On Fri, 12 Nov 2004, Vito Ricci wrote: Mode-function(x){t-table(x) if (is.numeric(x)) as.numeric(names(t)[t == max(t)]) else (names(t)[t == max(t)]) } Any other improvement and suggestion will welcome. which.max is design for finding the maximum, so names(t)[which.max(t)] -thomas __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to get mode (the most frequent value in distribution)?
Thanks to all! It appears that mode calculation is not easy or simple at all. I understand that it is problematic when you have continous distribution, but there should still be some general function, as for median, mean, ... -- Lep pozdrav / With regards, Gregor GORJANC --- University of Ljubljana Biotechnical Faculty URI: http://www.bfro.uni-lj.si Zootechnical Departmentmail: gregor.gorjanc at bfro.uni-lj.si Groblje 3 tel: +386 (0)1 72 17 861 SI-1230 Domzalefax: +386 (0)1 72 41 005 Slovenia __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Mode in case of discrete or categorial data
From: Thomas Lumley On Fri, 12 Nov 2004, Vito Ricci wrote: Mode-function(x){t-table(x) if (is.numeric(x)) as.numeric(names(t)[t == max(t)]) else (names(t)[t == max(t)]) } Any other improvement and suggestion will welcome. which.max is design for finding the maximum, so names(t)[which.max(t)] If you only care about one, which.max() is great. However, if you want to know about all possible ones, which.max() is not the tool: x - rep(1:5, c(5, 2, 1, 5, 1)) table(x) x 1 2 3 4 5 5 2 1 5 1 tab - table(x) tab[tab == max(tab)] x 1 4 5 5 tab[which.max(tab)] 1 5 Andy -thomas __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] RODBC POSIX Daylight Saving blues
On Fri, 12 Nov 2004 16:27:41 +, Bernie McConnell [EMAIL PROTECTED] wrote : Many thanks for the responses about how to read datetimes into POSIXct which refer to straight GMT times without regard to Daylight Saving. To reiterate, I''m using R 2.0.0 on win2000. I have tried Gabor's suggestion,see below, which did not work for me. The fundamental setting (for me) appears to be in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation The values here are most readily altered using the 'Date/ TIme properties' window (just double click the wee digital clock on the right of the window task bar). When I disable Daylight Saving a registry variable called DisableAutoDaylightTimeSet is created and is set to 1. This can be observed with regedit. Now all works perfectly with my date handling. So it seems that setting the timezone to GMT is necessary but not sufficient for my needs I confess that I do not understand the relationship between setting registry variables and environment (eg TZ=GMT). In practice I would like to keep my win200 machine with Daylight Saving enabled - for the sake of other applications. One strategy is to make the required registry alterations immediately before and after any R code which handles dates. But then I'm rather worried whether continuously enabling / disabling Daylight Saving would have dire consequences for other applications and the well-being of my already shaky OS. Is this the right route - and if so could someone please guide me how to achieve this in R for win2000? Perhaps a better strategy would be to introduce some set-able option within R that forced date handling to ignore Daylight Saving. But here I have insufficient expertise and can only appeal to the continuing generosity of the developer community. I am sure that there are many R users in the same position as me - but perhaps they don't all realize it! I think you probably want to use as.is=TRUE when you retrieve the results, then use the date conversion functions to specify the time zone explicitly, e.g. asPOSIXct(x, tz='GMT'). Duncan Murdoch __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Linux on PowerPC 970 (IBM BladeCenter JS20)
Hi, I'm just wondering if I can run R software on IBM BladeCenter JS20 PowerPC 970 based now. If it's not available, do you have any plan to port it for JS20? Both Red Hat Enterprise Linux AS3 and SUSE Linux Enterprise Server 8/9 are available on JS20. Thanks. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Firefox keyword searches for R S-Plus
If you've 'rediscovered the web' with Firefox (http://getfirefox.com), you might find this tip handy. Suppose you want to search the (local) R documentation for information about the lme function. Wouldn't it be nice to just type into the browser address bar: r lme and have the search performed? Here's how (on Windows): Click on this link: file:///C:/Progra~1/rw2000/doc/html/search/SearchObject.html?%s Bookmark the page and name the bookmark something like: R 2.0.0 doc search Edit the properties of the bookmark (by right-clicking on the bookmark) and in the keywords field enter: r Click OK. That's all there is to it except for a couple of notes: 1. The first time the local search is performed (during a browser session), the java search applet has to be loaded. This takes several seconds. 2. If you use a different operating system, a different version of R, or install R in a different location, change the bookmark path to the SearchObject file as appropriate. 3. By default this only searches Help page titles. You may prefer a more comprehensive search that includes Keywords and Object names. Edit the SearchObject.html file and change 'false' to 'true' in the following line: line = line + document.SearchEngine.search (searchstring,true,true,true); Here are my R and S-Plus bookmarks. I'll just give the link, my bookmark name, and my bookmark keyword. http://www.google.com/u/newcastlemaths?q=%s R mail archive search rh http://www.google.com/search?q=site:www.biostat.wustl.edu+[S]+%s S-news archive search sn file:///C:/Progra~1/rw2000/doc/html/search/SearchObject.html?%s R 2.0.0 doc search r Happy searching! Kevin Wright __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Linux on PowerPC 970 (IBM BladeCenter JS20)
Teruhito Hosono [EMAIL PROTECTED] writes: Hi, I'm just wondering if I can run R software on IBM BladeCenter JS20 PowerPC 970 based now. If it's not available, do you have any plan to port it for JS20? Both Red Hat Enterprise Linux AS3 and SUSE Linux Enterprise Server 8/9 are available on JS20. Shouldn't be a problem, but you'll most likely need to compile from sources. You could do us and yourself a favour and try to build the current beta version of 2.0.1 (release Monday) and report back so that we can try to fix problems before release (no promises though). The build process is very simple: ./configure ; make ; make check ; make install but you may find that you need to install a bunch of development libraries and such. -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R on 64-bit Linux machine
Hi, We are planning to buy a 64-bit Linux machine which will mainly run R. There was an interesting thread on 64-bits on r-help back in April that basically confirmed that the 64-bit R is fine as long as the length of an atomic object is less than 2^31 - 1. My specific question is on which 64-bit Linux distros (SUSE or RedHat) and processors R is *known* to build out-of-box and run well. Ease of maintenance is essential here. We have RedHat 7.3 on other (32-bit) machines and would try not to proliferate the OS-s. Your information will be highly appreciated, Thanks, Vadim [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Design Matrix
Dear all, I need some help on matrix design and B statistics by using limma package. I want to compare gene expression in 2 groups of cDNA samples. The experiment compares 4 treated mice(#1,#2,#3,#4) and 4 control mice (#5,#6,#7,#8). The target file is FileName Cy3 Cy5 mice1.spot Control_#5 Treat_#1 mice2.spot Treat_#1 Control_#5 mice3.spot Control_#6 Treat_#2 mice4.spot Treat_#3 Control_#7 mice5.spot Control_#8 Treat_#4 The first slide (mice1.spot) and the second slide(mice2.spot) are dye-swap. There is no common reference. There are 3 replicated spots of each gene on each array (384 genes in total). MA is an object of class marrayNorm, below is what I did. design - c(1,-1,1,-1,1) cor - duplicateCorrelation(MA,design,ndups=3) cor$consensus.correlation [1] 0.506 fit - lmFit(MA,design,ndups=3,correlation=cor$consensus.correlation) fit - eBayes(fit) topTable(fit,n=20,adjust=fdr) The result is, ID M A t P.Value B 348 -1.310.8-3.98 0.577 -4.47 371 -1.91 11.5-3.36 0.577 -4.47 172 -2.56 13.4-3.36 0.577 -4.47 273 -0.98 10.3-3.22 0.577 -4.48 ... It seems this is no evidence of differential expression. But if I use the first three slides to do analysis, design - c(1,-1,1),the result is good, B5, P.Value is very small. I am wondering if my design matrix is right? Many thanks in advance and best regards. Michelle __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R on 64-bit Linux machine
I've built (and routinely use) 64 bit R on the following platforms: Red Hat Enterprise Linux AS release 3 (AMD Opteron 848) Fedora Core 2 x86_64 (AMD Athlon 64 3800+) SuSE SLES 8 (AMD Opteron 248) One problem that has come up is that if you want to link R with ATLAS, you need to build shared ATLAS libraries (rather than static). This requires some modifications to the configuation files for ATLAS. But my experience shows that R itself builds out of the box on these systems. -roger Vadim Ogranovich wrote: Hi, We are planning to buy a 64-bit Linux machine which will mainly run R. There was an interesting thread on 64-bits on r-help back in April that basically confirmed that the 64-bit R is fine as long as the length of an atomic object is less than 2^31 - 1. My specific question is on which 64-bit Linux distros (SUSE or RedHat) and processors R is *known* to build out-of-box and run well. Ease of maintenance is essential here. We have RedHat 7.3 on other (32-bit) machines and would try not to proliferate the OS-s. Your information will be highly appreciated, Thanks, Vadim [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng/ __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R on 64-bit Linux machine
On Fri, 12 Nov 2004, Vadim Ogranovich wrote: Hi, We are planning to buy a 64-bit Linux machine which will mainly run R. There was an interesting thread on 64-bits on r-help back in April that basically confirmed that the 64-bit R is fine as long as the length of an atomic object is less than 2^31 - 1. That's an R limitation, not a 64-bit version one. My specific question is on which 64-bit Linux distros (SUSE or RedHat) and processors R is *known* to build out-of-box and run well. Ease of maintenance is essential here. We have RedHat 7.3 on other (32-bit) machines and would try not to proliferate the OS-s. Not RHEL 3: we sent that back for a refund and its compilers are too old to work well on AMD64. Fedora Core 3 is fine on AMD64, and is what I would recommend. We also run SuSe 9.1, but for people used to RH, Fedora is more familiar. CRAN will have 64-bit RPMs for x86_64 FC3 come R 2.0.1 (released on Monday) -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] R on 64-bit Linux machine
We've had good experience so far with the threaded Goto BLAS (on Opteron 244/248/250, SLES8). Has anyone tried building R with supposedly more optimized compilers (PGI, EKO, etc.)? If so, how do they stack up against GCC? Best, Andy From: Roger D. Peng I've built (and routinely use) 64 bit R on the following platforms: Red Hat Enterprise Linux AS release 3 (AMD Opteron 848) Fedora Core 2 x86_64 (AMD Athlon 64 3800+) SuSE SLES 8 (AMD Opteron 248) One problem that has come up is that if you want to link R with ATLAS, you need to build shared ATLAS libraries (rather than static). This requires some modifications to the configuation files for ATLAS. But my experience shows that R itself builds out of the box on these systems. -roger Vadim Ogranovich wrote: Hi, We are planning to buy a 64-bit Linux machine which will mainly run R. There was an interesting thread on 64-bits on r-help back in April that basically confirmed that the 64-bit R is fine as long as the length of an atomic object is less than 2^31 - 1. My specific question is on which 64-bit Linux distros (SUSE or RedHat) and processors R is *known* to build out-of-box and run well. Ease of maintenance is essential here. We have RedHat 7.3 on other (32-bit) machines and would try not to proliferate the OS-s. Your information will be highly appreciated, Thanks, Vadim [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng/ __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R on 64-bit Linux machine
On Fri, 12 Nov 2004, Roger D. Peng wrote: I've built (and routinely use) 64 bit R on the following platforms: Red Hat Enterprise Linux AS release 3 (AMD Opteron 848) Fedora Core 2 x86_64 (AMD Athlon 64 3800+) SuSE SLES 8 (AMD Opteron 248) One problem that has come up is that if you want to link R with ATLAS, you need to build shared ATLAS libraries (rather than static). This requires some modifications to the configuation files for ATLAS. But my experience shows that R itself builds out of the box on these systems. However, you will almost certainly get better performance out of the Goto BLAS implementations, and they are shared (and easy to use, much more so than ATLAS). -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Firefox keyword searches for R S-Plus
Hello Kevin, That's a good idea to use the functionnality of firefox to search for help in R. I wonder if that is possible to perform the search in the searchplugins (like google), I tried to but there is always the characters %20= that messed up with the one I was actually looking at. Maybe something I don't see well, I created the following file in my C:/Program Files/Mozilla Firefox/searchplugins directory (just copying the google one) _ # Mozilla/R plug-in by [EMAIL PROTECTED] search name=R description=R search engine method=GET action=file:///C:/Program%20Files/R/rw2000/doc/html/search/SearchObject.html input name= user interpret browserResultType=result charset = UTF-8 resultListStart=!--a-- resultListEnd=!--z-- resultItemStart=!--m-- resultItemEnd=!--n-- /search ___ Any idea ? Sorry for my english. Romain. [EMAIL PROTECTED] a écrit : If you've 'rediscovered the web' with Firefox (http://getfirefox.com), you might find this tip handy. Suppose you want to search the (local) R documentation for information about the lme function. Wouldn't it be nice to just type into the browser address bar: r lme and have the search performed? Here's how (on Windows): Click on this link: file:///C:/Progra~1/rw2000/doc/html/search/SearchObject.html?%s Bookmark the page and name the bookmark something like: R 2.0.0 doc search Edit the properties of the bookmark (by right-clicking on the bookmark) and in the keywords field enter: r Click OK. That's all there is to it except for a couple of notes: 1. The first time the local search is performed (during a browser session), the java search applet has to be loaded. This takes several seconds. 2. If you use a different operating system, a different version of R, or install R in a different location, change the bookmark path to the SearchObject file as appropriate. 3. By default this only searches Help page titles. You may prefer a more comprehensive search that includes Keywords and Object names. Edit the SearchObject.html file and change 'false' to 'true' in the following line: line = line + document.SearchEngine.search (searchstring,true,true,true); Here are my R and S-Plus bookmarks. I'll just give the link, my bookmark name, and my bookmark keyword. http://www.google.com/u/newcastlemaths?q=%s R mail archive search rh http://www.google.com/search?q=site:www.biostat.wustl.edu+[S]+%s S-news archive search sn file:///C:/Progra~1/rw2000/doc/html/search/SearchObject.html?%s R 2.0.0 doc search r Happy searching! Kevin Wright __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Romain François 25, avenue Guy Moquet 94 400 Vitry sur seine FRANCE ___ ___ [EMAIL PROTECTED] 01 46 80 65 60 06 18 39 14 69 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R on 64-bit Linux machine
Roger D. Peng [EMAIL PROTECTED] writes: I've built (and routinely use) 64 bit R on the following platforms: Red Hat Enterprise Linux AS release 3 (AMD Opteron 848) Fedora Core 2 x86_64 (AMD Athlon 64 3800+) SuSE SLES 8 (AMD Opteron 248) Nice to know about the Enterprise variants. FC2/3 and SUSE 9.1 are known good too (did anyone check 9.2 yet?). One problem that has come up is that if you want to link R with ATLAS, you need to build shared ATLAS libraries (rather than static). This requires some modifications to the configuation files for ATLAS. But my experience shows that R itself builds out of the box on these systems. Actually, you can just go through configuration and add -fPIC to the compiler flags. Then at the end, run ld --shared --whole-archive -o libatlas.so libatlas.a etc. [If you don't accept architectural defaults (as you probably shouldn't), the compile/optimize is going to take a while. I wouldn't know how big the difference is, but -fPIC _will_ force code differences.] -roger Vadim Ogranovich wrote: Hi, We are planning to buy a 64-bit Linux machine which will mainly run R. There was an interesting thread on 64-bits on r-help back in April that basically confirmed that the 64-bit R is fine as long as the length of an atomic object is less than 2^31 - 1. My specific question is on which 64-bit Linux distros (SUSE or RedHat) and processors R is *known* to build out-of-box and run well. Ease of maintenance is essential here. We have RedHat 7.3 on other (32-bit) machines and would try not to proliferate the OS-s. Your information will be highly appreciated, Thanks, Vadim [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng/ __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R on 64-bit Linux machine
Prof Brian Ripley [EMAIL PROTECTED] writes: ATLAS, you need to build shared ATLAS libraries (rather than static). This requires some modifications to the configuation files for ATLAS. But my experience shows that R itself builds out of the box on these systems. However, you will almost certainly get better performance out of the Goto BLAS implementations, and they are shared (and easy to use, much more so than ATLAS). I actually have different experience in the multithreaded case, at least with my favourite benchmark suite: inversion of a large matrix. I'd do some timings, but I have this ATLAS compile running just now... -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Stat. Computing 2005 Chambers Award competition
The Statistical Computing Section of the American Statistical Association announces the competition for the John M. Chambers Statistical Software Award. In 1998 the Association for Computing Machinery presented its Software System Award to John Chambers for the design and development of S. Dr. Chambers generously donated his award to the Statistical Computing Section to endow an annual prize for statistical software written by an undergraduate or graduate student. The prize carries with it a cash award of $1000, plus a substantial allowance for travel to the annual Joint Statistical Meetings where the award will be presented. Enclosed below is the full text of the award announcement. More details can be found at the Stat. Computing Section website at http://www.statcomputing.org. Best Regards, --José Pinheiro Awards Chair ASA Statistical Computing Section John M. Chambers Statistical Software Award Statistical Computing Section American Statistical Association The Statistical Computing Section of the American Statistical Association announces the competition for the John M. Chambers Statistical Software Award. In 1998 the Association for Computing Machinery presented its Software System Award to John Chambers for the design and development of S. Dr. Chambers generously donated his award to the Statistical Computing Section to endow an annual prize for statistical software written by an undergraduate or graduate student. The prize carries with it a cash award of $1000, plus a substantial allowance for travel to the annual Joint Statistical Meetings where the award will be presented. To be eligible, an entrant must have designed and implemented a piece of statistical software. The applicant must have begun the development while a student, and must either currently be a student, or have completed all requirements for their last degree after January 1, 2002. To apply for the award, entrants must provide the following materials: A current CV. A letter from a faculty mentor at their academic institution. The letter should confirm that the software is the work of the student, certify the student status of the entrant when the software began to be developed (and either the current student status and the date of degree completion), and briefly discuss the importance of the software to statistical practice. A brief, one to two page description of the software, summarizing what it does, how it does it, and why it is an important contribution. If the entrant has continued developing the software after finishing their studies, the description should indicate what was developed when the entrant was a student and what has been added since. Access to the software by the award committee for their use on inputs of their choosing. Access to the software can consist of an executable file, Web-based access, macro code, or other appropriate form. Access should be accompanied by enough information to allow the judges to effectively use and evaluate the software. This information can be provided in a variety of ways, including but not limited to a user manual (paper or electronic), a paper, a URL, online help to the system, and source code. In particular, the entrant must be prepared to provide complete source code for inspection by the committee if requested. All materials must be in English. We prefer that electronic text be submitted in Postscript or PDF. The entries will be judged on a variety of dimensions, including the importance and relevance for statistical practice of the tasks performed by the software, ease of use, clarity of description, elegance and availability for use by the statistical community. Preference will be given to those entries that are grounded in software design rather than calculation. The decision of the award committee is final. All application materials must be received by 5:00pm EST, Monday, February 28, 2005 at the address below. The winner will be announced in May and the award will be given at the 2005 Joint Statistical Meetings. Information on the competition can also be accessed on the website of the Statistical Computing Section (www.statcomputing.org or see the ASA website, www.amstat.org for a pointer), including the names and contributions of previous winners. Inquiries and application materials should be emailed or mailed to: Chambers Software Award c/o Dr. José Pinheiro Biostatistics, Novartis Pharmaceuticals One Health Plaza, Room 419/2115 East Hanover, NJ 07936 [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Firefox keyword searches for R S-Plus
Nice idea. A couple of comments. 1. I personally always install R in c:/R/ instead of c:/Program Files/ There are frequently comments on R-help that it is better to avoid paths with spaces. Still, you should be able to use /Progra~1/ instead of /Program Files/ 2. The search engine plugin that you have created generates a URL like this: .../SearchObject.html?q=nlme What is needed is a URL like .../SearchObject.html?%s where the %s is the string from the text box. I speculate it might be possible to change the SearchObject.html file to grab the q=nlme and strip off the q= but I have no idea if this is possible. I'm not comfortable with HTML/Java/Javascript to get this working properly. 3. My comment about editing the SearchObject.html file to change the false to true doesn't seem to cause the search to match the results obtained using the traditional way of opening the search page and typing in the text. I'm not sure why. Would love it if someone figured this out. Seems like all of this would be fairly easy for a good web programmer. Kevin Hello Kevin, That's a good idea to use the functionnality of firefox to search for help in R. I wonder if that is possible to perform the search in the searchplugins (like google), I tried to but there is always the characters %20= that messed up with the one I was actually looking at. Maybe something I don't see well, I created the following file in my C:/Program Files/Mozilla Firefox/searchplugins directory (just copying the google one) _ # Mozilla/R plug-in by [EMAIL PROTECTED] search name=R description=R search engine method=GET action=file:///C:/Program%20Files/R/rw2000/doc/html/search/SearchObject.html input name= user interpret browserResultType=result charset = UTF-8 resultListStart=!--a-- resultListEnd=!--z-- resultItemStart=!--m-- resultItemEnd=!--n-- /search ___ Any idea ? Sorry for my english. Romain. [EMAIL PROTECTED] a écrit : If you've 'rediscovered the web' with Firefox (http://getfirefox.com), you might find this tip handy. Suppose you want to search the (local) R documentation for information about the lme function. Wouldn't it be nice to just type into the browser address bar: r lme and have the search performed? Here's how (on Windows): Click on this link: file:///C:/Progra~1/rw2000/doc/html/search/SearchObject.html?%s Bookmark the page and name the bookmark something like: R 2.0.0 doc search Edit the properties of the bookmark (by right-clicking on the bookmark) and in the keywords field enter: r Click OK. That's all there is to it except for a couple of notes: 1. The first time the local search is performed (during a browser session), the java search applet has to be loaded. This takes several seconds. 2. If you use a different operating system, a different version of R, or install R in a different location, change the bookmark path to the SearchObject file as appropriate. 3. By default this only searches Help page titles. You may prefer a more comprehensive search that includes Keywords and Object names. Edit the SearchObject.html file and change 'false' to 'true' in the following line: line = line + document.SearchEngine.search (searchstring,true,true,true); Here are my R and S-Plus bookmarks. I'll just give the link, my bookmark name, and my bookmark keyword. http://www.google.com/u/newcastlemaths?q=%s R mail archive search rh http://www.google.com/search?q=site:www.biostat.wustl.edu+[S]+%s S-news archive search sn file:///C:/Progra~1/rw2000/doc/html/search/SearchObject.html?%s R 2.0.0 doc search r Happy searching! Kevin Wright __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Romain François 25, avenue Guy Moquet 94 400 Vitry sur seine FRANCE ___ ___ [EMAIL PROTECTED] 01 46 80 65 60 06 18 39 14 69 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Variance and Covariance Matrix D and R in nlme or lme4.
Hi, How extract the Variance and Covariance Matrices D of random effects and R of error in the lme object? Thanks in advance. Alexandre Galvão __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Variance and Covariance Matrix D and R in nlme or lme4 part II
The model is Y = XB + Zg + e where g~N(0, D) e~N(0, R) How to extract the VAR(g)= D, VAR(e)=R and V=ZDZ'+R? thanks __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] density estimation: compute sum(value * probability) for given distribution
Dear R users, This is a KDE beginner's question. I have this distribution: length(cap) [1] 200 summary(cap) Min. 1st Qu. MedianMean 3rd Qu.Max. 459.9 802.3 991.6 1066.0 1242.0 2382.0 I need to compute the sum of the values times their probability of occurence. The graph is fine, den - density(cap, from=min(cap), to=max(cap), give.Rkern=F) plot(den) However, how do I compute sum(values*probabilities)? The probabilities produced by the density function sum to only 26%: sum(den$y) [1] 0.2611142 Would it perhaps be ok to simply do sum(den$x*den$y) * (1/sum(den$y)) [1] 1073.22 ? Thank you, b. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] unavoidable loop? a better way??
Hi all, I have the following problem, best expressed by my present solution: # p is a vector myfunc - function (p) { x[1] - p[1] for (i in c(2:length(p))) { x[i] - 0.8*p[i] + 0.2*p[i-1] } return (x) } That is, I'm calculating a time-weighted average. Unfortunately the scale of the problem is big. length(p) in this case is such that each call takes about 6 seconds, and I have to call it about 2000 times (~3 hours). And, I'd like to do this each day. Thus, a more efficient method is desirable. Of course, this could be done faster by writing it in c, but I want to avoid doing that if there already exists something internal to do the operation quickly (because I've never programmed c for use in R). Can anybody offer a solution? I apologise if this is a naive question. James __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] unavoidable loop? a better way??
__ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] unavoidable loop? a better way??
I am very sorry. I've made a typo. The function should be: # p is a vector myfunc - function (p) { x[1] - p[1] for (i in c(2:length(p))) { x[i] - 0.8*p[i] + 0.2*x[i-1] } return (x) } James __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[Fwd: Re: [R] unavoidable loop? a better way??]
__ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] unavoidable loop? a better way??
On Saturday 13 November 2004 00:51, James Muller wrote: Hi all, I have the following problem, best expressed by my present solution: # p is a vector myfunc - function (p) { x[1] - p[1] for (i in c(2:length(p))) { x[i] - 0.8*p[i] + 0.2*p[i-1] } return (x) } Does this work at all? I get myfunc - function (p) { +x[1] - p[1] +for (i in c(2:length(p))) { + x[i] - 0.8*p[i] + 0.2*p[i-1] +} +return (x) + } myfunc(1:10) Error in myfunc(1:10) : Object x not found Anyway, simple loops are almost always avoidable. e.g., myfunc - function (p) { x - p x[-1] - 0.8 * p[-1] + 0.2 * p[-length(p)] x } Deepayan That is, I'm calculating a time-weighted average. Unfortunately the scale of the problem is big. length(p) in this case is such that each call takes about 6 seconds, and I have to call it about 2000 times (~3 hours). And, I'd like to do this each day. Thus, a more efficient method is desirable. Of course, this could be done faster by writing it in c, but I want to avoid doing that if there already exists something internal to do the operation quickly (because I've never programmed c for use in R). Can anybody offer a solution? I apologise if this is a naive question. James __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] unavoidable loop? a better way??
Take 3: # p is a vector myfunc - function (p) { x - rep(0,length(p)) x[1] - p[1] for (i in c(2:length(p))) { x[i] - 0.8*p[i] + 0.2*x[i-1] # note the x in the last term } return (x) } James On Sat, 13 Nov 2004 01:12:50 -0600, Deepayan Sarkar [EMAIL PROTECTED] wrote: On Saturday 13 November 2004 00:51, James Muller wrote: Hi all, I have the following problem, best expressed by my present solution: # p is a vector myfunc - function (p) { x[1] - p[1] for (i in c(2:length(p))) { x[i] - 0.8*p[i] + 0.2*p[i-1] } return (x) } Does this work at all? I get myfunc - function (p) { +x[1] - p[1] +for (i in c(2:length(p))) { + x[i] - 0.8*p[i] + 0.2*p[i-1] +} +return (x) + } myfunc(1:10) Error in myfunc(1:10) : Object x not found Anyway, simple loops are almost always avoidable. e.g., myfunc - function (p) { x - p x[-1] - 0.8 * p[-1] + 0.2 * p[-length(p)] x } Deepayan That is, I'm calculating a time-weighted average. Unfortunately the scale of the problem is big. length(p) in this case is such that each call takes about 6 seconds, and I have to call it about 2000 times (~3 hours). And, I'd like to do this each day. Thus, a more efficient method is desirable. Of course, this could be done faster by writing it in c, but I want to avoid doing that if there already exists something internal to do the operation quickly (because I've never programmed c for use in R). Can anybody offer a solution? I apologise if this is a naive question. James __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html