Re: [R] creating a certain type of matrix
Hi as only you know perfectly which halves and other portions of your matrices contain zeroes and which contain random numbers you has to finalize the function yourself. Here are few ideas. n-20 mat-matrix(0,n,(n/2)/5+1) #matrix of zeroes dd-dim(mat) # actual dimensions mat[1:(dd[1]/2),1]-1 #put 1 in first half of first column mat[((dd[1]/2)+1):dd[1],1]-rnorm(dd[1]/2,0,1) #put random numbers in following part of the matrix column 1 mat[((dd[1]/2)+1):(dd[1]/2)+dd[1]/4,2]-rnorm(dd[1]/4,0,1) #put random numbers in column2 than according to n and dd values you can put any numbers anywhere in your matrix e.g. in for loop (not.tested :-) for (i in 3:dd[2]) { arrange everything into following desired columns e.g. length.of.rand.numbers - (i-2)*5 my.rand.num- rnorm(length.of.rand.numbers, 0,1) start - dd[1]/2+dd[1]/4 end - start + length.of.rand.numbers mat[start:end, i]- my.rand.num } HTH Petr On 7 Feb 2006 at 0:07, Taka Matzmoto wrote: From: Taka Matzmoto [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Date sent: Tue, 07 Feb 2006 00:07:11 -0600 Subject:[R] creating a certain type of matrix Hi R users I like to generate a certain type of matrix. If there are 10 variables, the matrix will have nrow=10, ncol=((10/2))/5+1. so the resulting matrix's dimension 10 by 2. If there are 50 variables the dimension of the resulting matrix will be 50 by 6. The arrangement of elements of this matrix is important to me and I can't figure out how to arrange elements. If I have 20 variables. The resulting matrix will be 20 by 3 The first half of first column of the matrix will be 1s. The all elements on the second half of the first column of the matrix will be random numbers coming from rnorm(1,0,1). The first half of the second column of the matrix will be zeros. The first five elements of the second half of the second column of the matrix will be random numbers coming from rnorm(1,0,1). After that, the remaining elements of the second half will be zeros. The first half of the third column of the matrix will be zeors. The first five elements of the second half of the third column will be zeros too and then 5 random numbers coming from rnorm(1,0,1). If there are 40 variables the resulting matrix will be 40*5 The first half of first column of the matrix will be 1s. The all elements on the second half of the first column of the matrix will be random numbers coming from rnorm(1,0,1). The first half of the second column of the matrix will be zeros. The first five elements of the second half of the second column of the matrix will be random numbers coming from rnorm(1,0,1). After that, the remaining elements of the second half will be zeros. The first half of the third column of the matrix will be zeors. The first FIVE elements of the second half of the third column will be zeros too and then 5 random numbers coming from rnorm(1,0,1) and then the rest of elements of the third column will be zeros. The first half of the fourth column of the matrix will be zeors.The first TEN elements of the second half of the fourth column will be zeros too and then 5 random numbers coming from rnorm(1,0,1) and then the rest of elements of the third column will be zeros. The first half of the fifth column of the matrix will be zeors.The first FIFTEEN elements of the second half of the fourth column will be zeros too and then 5 random numbers coming from rnorm(1,0,1). I tried to create 10 different functions ( one for 10, 20, 30, 40, , 100 variables) but it's not efficient. Any help or advice for creating one function that can do all 10 kind of variable cases would be appreciated. Thans in advance Taka __ R-help@stat.math.ethz.ch 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] __ R-help@stat.math.ethz.ch 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 loop
Hi you are correct as usually. It is about 10 versions 1.2.0 - 2.2.1 and as there are 2 versions per year it is about 4-5 years. But nevertheless it seems to me as if I used R forever (and hopefully it will continue) Anyway subsetting data frames **was** similar in the old versions as it is now, wasn't it? Cheers Petr On 7 Feb 2006 at 8:56, Uwe Ligges wrote: Date sent: Tue, 07 Feb 2006 08:56:10 +0100 From: Uwe Ligges [EMAIL PROTECTED] Organization: Fachbereich Statistik, Universitaet Dortmund To: Petr Pikal [EMAIL PROTECTED] Copies to: r-help@stat.math.ethz.ch, ivo welch [EMAIL PROTECTED] Subject:Re: [R] R loop Petr Pikal wrote: Hi On 6 Feb 2006 at 15:57, ivo welch wrote: Date sent: Mon, 6 Feb 2006 15:57:30 -0500 From: ivo welch [EMAIL PROTECTED] To: Sean Davis [EMAIL PROTECTED] Copies to: [EMAIL PROTECTED], r-help r-help@stat.math.ethz.ch Subject: Re: [R] R loop data[ data$a == name2 ] # does not work and gives a weird result, yuck data[data$a==name2,] sorry about this. I believe a few versions back, one could not subset data frames, so I did not even check what I wrote. Works now. It depends on what you consider few versions back. I started with R vesion 1.2.0 about 10 years I bet 200$ (or EUR) you have not used R 10 years ago. ;-) People certainly remember the 1.0.0 release at the remarkable day 29-FEB-2000. 1.2.0 was released in December 2000, about 5 years ago. I started with 0.62.x in 1998. The oldest version I found on CRAN is a pre-alpha R.sea.hqx for the Mac dated 07-Nov-1996. Uwe Ligges ago and I believe that data frame subsetting was done in **very** similar manner as it is performed now. Cheers Petr Look at ?order. I know. This is why I suggested only that we need a wrapper that plugs an order() functionality into the sort() function (which fortunately points in its docs to order)---but novices would find the sort syntax easier. regards, /iaw __ R-help@stat.math.ethz.ch 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] __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] __ R-help@stat.math.ethz.ch 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] install package in Mac
Hi, all I have problem about installing package (built in Windows) in Mac. In the R for MacOS X FAQ, it mentioned that Mac required the prebuilt package named as XXX.tgz. However, the package built under Windows named as XXX.zip. So how should I do to let the package (built in Windows) to install in Mac. Thanks in advance !! __ R-help@stat.math.ethz.ch 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 loop
Petr Pikal wrote: Hi you are correct as usually. It is about 10 versions 1.2.0 - 2.2.1 and as there are 2 versions per year it is about 4-5 years. But nevertheless it seems to me as if I used R forever (and hopefully it will continue) Anyway subsetting data frames **was** similar in the old versions as it is now, wasn't it? Yes, AFAIR, and just tested in 1.2.2. Uwe Ligges Cheers Petr On 7 Feb 2006 at 8:56, Uwe Ligges wrote: Date sent:Tue, 07 Feb 2006 08:56:10 +0100 From: Uwe Ligges [EMAIL PROTECTED] Organization: Fachbereich Statistik, Universitaet Dortmund To: Petr Pikal [EMAIL PROTECTED] Copies to:r-help@stat.math.ethz.ch, ivo welch [EMAIL PROTECTED] Subject: Re: [R] R loop Petr Pikal wrote: Hi On 6 Feb 2006 at 15:57, ivo welch wrote: Date sent: Mon, 6 Feb 2006 15:57:30 -0500 From:ivo welch [EMAIL PROTECTED] To: Sean Davis [EMAIL PROTECTED] Copies to: [EMAIL PROTECTED], r-help r-help@stat.math.ethz.ch Subject: Re: [R] R loop data[ data$a == name2 ] # does not work and gives a weird result, yuck data[data$a==name2,] sorry about this. I believe a few versions back, one could not subset data frames, so I did not even check what I wrote. Works now. It depends on what you consider few versions back. I started with R vesion 1.2.0 about 10 years I bet 200$ (or EUR) you have not used R 10 years ago. ;-) People certainly remember the 1.0.0 release at the remarkable day 29-FEB-2000. 1.2.0 was released in December 2000, about 5 years ago. I started with 0.62.x in 1998. The oldest version I found on CRAN is a pre-alpha R.sea.hqx for the Mac dated 07-Nov-1996. Uwe Ligges ago and I believe that data frame subsetting was done in **very** similar manner as it is performed now. Cheers Petr Look at ?order. I know. This is why I suggested only that we need a wrapper that plugs an order() functionality into the sort() function (which fortunately points in its docs to order)---but novices would find the sort syntax easier. regards, /iaw __ R-help@stat.math.ethz.ch 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] __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] __ R-help@stat.math.ethz.ch 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] install package in Mac
Rhett Eckstein wrote: Hi, all I have problem about installing package (built in Windows) in Mac. In the R for MacOS X FAQ, it mentioned that Mac required the prebuilt package named as XXX.tgz. However, the package built under Windows named as XXX.zip. So how should I do to let the package (built in Windows) to install in Mac. On Windows, build a source package (hence ending .tar.gz) and install this source package on the Mac. You cannot use Windows binary packages on the Mac. Uwe Ligges Thanks in advance !! __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] cdf of multivariate normal
Juan Pablo Lewinger wrote: I was wondering if anybody has written R code to compute the cdf of a multivariate (or at least a bivariate) normal distribution with given covariance structure. See ?pmvnorm in package mvtnorm. Uwe Ligges __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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 loop
Uwe Ligges [EMAIL PROTECTED] writes: Petr Pikal wrote: Hi you are correct as usually. It is about 10 versions 1.2.0 - 2.2.1 and as there are 2 versions per year it is about 4-5 years. [That calculus only goes back to 2001, though, previous to that the release rate was higher (and the numbering stranger). And it is of course a coincidence that 2.0.0 followed 1.9.x.] But nevertheless it seems to me as if I used R forever (and hopefully it will continue) Anyway subsetting data frames **was** similar in the old versions as it is now, wasn't it? Yes, AFAIR, and just tested in 1.2.2. AFAIR, the current data frame code was adopted in late 1997 from the code that John Chambers had donated to Statlib... -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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] panel.levelplot() for 2D histograms
-Original Message- From: Deepayan Sarkar [mailto:[EMAIL PROTECTED] Sent: Monday, February 06, 2006 9:52 PM To: Vermeiren, Hans [VRCBE] Cc: [EMAIL PROTECTED] Subject: Re: panel.levelplot() for 2D histograms On 2/6/06, Vermeiren, Hans [VRCBE] [EMAIL PROTECTED] wrote: Dear R-wizards, I'm trying to plot binned scatterplots, or 2d histograms, if you wish, for a number of groups by using the lattice functionality it works fine for one group at a time, and probably I could find a work-around, but I prefer to do it the elegant way here's an example of what I want, what I tried and where it goes wrong: If you are doing this for fun, read on. Otherwise, I suggest that you look at the hexbin package (available from bioconductor) for a better solution. The development version (to be released after R 2.3.0) already has a lattice-ified interface called 'hexbinplot'. for fun ? yes and no, I really need this for my job, but otoh, working with R is always fun thanks a lot for the pointer to hexbin, that's really what I was looking for, but i did read on and I'll try the grid.rect hint as well (just for fun) thanks again, Hans __ R-help@stat.math.ethz.ch 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] Scatterplot with corner at (0, 0)
Thomas L Jones wrote: I have two vectors, x and y, and I want to create a scatterplot. I want the lower left corner to be at (0, 0). I can create a scatterplot just by calling plot (x, y), but I am quite throroughly stymied and frustrated by the problem of putting the lower left corner at (0, 0), despite many tries. plot(x,y,xlim=c(0,max(x)),ylim=c(0,max(y)),xaxs=i,yaxs=i) You may want to leave a bit of extra room at the higher values either like this: xlim=c(0,1.05*max(x)) or by using an arbitrary value that is above the maximum: ylim=c(0,5) Jim __ R-help@stat.math.ethz.ch 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] prehistoric versions of R -- 1995!
UweL == Uwe Ligges [EMAIL PROTECTED] on Tue, 07 Feb 2006 08:56:10 +0100 writes: UweL Petr Pikal wrote: Hi On 6 Feb 2006 at 15:57, ivo welch wrote: Date sent: Mon, 6 Feb 2006 15:57:30 -0500 From:ivo welch [EMAIL PROTECTED] To: Sean Davis [EMAIL PROTECTED] Copies to: [EMAIL PROTECTED], r-help r-help@stat.math.ethz.ch Subject: Re: [R] R loop data[ data$a == name2 ] # does not work and gives a weird result, yuck data[data$a==name2,] sorry about this. I believe a few versions back, one could not subset data frames, so I did not even check what I wrote. Works now. It depends on what you consider few versions back. I started with R vesion 1.2.0 about 10 years UweL I bet 200$ (or EUR) you have not used R 10 years ago. ;-) UweL People certainly remember the 1.0.0 release at the remarkable day UweL 29-FEB-2000. UweL 1.2.0 was released in December 2000, about 5 years ago. UweL I started with 0.62.x in 1998. UweL The oldest version I found on CRAN is a pre-alpha R.sea.hqx for the Mac UweL dated 07-Nov-1996. Eehm; that has a wrong date (or then it would not be pre-alpha): I've always entertained the prehistoric directory of R sources at ftp://stat.ethz.ch/Software/R/alpha/PreHistoric/ and its oldest file is Name SizeDate R-0.1alpha.tar.gz 861464 Feb 12 1996 (which will be 10 years coming Sunday -- what a jubilee!!) So, even that is not pre-alpha; and yes, that was a bit before CRAN existed. Now to the pre-alpha history. I've digged some more and found 1) that the mac file mentioned above would have correct date 'Nov 6 1995' (at least that's the date I saved when I looked at the Auckland FTP server through Emacs ange-ftp). 2) The oldest stuff that I have is all from 1995; The source I (think I) had first used is dated June 20 1995; notably the R-unix-src.tar.gz with accompanying README and INSTALL files (There was also ./win subdirectory which I did not use, with files all from July 15, 1995; AFAIK done by Robert Gentleman) I've now put a bit of these oldest files into ftp://stat.ethz.ch/Software/R/alpha/PreHistoric/pre-alpha/ 3) I've kept an e-mail that Ross had sent me on July 28 with two small patches to the (June 20) sources. Yes, chances are pretty high that I was the first one outside of the Auckland(NZ)-community to actively use R. Note it might be interesting to find even older sources, but that would most probably have to be by Robert and Ross (or a sysadmin at Auckland). Martin Maechler, ETH Zurich __ R-help@stat.math.ethz.ch 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] qqplot
Hello, I would like to use qqplot() to compare two experimental distributions. But I do not understand how qqplot() compute quantiles. In fact, quantile() do not return the same results. Thank you for your help. Vincent. __ R-help@stat.math.ethz.ch 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] qqplot
On 2/6/2006 9:59 AM, Vincent Negre wrote: Hello, I would like to use qqplot() to compare two experimental distributions. But I do not understand how qqplot() compute quantiles. In fact, quantile() do not return the same results. Take a look at the source code. qqplot replaces the longer vector with one calculated by linear interpolation (that's what approx does) between the values of the other. Duncan Murdoch __ R-help@stat.math.ethz.ch 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-2.2.1-INSTALL Issue with TCLTK
I am sorry but I think I didn't do a reply all, when I replied to Prof. Ripley. I did try what he suggested. I have installed tcl-8.4.12 and tk-8.4.12 in another folder and given explicit path to those lib folders for the tclConfig.sh tkConfig.sh. I also tried using the /usr/lib tcl/tk installs (version 8.3) and both times I am getting the tcltk package installed in my R version minus the libs folder. bash-2.05b# cd /grid/gro/vol/minigrid/tcl-8.4.12/lib bash-2.05b# ls -ltr total 824 -rw-r--r--1 rstatrstat7381 Feb 2 09:28 tclConfig.sh drwxr-xr-x8 rstatrstat1024 Feb 2 09:28 tcl8.4 -rw-rw-r--1 rstatrstat1664 Feb 2 09:28 libtclstub8.4.a -r-xr-xr-x1 rstatrstat 805566 Feb 2 09:28 libtcl8.4.so bash-2.05b# pwd /grid/gro/vol/minigrid/tk-8.4.12/lib bash-2.05b# ls -ltr total 984 -rw-r--r--1 rstatrstat3816 Feb 3 11:28 tkConfig.sh -rw-rw-r--1 rstatrstat3258 Feb 3 11:28 libtkstub8.4.a -r-xr-xr-x1 rstatrstat 974048 Feb 3 11:28 libtk8.4.so drwxr-xr-x5 rstatrstat2048 Feb 3 11:28 tk8.4 Furthermore, the only warning/error in get out of configure is: R is now configured for i686-pc-linux-gnu Source directory: . Installation directory:/grid/gro/vol/minigrid/R-2.2.1 C compiler:gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -g -O2 C++ compiler: g++ -g -O2 Fortran compiler: g77 -g -O2 Interfaces supported: X11 External libraries:readline Additional capabilities: iconv, MBCS, NLS Options enabled: shared library, R profiling, Linux LFS Recommended packages: yes configure: WARNING: Tcl and Tk major or minor versions disagree configure: WARNING: you cannot build info or html versions of the R manuals Respectfully Gautam -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Dalgaard Sent: Monday, February 06, 2006 6:56 PM To: Bhola, Gautam Cc: r-help@stat.math.ethz.ch Subject: Re: [R] R-2.2.1-INSTALL Issue with TCLTK Bhola, Gautam [EMAIL PROTECTED] writes: I haven't seen any updates/suggestions on this topic, so just wondering?? As far as I can see, the ball is on your half, so why are you expecting any? Did you do as Brian suggested? -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Friday, February 03, 2006 3:20 PM To: Bhola, Gautam Cc: r-help@stat.math.ethz.ch Subject: Re: [R] R-2.2.1-INSTALL Issue with TCLTK Those don't look like valid paths to config files to me. On FC3 they would be /usr/lib/tclConfig.sh /usr/lib/tkConfig.sh So even if you have users tcl-8.4.12 and tk-8.4.12 (do you?), your paths are almost surely not to config files. Configure reports what works, including that it is not going to build tcl/tk support. Look back at the relevant parts of its output. On Fri, 3 Feb 2006, Bhola, Gautam wrote: Hi I am not able to have a working tcltk library in R-2.2.1 inspite of trying different options suggested in the FAQ's. I am using the following configure option and I do get the tcltk package installed but with a missing libs folder. ./configure -prefix= ~R-2.2.1 --enable-R-shlib --enable-linux-lfs --with-zlib --with-gnu-ld --with-tcltk --with-tcl-config=~tcl-8.4.12/lib --with-tk-config=~tk-8.4.12/lib I have ensured that I have a valid tclsh in my path and have even provided the include path for covering the tcl.h Operating system: RHEL The error I get while trying to invoke the libarary for tcltk is: Error in firstlib(which.lib.loc, package) : Tcl/Tk support is not available on this system Error in library(tcltk) : .First.lib failed for 'tcltk' Execution halted Any help to identify the cause is highly appreciated. Respectfully Gautam -- LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- 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 -- LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}
Re: [R] cdf of multivariate normal
Hi, you can check ?pmvnorm in package 'mvtnorm' Marco --- Juan Pablo Lewinger [EMAIL PROTECTED] wrote: I was wondering if anybody has written R code to compute the cdf of a multivariate (or at least a bivariate) normal distribution with given covariance structure. __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] qqplot
[Vincent Negre] [...] I do not understand how qqplot() compute quantiles. Just type ``qqplot`` (without the parentheses) at the R prompt, to see the source code. ``qqplot`` does not especially compute quantiles, which are rather obtained directly through sorting its arguments. -- François Pinard http://pinard.progiciels-bpi.ca __ R-help@stat.math.ethz.ch 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] Using R to process spectroscopic data
Dear R-users, I would like to process some spectroscopic data with R, and I was hoping some people might have some example code on how to do this. I would like to be able to do the following things: * Detect outlier-spectra - This can be done by using scoreplot from the pls package * Determine the range of the spectrum to be used - For this, I should be able to calculate the regression coefficients * Determine the optimal number of elements in a model * Anything else that you guys think could be useful :-) Any help is greatly appreciated Dirk -- Dirk De Becker Work: Kasteelpark Arenberg 30 3001 Heverlee phone: ++32(0)16/32.14.44 fax: ++32(0)16/32.85.90 Home: Waversebaan 90 3001 Heverlee phone: ++32(0)16/23.36.65 [EMAIL PROTECTED] mobile phone: ++32(0)498/51.19.86 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm __ R-help@stat.math.ethz.ch 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- License
Hello. We are trying to install R on our network, and I wanted to ask if there is a user license agreement. I will be grateful if somebody can send me a link to it; if one exists. Thank you very much *** Antonio Paredes USDA- Center for Veterinary Biologics Biometrics Unit 510 South 17th Street, Suite 104 Ames, IA 50010 (515) 232-5785 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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] Application of R
I have applied the R and MNP to carry out the data analysis. However, there is an error called SWP : singular matrix. Can someone tell me what is the problem of my formula or the file mydata. I have attached the data file mydata in Excel format and the result printed in pdf format for your information. Thanks for your advice. result 20060207.pdf Description: Adobe PDF document __ R-help@stat.math.ethz.ch 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- License
Type license() for this info -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, February 07, 2006 8:50 AM To: r-help@stat.math.ethz.ch Subject: [R] R- License Hello. We are trying to install R on our network, and I wanted to ask if there is a user license agreement. I will be grateful if somebody can send me a link to it; if one exists. Thank you very much *** Antonio Paredes USDA- Center for Veterinary Biologics Biometrics Unit 510 South 17th Street, Suite 104 Ames, IA 50010 (515) 232-5785 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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- License
Hi, From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Subject: [R] R- License Hello. We are trying to install R on our network, and I wanted to ask if there is a user license agreement. I will be grateful if somebody can send me a link to it; if one exists. if you have it installed already (maybe on your own computer), you can enter licence() or license() which should give you, hopefully, what you are looking for. If you haven't installed it, I pasted the output below. Hope this helps, Roland licence() This software is distributed under the terms of the GNU GENERAL PUBLIC LICENSE Version 2, June 1991. The terms of this license are in a file called COPYING which you should have received with this software. If you have not received a copy of this file, you can obtain one via WWW at http://www.gnu.org/copyleft/gpl.html, or by writing to: The Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. A small number of files (the API header files and export files, listed in R_HOME/COPYRIGHTS) are distributed under the LESSER GNU GENERAL PUBLIC LICENSE version 2.1. This can be obtained via WWW at http://www.gnu.org/copyleft/lgpl.html, or by writing to the address above ``Share and Enjoy.'' + This mail has been sent through the MPI for Demographic Rese...{{dropped}} __ R-help@stat.math.ethz.ch 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- License
On Tue, 7 Feb 2006 [EMAIL PROTECTED] wrote: Hello. We are trying to install R on our network, and I wanted to ask if there is a user license agreement. I will be grateful if somebody can send me a link to it; if one exists. In addition to license() from an installed R, you can link through: http://www.r-project.org/about.html to: http://www.r-project.org/COPYING The same information is in the FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#What-is-R_003f Please also note: http://www.r-project.org/foundation/main.html Thank you very much *** Antonio Paredes USDA- Center for Veterinary Biologics Biometrics Unit 510 South 17th Street, Suite 104 Ames, IA 50010 (515) 232-5785 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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 Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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] Prediction method for lowess,loess,lokerns,lpepa,ksmooth
Hi Every Body, I don't know why some regression functions have no related prediction function. For example lowess, loess, lokerns, lpridge, lpepa, and ksmooth. What could help? Is there any global or wrapper function so that can help? Regards, Amir Safari - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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] Prediction method for lowess,loess,lokerns,lpepa,ksmooth
On Tue, 2006-02-07 at 06:24 -0800, Amir Safari wrote: Hi Every Body, I don't know why some regression functions have no related prediction function. For example lowess, loess, lokerns, lpridge, lpepa, and ksmooth. What could help? Is there any global or wrapper function so that can help? Regards, Amir Safari loess() /does/ have a predict method [7]: methods(predict) [1] predict.ar*predict.Arima* [3] predict.arima0*predict.glm [5] predict.HoltWinters* predict.lm [7] predict.loess* predict.mlm [9] predict.nls* predict.poly [11] predict.ppr* predict.prcomp* [13] predict.princomp* predict.smooth.spline* [15] predict.smooth.spline.fit* predict.StructTS* Non-visible functions are asterisked The other functions (except ksmooth) I can't find in base R 2.2.1- patched, so they are likely from contributed packages. As such, you should contact the package maintainers for help, to make a feature request, or offer your help in writing predict methods for these functions. ?ksmooth states: Note: This function is implemented purely for compatibility with S, although it is nowhere near as slow as the S function. Better kernel smoothers are available in other packages. So perhaps you could look in the contributed packages section of the CRAN website for something that meets your needs? HTH G -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Gavin Simpson [T] +44 (0)20 7679 5522 ENSIS Research Fellow [F] +44 (0)20 7679 7565 ENSIS Ltd. ECRC [E] gavin.simpsonATNOSPAMucl.ac.uk UCL Department of Geography [W] http://www.ucl.ac.uk/~ucfagls/cv/ 26 Bedford Way[W] http://www.ucl.ac.uk/~ucfagls/ London. WC1H 0AP. %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% __ R-help@stat.math.ethz.ch 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] Prediction method for lowess,loess,lokerns,lpepa,ksmooth
Amir Safari wrote: Hi Every Body, I don't know why some regression functions have no related prediction function. For example lowess, loess, lokerns, lpridge, lpepa, and ksmooth. What could help? Is there any global or wrapper function so that can help? Regards, Amir Safari - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html This is somewhat related to what you want. In the Hmisc package look at the areg.boot function. -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch 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] Antigen forwarded attachment
The entire message [R] install package in Mac, originally sent to you by [EMAIL PROTECTED] ([EMAIL PROTECTED]), has been forwarded to you from the Antigen Quarantine area. This message may have been re-scanned by Antigen and handled according to the appropriate scan job's settings. Entire Message.eml ---BeginMessage--- Hi, all I have problem about installing package (built in Windows) in Mac. In the R for MacOS X FAQ, it mentioned that Mac required the prebuilt package named as XXX.tgz. However, the package built under Windows named as XXX.zip. So how should I do to let the package (built in Windows) to install in Mac. Thanks in advance !! __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html ---End Message--- __ R-help@stat.math.ethz.ch 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] Antigen forwarded attachment
The entire message Re: [R] install package in Mac, originally sent to you by [EMAIL PROTECTED] ([EMAIL PROTECTED]), has been forwarded to you from the Antigen Quarantine area. This message may have been re-scanned by Antigen and handled according to the appropriate scan job's settings. Entire Message.eml ---BeginMessage--- Rhett Eckstein wrote: Hi, all I have problem about installing package (built in Windows) in Mac. In the R for MacOS X FAQ, it mentioned that Mac required the prebuilt package named as XXX.tgz. However, the package built under Windows named as XXX.zip. So how should I do to let the package (built in Windows) to install in Mac. On Windows, build a source package (hence ending .tar.gz) and install this source package on the Mac. You cannot use Windows binary packages on the Mac. Uwe Ligges Thanks in advance !! __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html ---End Message--- __ R-help@stat.math.ethz.ch 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] Prediction method for lowess,loess,lokerns,lpepa,ksmooth
On Tue, 7 Feb 2006, Gavin Simpson wrote: On Tue, 2006-02-07 at 06:24 -0800, Amir Safari wrote: Hi Every Body, I don't know why some regression functions have no related prediction function. For example lowess, loess, lokerns, lpridge, lpepa, and ksmooth. What could help? Is there any global or wrapper function so that can help? Regards, Amir Safari loess() /does/ have a predict method [7]: methods(predict) [1] predict.ar*predict.Arima* [3] predict.arima0*predict.glm [5] predict.HoltWinters* predict.lm [7] predict.loess* predict.mlm [9] predict.nls* predict.poly [11] predict.ppr* predict.prcomp* [13] predict.princomp* predict.smooth.spline* [15] predict.smooth.spline.fit* predict.StructTS* Non-visible functions are asterisked The other functions (except ksmooth) I can't find in base R 2.2.1- patched, so they are likely from contributed packages. As such, you should contact the package maintainers for help, to make a feature request, or offer your help in writing predict methods for these functions. ?ksmooth states: Note: This function is implemented purely for compatibility with S, although it is nowhere near as slow as the S function. Better kernel smoothers are available in other packages. So perhaps you could look in the contributed packages section of the CRAN website for something that meets your needs? However, the _only_ thing kernel smoothing does is prediction. As in range.x: the range of points to be covered in the output. n.points: the number of points at which to evaluate the fit. x.points: points at which to evaluate the smoothed fit. If missing, 'n.points' are chosen uniformly to cover 'range.x'. I would suggest rather using packages KernSmooth (ships with R) or sm. -- 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 __ R-help@stat.math.ethz.ch 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] displaying Cyrillic in RGui under Windows
I have a data frame with Cyrillic text that I would like to be able to view under RGui. Unfortunately I can't figure out from the manuals how to make this happen -- can someone point me in the right direction? Thanks, Roger Levy __ R-help@stat.math.ethz.ch 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] post-hoc comparisons following glmm
Dear R community, I performed a generalized linear mixed model using glmmPQL (MASS library) to analyse my data i.e : y is the response with a poisson distribution, t and Trait are the independent variables which are continuous and categorical (3 categories C, M and F) respectively, ind is the random variable. mydata-glmmPQL(y~t+Trait,random=~1|ind,family=poisson,data=tab) Do you think it is OK? Trait is significant (p 0.0001) and I would like to perform post-hoc comparisons to check where the difference among Trait categories but I did not find a solution in R help list or others. Thank you in advance for your help Michael __ R-help@stat.math.ethz.ch 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] prehistoric versions of R -- 1995!
Martin Maechler wrote: UweL == Uwe Ligges [EMAIL PROTECTED] on Tue, 07 Feb 2006 08:56:10 +0100 writes: UweL Petr Pikal wrote: Hi On 6 Feb 2006 at 15:57, ivo welch wrote: Date sent: Mon, 6 Feb 2006 15:57:30 -0500 From: ivo welch [EMAIL PROTECTED] To: Sean Davis [EMAIL PROTECTED] Copies to: [EMAIL PROTECTED], r-help r-help@stat.math.ethz.ch Subject:Re: [R] R loop data[ data$a == name2 ] # does not work and gives a weird result, yuck data[data$a==name2,] sorry about this. I believe a few versions back, one could not subset data frames, so I did not even check what I wrote. Works now. It depends on what you consider few versions back. I started with R vesion 1.2.0 about 10 years UweL I bet 200$ (or EUR) you have not used R 10 years ago. ;-) Is that an open bet or just for Petr? UweL People certainly remember the 1.0.0 release at the remarkable day UweL 29-FEB-2000. UweL 1.2.0 was released in December 2000, about 5 years ago. UweL I started with 0.62.x in 1998. UweL The oldest version I found on CRAN is a pre-alpha R.sea.hqx for the Mac UweL dated 07-Nov-1996. Eehm; that has a wrong date (or then it would not be pre-alpha): I've always entertained the prehistoric directory of R sources at ftp://stat.ethz.ch/Software/R/alpha/PreHistoric/ and its oldest file is Name SizeDate R-0.1alpha.tar.gz 861464 Feb 12 1996 I'm pretty sure I was using R 0.16 in the fall of 1996 on Linux, which was when I got dse largely converted from S. I had a slightly earlier version in the spring of 1996 on Solaris. (I think the numbering would have been 0.11 -0.15 in the spring of 1996.) I don't think the numbering was the same on other platforms. (which will be 10 years coming Sunday -- what a jubilee!!) So, even that is not pre-alpha; and yes, that was a bit before CRAN existed. Now to the pre-alpha history. I've digged some more and found 1) that the mac file mentioned above would have correct date 'Nov 6 1995' (at least that's the date I saved when I looked at the Auckland FTP server through Emacs ange-ftp). 2) The oldest stuff that I have is all from 1995; The source I (think I) had first used is dated June 20 1995; notably the R-unix-src.tar.gz with accompanying README and INSTALL files (There was also ./win subdirectory which I did not use, with files all from July 15, 1995; AFAIK done by Robert Gentleman) I've now put a bit of these oldest files into ftp://stat.ethz.ch/Software/R/alpha/PreHistoric/pre-alpha/ 3) I've kept an e-mail that Ross had sent me on July 28 with two small patches to the (June 20) sources. Yes, chances are pretty high that I was the first one outside of the Auckland(NZ)-community to actively use R. I wouldn't be really sure of that (but it's a fair bet). Note it might be interesting to find even older sources, but that would most probably have to be by Robert and Ross (or a sysadmin at Auckland). I used to have some floppy disks somewhere... Paul Gilbert Martin Maechler, ETH Zurich __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html La version française suit le texte anglais. This email message from the Bank of Canada is given in good faith, and shall not be binding or construed as constituting any obligation on the part of the Bank. This email may contain privileged and/or confidential inform...{{dropped}} __ R-help@stat.math.ethz.ch 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] displaying Cyrillic in RGui under Windows
On Tue, 7 Feb 2006, Roger Levy wrote: I have a data frame with Cyrillic text that I would like to be able to view under RGui. Unfortunately I can't figure out from the manuals how to make this happen -- can someone point me in the right direction? You can only do this if you run RGui in a Cyrillic locale. Unfortunately there are several incompatible Cyrillic encodings, so let's hope this is the Windows one. If so, set Windows to Russian as per the rw-FAQ, select LANGUAGE=en and it should work. -- 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 __ R-help@stat.math.ethz.ch 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] (second round) creating a certain type of matrix
Hi R users Here is what I got with help from Petr Pikal (Thanks Petr Pikal). I modified Petr Pikal's code to a little to meet my purpose. I created a function to generate a matrix generate.matrix-function(n.variable) { mat-matrix(0,n.variable,(n.variable/2)/5+1) #matrix of zeroes dd-dim(mat) # actual dimensions mat[1:(dd[1]/2),1]-1 #put 1 in first half of first column mat[((dd[1]/2)+1):dd[1],1]-rnorm(dd[1]/2,0,1) #put random numbers in following part of the matrix column 1 mat[((dd[1]/2)+1):((dd[1]/2)+5),2]-rnorm(5,0,1) #put random numbers in column2 for (i in 3:(dd[2])) { length.of.rand.numbers - 5 my.rand.num- rnorm(length.of.rand.numbers, 0,1) start - dd[1]/2+5*(i-2)+1 end - start + length.of.rand.numbers-1 mat[((start):end), i]- my.rand.num } mat } Do you (any R users) have any suggestion to this function to make this function work better or efficiently? Taka It works but I From: Petr Pikal [EMAIL PROTECTED] To: Taka Matzmoto [EMAIL PROTECTED],r-help@stat.math.ethz.ch Subject: Re: [R] creating a certain type of matrix Date: Tue, 07 Feb 2006 08:58:59 +0100 MIME-Version: 1.0 Received: from mail.precheza.cz ([80.188.29.243]) by bay0-mc8-f13.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Mon, 6 Feb 2006 23:59:02 -0800 Received: from localhost (localhost [127.0.0.1])by mail.precheza.cz (Mailer) with ESMTP id A636C34E584;Tue, 7 Feb 2006 08:59:00 +0100 (CET) Received: from mail.precheza.cz ([127.0.0.1])by localhost (mail.precheza.cz [127.0.0.1]) (amavisd-new, port 10024)with LMTP id 28608-02-30; Tue, 7 Feb 2006 08:58:59 +0100 (CET) Received: from n1en1.precheza.cz (smtp.precheza.cz [192.168.210.31])by mail.precheza.cz (Mailer) with ESMTP id 35E8634E582;Tue, 7 Feb 2006 08:58:59 +0100 (CET) Received: from pikal ([192.168.210.65]) by n1en1.precheza.cz (Lotus Domino Release 6.5.4FP2) with ESMTP id 2006020708585800-252 ; Tue, 7 Feb 2006 08:58:58 +0100 X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8= X-Confirm-Reading-To: Petr Pikal [EMAIL PROTECTED] X-pmrqc: 1 Return-Receipt-To: Petr Pikal [EMAIL PROTECTED] Priority: normal X-mailer: Pegasus Mail for Windows (4.21c) X-MIMETrack: Itemize by SMTP Server on SRVDomino/PRECHEZA(Release 6.5.4FP2 | September 26, 2005) at 07.02.2006 08:58:58,Serialize by Router on SRVDomino/PRECHEZA(Release 6.5.4FP2 | September 26, 2005) at 07.02.2006 08:58:58,Serialize complete at 07.02.2006 08:58:58 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at precheza.cz Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 07 Feb 2006 07:59:03.0289 (UTC) FILETIME=[5C87D690:01C62BBC] Hi as only you know perfectly which halves and other portions of your matrices contain zeroes and which contain random numbers you has to finalize the function yourself. Here are few ideas. n-20 mat-matrix(0,n,(n/2)/5+1) #matrix of zeroes dd-dim(mat) # actual dimensions mat[1:(dd[1]/2),1]-1 #put 1 in first half of first column mat[((dd[1]/2)+1):dd[1],1]-rnorm(dd[1]/2,0,1) #put random numbers in following part of the matrix column 1 mat[((dd[1]/2)+1):(dd[1]/2)+dd[1]/4,2]-rnorm(dd[1]/4,0,1) #put random numbers in column2 than according to n and dd values you can put any numbers anywhere in your matrix e.g. in for loop (not.tested :-) for (i in 3:dd[2]) { arrange everything into following desired columns e.g. length.of.rand.numbers - (i-2)*5 my.rand.num- rnorm(length.of.rand.numbers, 0,1) start - dd[1]/2+dd[1]/4 end - start + length.of.rand.numbers mat[start:end, i]- my.rand.num } HTH Petr On 7 Feb 2006 at 0:07, Taka Matzmoto wrote: From: Taka Matzmoto [EMAIL PROTECTED] To:r-help@stat.math.ethz.ch Date sent: Tue, 07 Feb 2006 00:07:11 -0600 Subject: [R] creating a certain type of matrix Hi R users I like to generate a certain type of matrix. If there are 10 variables, the matrix will have nrow=10, ncol=((10/2))/5+1. so the resulting matrix's dimension 10 by 2. If there are 50 variables the dimension of the resulting matrix will be 50 by 6. The arrangement of elements of this matrix is important to me and I can't figure out how to arrange elements. If I have 20 variables. The resulting matrix will be 20 by 3 The first half of first column of the matrix will be 1s. The all elements on the second half of the first column of the matrix will be random numbers coming from rnorm(1,0,1). The first half of the second column of the matrix will be zeros. The first five elements of the second half of the second column of the matrix will be random numbers coming from rnorm(1,0,1). After that, the remaining elements of the second half will be zeros. The first half of the third column of the matrix will be zeors. The first five elements of the second half of the third column will be zeros too and then 5 random numbers coming from rnorm(1,0,1). If there are 40 variables the resulting
[R] Start problem after package update
Hello all! R2.2.1, W2k. When I used update.packages() today, R wanted to update VR, cluster and nlme packages. I did so using the Danish mirror. Everything worked as usual during update, but after closing R and trying to restart I got an error message saying that the .Rdata could not be restored. Re-installing from my downloaded .exe file cured this, but what happened and what package could have caused the problem? /CG -- CG Pettersson, MSci, PhD Stud. Swedish University of Agricultural Sciences (SLU) Dep. of Crop Production Ekology. Box 7043. SE-750 07 Uppsala, Sweden [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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] symbol() function in 3d
On Tue, 2006-02-07 at 16:23 +, Laura Quinn wrote: Hello, I was wondering if there is anything within the 3d rgl library that is similar to the symbol() function? I am hoping to overlay a surface3d() plot with some circles of varying size/color. I tried using the points3d() function, but this only allows me to add circles all of the same size. Thanks, Laura Hi Laura, Are spheres OK rather than circles? If so, then will the following work?: x - rnorm(12) y - rnorm(12) z - rnorm(12) rgl.open() spheres3d(x,y,z, radius = 1:12 * 0.05, color = colors()[1:12]) the color argument is described in ?rgl.material where unfortunately the size argument can not be a vector our you could have used that with points3d() to achieve what you wanted. Example with surface from ?surface3d data(volcano) z - 2 * volcano# Exaggerate the relief x - 10 * (1:nrow(z)) # 10 meter spacing (S to N) y - 10 * (1:ncol(z)) # 10 meter spacing (E to W) zlim - range(y) zlen - zlim[2] - zlim[1] + 1 colorlut - terrain.colors(zlen) # height color lookup table col - colorlut[ z-zlim[1]+1 ] # assign colors to heights for each point rgl.clear() surface3d(x, y, z, color=col, back=lines) ## choose some co-ords samp - sample(seq(along = y), 20) ## draw the spheres spheres3d(x[samp], y[samp], z[samp] * 1.75, radius = 1:20 * 2, color = colors()[samp]) HTH G Laura Quinn Institute of Atmospheric Science School of Earth and Environment University of Leeds Leeds LS2 9JT tel: +44 113 343 1596 fax: +44 113 343 6716 mail: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Gavin Simpson [T] +44 (0)20 7679 5522 ENSIS Research Fellow [F] +44 (0)20 7679 7565 ENSIS Ltd. ECRC [E] gavin.simpsonATNOSPAMucl.ac.uk UCL Department of Geography [W] http://www.ucl.ac.uk/~ucfagls/cv/ 26 Bedford Way[W] http://www.ucl.ac.uk/~ucfagls/ London. WC1H 0AP. %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% __ R-help@stat.math.ethz.ch 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] elements from 'sem' function
Hi, I would like to print elements from sem (structural equation modeling) function (e.g., model-reproduced covariance matrix (C); estimated asymptotic covariance matrix of parameter estimates (cov)). How can I do this? Thanks, André -- André Tavares Corrêa Dias Laboratório de Ecologia Vegetal Universidade Federal do Rio de Janeiro CCS-IB-Departamento de Ecologia Caixa Postal 68020 21941-970 Rio de Janeiro RJ, Brazil tel: +55 21 25626377 Fax: + 55 21 25626320 [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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] question about binary data file and data.frame
I have a binary file with data sequence in the order [age,weight][age,weight] I know the length of the data and I want to load it into a data.frame. of course a way to do this is to read age and weight seperately and then use cbin(age,weight) to combine them into a dataframe, but is there a better solution? Thanks in advance! __ R-help@stat.math.ethz.ch 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] lme question
Hi list, I am fitting microarray data (intensity) model using the lme package in R environment. I have 5 fixed variables in the model. One of the fixed variables is genes. I am trying to get p-values for different genes. But I am getting only one p-value for all genes together. I can get a list of p-value when I run lm. Why can't this work in lme? I was wondering if some one can help me solve this problem. That is getting a list of p-value for each gene in the model using the lme. Thanks in advance for your help Regards Mahdi -- --- Mahdi Osman (PhD) E-mail: [EMAIL PROTECTED] --- DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert: GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl __ R-help@stat.math.ethz.ch 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-pkgs] new package QCA
Dear list members, I am pleased to let you know that R met with QCA - Qualitative Comparative Analysis. This package has a few functions that implement the Quine-McCluskey algorithm, adapted to social sciences by Charles Ragin (as describes in his book from 1987 The Comparative Method). Future versions of this package will have more functions to address the fuzzy-set minimization problems, as well. Big thanks to the r-help list members, supportive as ever, especially to Gabor Grothendieck and Martin Maechler for excellent ideas in the key parts of the algorithm. -- Adrian DUSA Romanian Social Data Archive 1, Schitu Magureanu Bd 050025 Bucharest sector 5 Romania Tel./Fax: +40 21 3126618 \ +40 21 3120210 / int.101 ___ R-packages mailing list [EMAIL PROTECTED] https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@stat.math.ethz.ch 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] Significance of degrees of freedom in nlme
Your question begins, Dear Dr. Bates, yet Bates does not appear as an addressee in the copy of your question that I recieved via r-help. I will offer a couple of suggestions in the hopes that they might help you. Since your question did not include enough detail for anyone to answer without additional information, I used 'RSiteSearch(gabriela escati peñaloza)' to find earlier posts that might be related. This generated 14 hits, the most relevant of which seemed to be http://finzi.psych.upenn.edu/R/Rhelp02a/archive/69466.html;. From this, I copy the following: formula(my data.gd) dLt ~ Lt | ID TasavB- function(Lt, Linf, K) (K*(Linf-Lt)) my model.nlme - nlme (dLt ~ TasavB(Lt, Linf, K), data = my data.gd, fixed = list(Linf ~ 1, K ~ 1), start = list(fixed = c(70, 0.4)), na.action= na.include, naPattern = ~!is.na(dLt)) I assume something got garbled here, because constructs like my data.gd generate a 'syntax error' for me; I therefore assume it is my_data.gd (with an underscore between my and data.gd.) Try the following: sapply(my_data.gd, class) What columns of my_data.gd are factors, and how do they relate to Linf and K? You can explore this using table. If you would like more help from this listserve, please submit another post. Before you do, however, PLEASE do read the posting guide! www.R-project.org/posting-guide.html, and try some of the things suggested there. In particular, if you haven't already, try RSiteSearch for nlme degrees of freedom and anything else that seems relevant to you. Also, before your next post, I encourage you to try to develop the simplest, self-contained example that illustrates your question. I believe you will more likely receive faster, more useful replies if you make it easier for people to help you. hope this helps, spencer graves gabriela escati peñaloza wrote: Dear Dr. Bates, Thank you very much for your response. I had consulted the algorithm described in Pinheiro and Bates. However, what I don't understand (among other things) is why my two parameters appear to be estimated at different grouping levels (based on the DF values). Affect this different values of DF at the estimates parameters? The estimates fixed effects were get at the same level of grouping? I apreciate any response. Lic. Gabriela Escati Peñaloza Biología y Manejo de Recursos Acuáticos Centro Nacional Patagónico(CENPAT). CONICET Bvd. Brown s/nº. (U9120ACV)Pto. Madryn Chubut Argentina Tel: 54-2965/451301/451024/451375/45401 (Int:277) Fax: 54-29657451543 ___ 1GB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] question about binary data file and data.frame
[EMAIL PROTECTED] wrote: I have a binary file with data sequence in the order What do you mean by 'binary file'? [age,weight][age,weight] How are age and weight encoded in this 'binary file'? I know the length of the data and I want to load it into a data.frame. of course a way to do this is to read age and weight seperately and then use cbin(age,weight) to combine them into a dataframe, but is there a better solution? Is it really an ASCII file? With age and weight separated by commas, and then age-weight pairs separated by spaces? Are there really square bracket pairs in there too? Or is it really a binary file, a series of 4 or 8-byte binary representations of age and weight? Barry __ R-help@stat.math.ethz.ch 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] displaying Cyrillic in RGui under Windows
Prof Brian Ripley wrote: On Tue, 7 Feb 2006, Roger Levy wrote: I have a data frame with Cyrillic text that I would like to be able to view under RGui. Unfortunately I can't figure out from the manuals how to make this happen -- can someone point me in the right direction? You can only do this if you run RGui in a Cyrillic locale. Unfortunately there are several incompatible Cyrillic encodings, so let's hope this is the Windows one. If so, set Windows to Russian as per the rw-FAQ, select LANGUAGE=en and it should work. Thanks, I understand better now. Apparently the only usable encoding is Windows-1251, which R switches to upon the command Sys.setlocale(,russian). After converting my data files to that encoding and switching the Windows locale, everything works great. Many thanks. Roger __ R-help@stat.math.ethz.ch 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] writing R shell scripts?
Use the all powerful here document feature of bash: R --vanilla EOF # Pipe all subsequent lines into R. ### Here's my R code require(tcltk) tkmessageBox(message=It works) ## the end EOF Mike Miller wrote: I'm new to the list. I've used R and S-PLUS a bit for about 15 years but am now working to make R my main program for all numerical and statistical computing. I also use Octave for this kind of work and I recommend it (it is also under the GPL). Here's my question: In Octave I can write shell scripts in the Linux/UNIX environment that begin with a line like this... #!/usr/local/bin/octave -q ...and the remaining lines are octave commands. Is it possible to do this sort of thing in R using something like this?: #!/usr/lib/R/bin/R.bin Well, that isn't quite it because I tried it and it didn't work! Any advice greatly appreciated. Thanks in advance. Mike __ R-help@stat.math.ethz.ch 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] March course @ 8 locations *** R/Splus Fundamentals and Programming Techniques
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce 2-day R/S-plus Fundamentals and Programming Techniques in San Francisco: www.xlsolutions-corp.com/Rfund.htm Philadelphia, March 9-10 Seattle, March 13-14 San Diego, March 16-17 Portland, OR March 16-17 Washington DC, March 16-17 New YorkMarch 20-21 San Francisco March 30-31 AtlantaMarch 30-31 Reserve your seat now at the early bird rates! Payment due AFTER the class Course Description: This two-day beginner to intermediate R/S-plus course focuses on a broad spectrum of topics, from reading raw data to a comparison of R and S. We will learn the essentials of data manipulation, graphical visualization and R/S-plus programming. We will explore statistical data analysis tools,including graphics with data sets. How to enhance your plots, build your own packages (librairies) and connect via ODBC,etc. We will perform some statistical modeling and fit linear regression models. Participants are encouraged to bring data for interactive sessions With the following outline: - An Overview of R and S - Data Manipulation and Graphics - Using Lattice Graphics - A Comparison of R and S-Plus - How can R Complement SAS? - Writing Functions - Avoiding Loops - Vectorization - Statistical Modeling - Project Management - Techniques for Effective use of R and S - Enhancing Plots - Using High-level Plotting Functions - Building and Distributing Packages (libraries) - Connecting; ODBC, Rweb, Orca via sockets and via Rjava Email us for group discounts. Email Sue Turner: [EMAIL PROTECTED] Phone: 206-686-1578 Visit us: www.xlsolutions-corp.com/training.htm Please let us know if you and your colleagues are interested in this classto take advantage of group discount. Register now to secure your seat! Interested in R/Splus Advanced course? email us. Cheers, Elvis Miller, PhD Manager Training. XLSolutions Corporation 206 686 1578 www.xlsolutions-corp.com [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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] Shapley Values
Hi, I am trying to compute the Shapley Values between a set of p independent variables (x1, ..., xp) and the dependent variable y to study the relationships. I believe that the package kappalab could be an appropriate choice. Is anybody able to give me some hints about the code I should write? Any better package? thanks in advance! Roberto Furlan University of Turin La mia Cartella di Posta in Arrivo è protetta da SPAMfighter 202 messaggi contenenti spam sono stati bloccati con successo. Scarica gratuitamente SPAMfighter! __ R-help@stat.math.ethz.ch 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] hi frinds
Hello, i hope that every body are OK there. I would like to calculate the inverse of the cdf of mixture of normal distribution (with 2 components, p,(1-p)) from uniform points (0,1] using R. In this case i have to specify the 2 means and 2 variances and the mixing proportions (p, (1-p)). I am seeking help from any one who knows how to use R functions to do this. Also, i want to know how to read the results to text.file. many thanks to any help my E-mail is [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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] elements from 'sem' function
Dear André, The components of the sem object returned by sem() are explained on the help page ?sem. There are several methods for sem objects: methods(class=sem) [1] mod.indices.sem*normalized.residuals.sem* [3] path.diagram.sem* print.sem* [5] residuals.sem* standardized.residuals.sem* [7] summary.sem* To retrieve components of the object directly, just use, e.g., object$C (for the reproduced covariance matrix), or object$coeff (for estimates of free parameters), in the normal manner for indexing a list. It would probably be better for me to provide accessor functions [e.g., for the coef() generic] for at least some of these, so I'll put that on the list of things to do. I hope this helps, 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 andre tavares correa dias Sent: Tuesday, February 07, 2006 12:28 PM To: r-help@stat.math.ethz.ch Subject: [R] elements from 'sem' function Hi, I would like to print elements from sem (structural equation modeling) function (e.g., model-reproduced covariance matrix (C); estimated asymptotic covariance matrix of parameter estimates (cov)). How can I do this? Thanks, André -- André Tavares Corrêa Dias Laboratório de Ecologia Vegetal Universidade Federal do Rio de Janeiro CCS-IB-Departamento de Ecologia Caixa Postal 68020 21941-970 Rio de Janeiro RJ, Brazil tel: +55 21 25626377 Fax: + 55 21 25626320 [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] Reading in FORTRAN data using R
Hi There: I was wondering if there is a way to read FORTRAN list data (similar to IDL's readf function). I often use FORTRAN for most of my number crunching, and use something like IDL to visualize and perform statistical analysis on that data. Since the each file is rather large (100 Mb), formatting the output into columns or tables is impractical, hence the list style. Please note, this is NOT binary data, but text output with no FORMAT. For example: My FORTRAN code writes out: open(unit=30,name=fnout,status='old') write(30,'(a20)') fnmod write(30,'(a20)') fnstr write(30,*) nfault,hpl,vplx,vply,taua,tauf,amuu, tminn,tstepp,itime,TBIS,bulkms,ntm,ncycle,pdcy write(30,*) ptrad write(30,'(a1)') respfb write(30,*) (timi(n), n=1,nfault) write(30,*) (taub(n), n=1,nfault) write(30,*) (delts(n), n=1,nf) write(30,*) (cfr(n), n=1,nfault) write(30,*) (dfr(n), n=1,nfault) write(30,*) (slpdf(n), n=1,nf2) write(30,*) (slpv(n), n=1,nfault) write(30,*) (rhofcc(n), n=1,nfault) write(30,*) (islip(n), n=1,nfault) (NOTE: not all variables are the same length!) I subsequently read in back the data as: open(unit=30,name=fnin,status='old') read(30,'(a20)') fnmod read(30,'(a20)') fnstr read(30,*) nfault,hpl,vplx,vply,taua,tauf,amuu, tminn,tstepp,ntime,TBIS,bulkms,ntm,ncycle,pdcy read(30,*) ptrad read(30,'(a1)') respfb read(30,*) (timi(n), n=1,nfault) read(30,*) (taub(n), n=1,nfault) read(30,*) (delts(n), n=1,nf) read(30,*) (cfr(n), n=1,nfault) read(30,*) (dfr(n), n=1,nfault) read(30,*) (slpdf(n), n=1,nf2) read(30,*) (slpv(n), n=1,nfault) read(30,*) (rhofcc(n), n=1,nfault) read(30,*) (islip(n), n=1,nfault) read.fwf is not what I need from what I read and neither is read.fortran. How would I go about reading in the above unformatted Fortran file within R? Sorry if the question is somewhat trivial, but I am a complete nube to R (installed it 2 weeks ago) and am just getting caught up to speed. Thanks for any advice you may have. Cheers, t. -- Tyler Joseph Hayes PhD Candidate, Geophysics The University of Western Ontario Department of Earth Sciences B GS Building - RM 154 London, Ontario N6A 5B7 CANADA email: [EMAIL PROTECTED] TEL : 519.661.3187 (main office) FAX : 519.661.3198 CELL : 416.655.7897 __ R-help@stat.math.ethz.ch 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] matching tables
Dear Listers, I am trying to match tables that DO NOT have the same length. The tables result from the function table() so they look like this: table 1 2 3 4 3 5 7 table 2 1 2 3 6 4 5 I need the following output: (NOTICE THE ZEROS) 1 2 3 4 table1 0 3 5 7 table2 6 4 5 0 Unfortunately, I was not successful using match(). Previous postings explain how to do similar matching, but for tables for same length, specifically. Any thoughts ? Thanks ! eric Eric Pante College of Charleston, Grice Marine Laboratory 205 Fort Johnson Road, Charleston SC 29412 Phone: 843-953-9190 (lab) -9200 (main office) On ne force pas la curiosite, on l'eveille ... Daniel Pennac __ R-help@stat.math.ethz.ch 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] matching tables
t1 - as.data.frame(table(1:10)) ; colnames(t1)[2] - A t2 - as.data.frame(table(5:20)) ; colnames(t2)[2] - B t3 - merge(t1,t2,all=TRUE) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Pante Sent: Tuesday, February 07, 2006 4:22 PM To: r-help@stat.math.ethz.ch Subject: [R] matching tables Dear Listers, I am trying to match tables that DO NOT have the same length. The tables result from the function table() so they look like this: table 1 2 3 4 3 5 7 table 2 1 2 3 6 4 5 I need the following output: (NOTICE THE ZEROS) 1 2 3 4 table1 0 3 5 7 table2 6 4 5 0 Unfortunately, I was not successful using match(). Previous postings explain how to do similar matching, but for tables for same length, specifically. Any thoughts ? Thanks ! eric Eric Pante College of Charleston, Grice Marine Laboratory 205 Fort Johnson Road, Charleston SC 29412 Phone: 843-953-9190 (lab) -9200 (main office) On ne force pas la curiosite, on l'eveille ... Daniel Pennac __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] prehistoric versions of R -- 1995!
Paul Gilbert wrote: Martin Maechler wrote: UweL == Uwe Ligges [EMAIL PROTECTED] on Tue, 07 Feb 2006 08:56:10 +0100 writes: UweL Petr Pikal wrote: Hi On 6 Feb 2006 at 15:57, ivo welch wrote: Date sent: Mon, 6 Feb 2006 15:57:30 -0500 From: ivo welch [EMAIL PROTECTED] To: Sean Davis [EMAIL PROTECTED] Copies to: [EMAIL PROTECTED], r-help r-help@stat.math.ethz.ch Subject:Re: [R] R loop data[ data$a == name2 ] # does not work and gives a weird result, yuck data[data$a==name2,] sorry about this. I believe a few versions back, one could not subset data frames, so I did not even check what I wrote. Works now. It depends on what you consider few versions back. I started with R vesion 1.2.0 about 10 years UweL I bet 200$ (or EUR) you have not used R 10 years ago. ;-) Is that an open bet or just for Petr? Was intended just for Petr, I know Martin came in very early and would not have made a bet for him. I try not to waste money. ;-) Uwe UweL People certainly remember the 1.0.0 release at the remarkable day UweL 29-FEB-2000. UweL 1.2.0 was released in December 2000, about 5 years ago. UweL I started with 0.62.x in 1998. UweL The oldest version I found on CRAN is a pre-alpha R.sea.hqx for the Mac UweL dated 07-Nov-1996. Eehm; that has a wrong date (or then it would not be pre-alpha): I've always entertained the prehistoric directory of R sources at ftp://stat.ethz.ch/Software/R/alpha/PreHistoric/ and its oldest file is Name SizeDate R-0.1alpha.tar.gz 861464 Feb 12 1996 I'm pretty sure I was using R 0.16 in the fall of 1996 on Linux, which was when I got dse largely converted from S. I had a slightly earlier version in the spring of 1996 on Solaris. (I think the numbering would have been 0.11 -0.15 in the spring of 1996.) I don't think the numbering was the same on other platforms. (which will be 10 years coming Sunday -- what a jubilee!!) So, even that is not pre-alpha; and yes, that was a bit before CRAN existed. Now to the pre-alpha history. I've digged some more and found 1) that the mac file mentioned above would have correct date 'Nov 6 1995' (at least that's the date I saved when I looked at the Auckland FTP server through Emacs ange-ftp). 2) The oldest stuff that I have is all from 1995; The source I (think I) had first used is dated June 20 1995; notably the R-unix-src.tar.gz with accompanying README and INSTALL files (There was also ./win subdirectory which I did not use, with files all from July 15, 1995; AFAIK done by Robert Gentleman) I've now put a bit of these oldest files into ftp://stat.ethz.ch/Software/R/alpha/PreHistoric/pre-alpha/ 3) I've kept an e-mail that Ross had sent me on July 28 with two small patches to the (June 20) sources. Yes, chances are pretty high that I was the first one outside of the Auckland(NZ)-community to actively use R. I wouldn't be really sure of that (but it's a fair bet). Note it might be interesting to find even older sources, but that would most probably have to be by Robert and Ross (or a sysadmin at Auckland). I used to have some floppy disks somewhere... Paul Gilbert Martin Maechler, ETH Zurich __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html La version française suit le texte anglais. This email message from the Bank of Canada is given in good faith, and shall not be binding or construed as constituting any obligation on the part of the Bank. This email may contain privileged and/or confidential inform...{{dropped}} __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] question about binary data file and data.frame
Each data (edge,weight) is numerical data with type double (4 bytes) df-file(d:/sim.data,rb) age[1]-readBin(df,double()) weigt[1]-readBin(df,double()) ... age[10]-readBin(df,double()) weigt[10]-readBin(df,double()) it is not asc file. === 2006-02-07 13:03:17 === [EMAIL PROTECTED] wrote: I have a binary file with data sequence in the order What do you mean by 'binary file'? [age,weight][age,weight] How are age and weight encoded in this 'binary file'? I know the length of the data and I want to load it into a data.frame. of course a way to do this is to read age and weight seperately and then use cbin(age,weight) to combine them into a dataframe, but is there a better solution? Is it really an ASCII file? With age and weight separated by commas, and then age-weight pairs separated by spaces? Are there really square bracket pairs in there too? Or is it really a binary file, a series of 4 or 8-byte binary representations of age and weight? Barry = = = = = = = = = = = = = = = = = = = = www.brook [EMAIL PROTECTED] 2006-02-07 __ R-help@stat.math.ethz.ch 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] Calculating Kuiper/Watson test p-value
Hi, I am trying to use the Kuiper and Watson U^2 tests available in the CircStats or circular packages to test for uniformity on a circle. However, the implementation of these tests gives ranges of p-values that are not dependent on n, the size of sample. Are there any methods (including/excluding implementation) for calculating the p-values (with respect to n) of these tests with arbitrary precision? The closest thing that I found was an asymptotic approximation for the Kuiper p-value implemented in MatLab. Many thanks and all the best, Firas. __ R-help@stat.math.ethz.ch 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] Reading in FORTRAN data using R
Tyler, One relatively easy way to get structured model data into R is to use output routines I have written with my colleagues. They are called For2R and are available at http://shrimp.ccfhrb.noaa.gov/~mprager/Rinter.html To go that route, you would replace (or supplement) your Fortran write statements with a series of calls to our output routines. When you read the data from the resulting file, you won't need to specify variable names, lengths, or anything else, as they will all be stored in the output file. A single R statement will read everything into an R list object. The alternative would be using the the R scan() function to read your variables into R. In that case, you would need to specify the length of each and give it a name, similar to how you read your data into another Fortran program. By the way, watch out for the term unformatted in a Fortran context. Unformatted in Fortran is a specific term that means something close to what binary data I/O means to a C programmer. Your I/O is list-directed, but perhaps you know that already. Regards, ...Mike Prager on 2/7/2006 3:30 PM Tyler Hayes said the following: Hi There: I was wondering if there is a way to read FORTRAN list data (similar to IDL's readf function). I often use FORTRAN for most of my number crunching, and use something like IDL to visualize and perform statistical analysis on that data. Since the each file is rather large (100 Mb), formatting the output into columns or tables is impractical, hence the list style. Please note, this is NOT binary data, but text output with no FORMAT. For example: My FORTRAN code writes out: open(unit=30,name=fnout,status='old') write(30,'(a20)') fnmod write(30,'(a20)') fnstr write(30,*) nfault,hpl,vplx,vply,taua,tauf,amuu, tminn,tstepp,itime,TBIS,bulkms,ntm,ncycle,pdcy write(30,*) ptrad write(30,'(a1)') respfb write(30,*) (timi(n), n=1,nfault) write(30,*) (taub(n), n=1,nfault) write(30,*) (delts(n), n=1,nf) write(30,*) (cfr(n), n=1,nfault) write(30,*) (dfr(n), n=1,nfault) write(30,*) (slpdf(n), n=1,nf2) write(30,*) (slpv(n), n=1,nfault) write(30,*) (rhofcc(n), n=1,nfault) write(30,*) (islip(n), n=1,nfault) (NOTE: not all variables are the same length!) I subsequently read in back the data as: open(unit=30,name=fnin,status='old') read(30,'(a20)') fnmod read(30,'(a20)') fnstr read(30,*) nfault,hpl,vplx,vply,taua,tauf,amuu, tminn,tstepp,ntime,TBIS,bulkms,ntm,ncycle,pdcy read(30,*) ptrad read(30,'(a1)') respfb read(30,*) (timi(n), n=1,nfault) read(30,*) (taub(n), n=1,nfault) read(30,*) (delts(n), n=1,nf) read(30,*) (cfr(n), n=1,nfault) read(30,*) (dfr(n), n=1,nfault) read(30,*) (slpdf(n), n=1,nf2) read(30,*) (slpv(n), n=1,nfault) read(30,*) (rhofcc(n), n=1,nfault) read(30,*) (islip(n), n=1,nfault) read.fwf is not what I need from what I read and neither is read.fortran. How would I go about reading in the above unformatted Fortran file within R? Sorry if the question is somewhat trivial, but I am a complete nube to R (installed it 2 weeks ago) and am just getting caught up to speed. Thanks for any advice you may have. Cheers, t. -- Michael Prager, Ph.D. Population Dynamics Team, NMFS SE Fisheries Science Center NOAA Center for Coastal Fisheries and Habitat Research Beaufort, North Carolina 28516 http://shrimp.ccfhrb.noaa.gov/~mprager/ Opinions expressed are personal, not official. No government endorsement of any product is made or implied. __ R-help@stat.math.ethz.ch 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] Subsetting matrices
Dear R-Helpers, I am working on a dataset containing ca. 500 specimens of 17 different species. The data is three text columns, followed by ca 70 columns of binary data. I'm trying to write a function that will allow me to interactively exclude species using the inofrmation in the third text column. My function, matrix.slicer, appears to work as I intend. However, when I pass the resulting matrix to my homemade principal coordinates function, pcoa, the results include all of the data, with nothing excluded. I've read the help for factors, levels, subset, [, and some threads here relating to subsetting and drop=true issues, but I'm afraid I just don't understand what I need to do. I've pasted the functions below - any help would be appreciated. Thanks! Tyler Smith matrix.slicer - function(mat, label.vector){ selector - 999 print(Select species to remove from the matrix, 0 to finish) while (selector != 0){ selector - menu( levels( factor(mat[,label.vector]))) if (selector==0)break print (c(Removed: , levels(factor(mat[,label.vector]))[selector])) mat - subset (mat, mat[,label.vector]!=levels (factor (mat [,label.vector]))[selector]) } return (mat) } gel.data - matrix.slicer (gel.data,3) disttemp - as.matrix(vegdist(gel.data[,-(1:3)], method=jaccard)) dist - sqrt(disttemp) PCOA - pcoa (dist) -- Tyler Smith __ R-help@stat.math.ethz.ch 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] image() and text
Hi Andrej Kastrin wrote: Dear useRs, I have 4×4 symmetrical matrix ; then I use image(log(my.matrix)) to visualise it. Is there any 'simple' way to add text labels into each cell lie on diagonal of the image plot? Thanks for any pointers... Do you mean something like ...? m - matrix(rnorm(100), ncol=10) image(m) text(0:9/9, 0:9/9, 0:9) Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] http://www.stat.auckland.ac.nz/~paul/ __ R-help@stat.math.ethz.ch 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] getting strata/cluster level values with survey package?
First, I appoligise for the rooky question, but... I'm trying to obtain standard errors, confidence intervals, etc. from a sample design and have been trouble getting the results for anything other than the basic total or mean for the overall survey from the survey package. For example, using the following dataset, strata,cluster,vol A,1,18.58556192 A,1,12.55175443 A,1,21.65882438 A,1,17.11172946 A,1,15.41713348 A,2,13.9344623 A,2,17.13104821 A,2,14.6806479 A,2,14.68357291 A,2,18.86017714 A,2,20.67642515 A,2,15.15295351 A,2,13.82121102 A,2,12.9110477 A,2,14.83153677 A,2,21.90772687 A,3,18.69795427 A,3,18.45636428 A,3,15.77175793 A,3,15.54715217 A,3,20.31948393 A,3,19.26391445 A,3,15.54750775 A,3,19.18724018 A,4,12.89572151 A,4,12.92047701 A,4,12.64958757 A,4,19.85888418 A,4,19.64057669 A,4,19.19188964 A,4,18.81619298 A,4,21.73670878 A,5,15.99430802 A,5,18.6517 A,5,21.80441654 A,5,14.22081904 A,5,16.01576433 A,5,14.92497202 A,5,17.95123218 A,5,19.82027165 A,5,19.35698273 A,5,19.10826519 B,6,13.40892677 B,6,14.3956207 B,6,13.82113391 B,6,16.37338569 B,6,19.70159575 B,7,14.74334178 B,7,16.55125245 B,7,12.38329798 B,7,18.16472408 B,7,16.32938475 B,7,16.06465494 B,7,12.63086062 B,7,14.46114813 B,7,21.90134013 B,7,13.81025827 B,7,15.85805494 B,7,20.18195326 B,8,19.05120792 B,8,12.83856639 B,8,12.61360139 B,8,21.30434314 B,8,14.19960469 B,8,17.38397826 B,8,15.66477339 B,8,22.07182834 B,8,12.07487394 B,8,20.36357359 B,8,20.2543677 B,9,14.44499362 B,9,17.77235228 B,9,13.01620902 B,9,18.10976359 B,10,18.22350661 B,10,18.41504728 B,10,17.94735486 B,10,18.39173938 B,10,14.21729704 B,10,16.95753684 B,10,21.11643087 B,10,16.09688752 B,10,19.54707452 B,10,22.00450065 B,10,15.15308873 B,10,14.72488972 B,10,17.65280737 B,10,14.61615255 B,10,12.89525607 B,11,22.35831089 B,11,18.0853187 B,11,22.12815791 B,11,17.74562214 B,11,21.45724242 B,11,20.57933779 B,11,19.97397415 B,11,16.34967424 B,12,22.14385376 B,12,17.82816113 B,12,18.37056381 B,12,16.13152759 B,12,22.06764318 B,12,12.80924472 B,12,18.95522175 B,13,20.40554286 B,13,19.72951878 C,14,15.51581 C,14,15.4836358 C,14,13.35882363 C,14,13.16072916 C,14,21.69168971 C,14,19.09686303 C,14,14.47450457 C,14,12.04870424 C,14,13.33096141 C,14,17.38388981 C,14,16.29015289 C,14,16.32707754 C,14,16.2784054 C,15,15.0170597 C,15,14.95767365 C,15,15.20739614 C,15,22.10458509 C,15,12.3362457 C,15,19.87895753 C,15,18.8363682 C,15,16.43738666 C,15,12.84570744 C,15,15.99869357 C,15,14.42551321 C,15,13.63489872 C,15,15.67179885 C,16,14.61700901 C,16,14.64864676 C,16,14.13014582 C,16,21.7637441 C,16,20.66825543 C,16,17.05977818 C,16,17.80118916 C,16,15.16641698 where this is read into stand.data. When I use the following survey designs, srv1 - svydesign(ids=~1, strata=~strata, data=stand.data ) or, srv1 - svydesign(ids=~cluster, strata=~strata, data=stand.data ) with, print( svytotal( ~vol, srv1 ) ) I only obtain the total, print( svytotal( ~vol, srv1 ) ) total SE vol 2377 34.464 or worse, print( svytotal( ~vol + strata, srv1 ) ) total SE vol 2377.0 34.464 strataA 42.0 0.000 strataB 64.0 0.000 strataC 34.0 0.000 which reports the number of observations in each of the strata. I'm sure this is a RTFM question, but I just need a start. The size of each plot is 0.04 units (hectares) and I want to be able to quickly examine working up each sample with and without clusters (this is going to be part of a larger simulation study). I'm trying to not use SAS for this and hate to admit defeat. Thanks, Jeff. __ R-help@stat.math.ethz.ch 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] getting strata/cluster level values with survey package?
First, I appoligise for the rookie question, but... I'm trying to obtain standard errors, confidence intervals, etc. from a sample design and have been trouble getting the results for anything other than the basic total or mean for the overall survey from the survey package. For example, using the following dataset, strata,cluster,vol A,1,18.58556192 A,1,12.55175443 A,1,21.65882438 A,1,17.11172946 A,1,15.41713348 A,2,13.9344623 A,2,17.13104821 A,2,14.6806479 A,2,14.68357291 A,2,18.86017714 A,2,20.67642515 A,2,15.15295351 A,2,13.82121102 A,2,12.9110477 A,2,14.83153677 A,2,21.90772687 A,3,18.69795427 A,3,18.45636428 A,3,15.77175793 A,3,15.54715217 A,3,20.31948393 A,3,19.26391445 A,3,15.54750775 A,3,19.18724018 A,4,12.89572151 A,4,12.92047701 A,4,12.64958757 A,4,19.85888418 A,4,19.64057669 A,4,19.19188964 A,4,18.81619298 A,4,21.73670878 A,5,15.99430802 A,5,18.6517 A,5,21.80441654 A,5,14.22081904 A,5,16.01576433 A,5,14.92497202 A,5,17.95123218 A,5,19.82027165 A,5,19.35698273 A,5,19.10826519 B,6,13.40892677 B,6,14.3956207 B,6,13.82113391 B,6,16.37338569 B,6,19.70159575 B,7,14.74334178 B,7,16.55125245 B,7,12.38329798 B,7,18.16472408 B,7,16.32938475 B,7,16.06465494 B,7,12.63086062 B,7,14.46114813 B,7,21.90134013 B,7,13.81025827 B,7,15.85805494 B,7,20.18195326 B,8,19.05120792 B,8,12.83856639 B,8,12.61360139 B,8,21.30434314 B,8,14.19960469 B,8,17.38397826 B,8,15.66477339 B,8,22.07182834 B,8,12.07487394 B,8,20.36357359 B,8,20.2543677 B,9,14.44499362 B,9,17.77235228 B,9,13.01620902 B,9,18.10976359 B,10,18.22350661 B,10,18.41504728 B,10,17.94735486 B,10,18.39173938 B,10,14.21729704 B,10,16.95753684 B,10,21.11643087 B,10,16.09688752 B,10,19.54707452 B,10,22.00450065 B,10,15.15308873 B,10,14.72488972 B,10,17.65280737 B,10,14.61615255 B,10,12.89525607 B,11,22.35831089 B,11,18.0853187 B,11,22.12815791 B,11,17.74562214 B,11,21.45724242 B,11,20.57933779 B,11,19.97397415 B,11,16.34967424 B,12,22.14385376 B,12,17.82816113 B,12,18.37056381 B,12,16.13152759 B,12,22.06764318 B,12,12.80924472 B,12,18.95522175 B,13,20.40554286 B,13,19.72951878 C,14,15.51581 C,14,15.4836358 C,14,13.35882363 C,14,13.16072916 C,14,21.69168971 C,14,19.09686303 C,14,14.47450457 C,14,12.04870424 C,14,13.33096141 C,14,17.38388981 C,14,16.29015289 C,14,16.32707754 C,14,16.2784054 C,15,15.0170597 C,15,14.95767365 C,15,15.20739614 C,15,22.10458509 C,15,12.3362457 C,15,19.87895753 C,15,18.8363682 C,15,16.43738666 C,15,12.84570744 C,15,15.99869357 C,15,14.42551321 C,15,13.63489872 C,15,15.67179885 C,16,14.61700901 C,16,14.64864676 C,16,14.13014582 C,16,21.7637441 C,16,20.66825543 C,16,17.05977818 C,16,17.80118916 C,16,15.16641698 where this is read into stand.data. When I use the following survey designs, srv1 - svydesign(ids=~1, strata=~strata, data=stand.data ) or, srv1 - svydesign(ids=~cluster, strata=~strata, data=stand.data ) with, print( svytotal( ~vol, srv1 ) ) I only obtain the total, print( svytotal( ~vol, srv1 ) ) total SE vol 2377 34.464 or worse, print( svytotal( ~vol + strata, srv1 ) ) total SE vol 2377.0 34.464 strataA 42.0 0.000 strataB 64.0 0.000 strataC 34.0 0.000 which reports the number of observations in each of the strata. I'm sure this is a RTFM question, but I just need a start. The size of each plot is 0.04 units (hectares) and I want to be able to quickly examine working up each sample with and without clusters (this is going to be part of a larger simulation study). I'm trying to not use SAS for this and hate to admit defeat. Thanks, Jeff. __ R-help@stat.math.ethz.ch 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] explanation of data sets variables
Dear all, where I can find explanation of data sets variables, for example what does (u,x) variables means in city data? Thank you in advance, Kuba Jennifer Anistron, Mark Rufallo, Shirley Maclaine, Kevin Costner, Kathy Bates w komedii romantycznej Z UST DO UST. W kinach od 10 lutego! http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fzustdoust.htmlsid=651 __ R-help@stat.math.ethz.ch 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] empty wireframe
Perhaps I am missing something incredibly basic, but I can't get the wireframe function to plot anything other than an empty graph with axes (and the correct scale). Cloud() works just fine, as does scatterplot3d(), and wireframe() works fine for other data sets I have. Are there some data sets that can't be plotted with wireframe()? If so, what are the characteristics that prevent wireframe() from plotting? Thanks in advance, Jeff -- _ Jeffrey Ross-Ibarraemail: [EMAIL PROTECTED] Dept. Genetics phone: 706-542-0290 Fred C. Davison Life Sciences Complex University of Georgia Athens, Ga. 30602 _ Please tell me what is wrong with Darwinism. I can't see anything wrong with Darwinism. Ernst Mayr __ R-help@stat.math.ethz.ch 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] explanation of data sets variables
library(boot) ?city Francisco From: Kuba [EMAIL PROTECTED] To: R-help@stat.math.ethz.ch Subject: [R] explanation of data sets variables Date: Wed, 08 Feb 2006 00:35:51 +0100 Dear all, where I can find explanation of data sets variables, for example what does (u,x) variables means in city data? Thank you in advance, Kuba Jennifer Anistron, Mark Rufallo, Shirley Maclaine, Kevin Costner, Kathy Bates w komedii romantycznej Z UST DO UST. W kinach od 10 lutego! http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fzustdoust.htmlsid=651 __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] empty wireframe
On 2/7/06, Jeffrey Ross-Ibarra [EMAIL PROTECTED] wrote: Perhaps I am missing something incredibly basic, but I can't get the wireframe function to plot anything other than an empty graph with axes (and the correct scale). Cloud() works just fine, as does scatterplot3d(), and wireframe() works fine for other data sets I have. Are there some data sets that can't be plotted with wireframe()? Evidently, there are. If so, what are the characteristics that prevent wireframe() from plotting? Since you have access to one such data set and we don't, perhaps you can tell us. PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Deepayan __ R-help@stat.math.ethz.ch 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] question about binary data file and data.frame
Read it into a vector and then convert into a matrix; convert to a data frame: df - readBin(d:/sim.data, what='double', n=1, size=4) # make n greater than file size dim(df) - c(2, length(df) / 2) df - t(df) colnames(df) - c('age', 'weight') df - as.data.frame(df) On 2/7/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Each data (edge,weight) is numerical data with type double (4 bytes) df-file(d:/sim.data,rb) age[1]-readBin(df,double()) weigt[1]-readBin(df,double()) ... age[10]-readBin(df,double()) weigt[10]-readBin(df,double()) it is not asc file. === 2006-02-07 13:03:17 === [EMAIL PROTECTED] wrote: I have a binary file with data sequence in the order What do you mean by 'binary file'? [age,weight][age,weight] How are age and weight encoded in this 'binary file'? I know the length of the data and I want to load it into a data.frame. of course a way to do this is to read age and weight seperately and then use cbin(age,weight) to combine them into a dataframe, but is there a better solution? Is it really an ASCII file? With age and weight separated by commas, and then age-weight pairs separated by spaces? Are there really square bracket pairs in there too? Or is it really a binary file, a series of 4 or 8-byte binary representations of age and weight? Barry = = = = = = = = = = = = = = = = = = = = www.brook [EMAIL PROTECTED] 2006-02-07 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Jim Holtman Cincinnati, OH +1 513 247 0281 What the problem you are trying to solve? [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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 use mle?
I see two problems: First, mle expects its first argument to return (-log(likelihood)); your LL is closer to +log(likelihood), but it seems to be missing something beyond that. In particular, Y is 10 x 3, but fit is only 10 x 2. Second, I'm not sure, but it looks to me like mle wants to optimize over scalar arguments its first argument, LL in your case, and you want it to optimize over a vector. I can't see where the help page for mle spells it out, but unless I missed something, the examples all used scalar arguments. Moreover, I walked through your call to mle line by line after 'debug(mle)'. The argument start that mle passes to optim was of length 0. Therefore, you need to do something different to convince mle that it needs to optimize by varying more than 0 parameters. Have you considered changing the sign of the output of LL (which you need to do anway) and giving it directly to optim? That should work. Moreover, it looks to me like you want to do multinomial logistic regression. If that is so, have you considered searching for that in particular? RSiteSearch(multinomial logistic regression) returned 130 hits for me just now. hope this helps. spencer graves ronggui wrote: Y [,1] [,2] [,3] [1,]010 [2,]010 [3,]001 [4,]100 [5,]001 [6,]001 [7,]100 [8,]100 [9,]001 [10,]100 X pri82 pan82 1 0 0 2 0 0 3 1 0 4 1 0 5 0 1 6 0 0 7 1 0 8 1 0 9 0 0 10 0 0 K=2 J=3 LL - function(b=rep(0,(J-1)*K)){ B=matrix(c(b,rep(0,K)),ncol=J,nrow=K) fit - X%*%B p-exp(fit)/rowSums(exp(fit)) sum(Y*log(p)) } grad- function(b=rep(0,(J-1)*K)){ B=matrix(c(b,rep(0,K)),ncol=J,nrow=K) fit - X%*%B p-exp(fit)/rowSums(exp(fit)) Yp - Y-p Yp-matrix(rep(t(Yp),each=K),ncol=K*J,by=T) X - matrix(rep(X,J) ,ncol=K*J) apply(Yp*X,2,sum) } library(stats4) mle(LL) Error in validObject(.Object) : invalid class mle object: invalid object for slot fullcoef in class mle: got class list, should be or extend class numeric mle(LL,gr=grad) Error in optim(start, f, method = method, hessian = TRUE, ...) : gradient in optim evaluated to length 6 not 0 what is wrong with my code?I try to fix it myself but fails,anyone helps me ?Thank you! -- Deparment of Sociology Fudan University __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] plotting lines that break if data break
Hi, Sometimes data series (not necessarily time series) suffer breaks where data were expected, but not collected. Often the regular lines command to add such data to a plot is what I want, but other times I'd like the line to break where the data series is interrupted, instead of the line jumping to the next point in the series uninterrupted. Usually my data file contain one value of x but none of y, but alternatively a break could also appear as a NA value for both x and y. I have found I could use the segments command instead of lines, but this seems to require I manipulate my data (which may or may not contain breaks, and the number of breaks can vary if there are breaks at all). Is there another command that works like lines but will break the line if the data series suffer an interruption? Sincerely, Denis Chabot __ R-help@stat.math.ethz.ch 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] plotting lines that break if data break
It does break already. Try this: plot(1:10, c(1:5,NA,7:10), type = l) plot(c(1:5,NA,7:10), 1:10, type = l) On 2/7/06, Denis Chabot [EMAIL PROTECTED] wrote: Hi, Sometimes data series (not necessarily time series) suffer breaks where data were expected, but not collected. Often the regular lines command to add such data to a plot is what I want, but other times I'd like the line to break where the data series is interrupted, instead of the line jumping to the next point in the series uninterrupted. Usually my data file contain one value of x but none of y, but alternatively a break could also appear as a NA value for both x and y. I have found I could use the segments command instead of lines, but this seems to require I manipulate my data (which may or may not contain breaks, and the number of breaks can vary if there are breaks at all). Is there another command that works like lines but will break the line if the data series suffer an interruption? Sincerely, Denis Chabot __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] difference between rnorm(1000, 0, 1) and running rnorm(500, 0, 1) twice
Hi R users This looks a simple question Is there any difference between between rnorm(1000,0,1) and running rnorm(500,0,1) twice in terms of outcome ? TM __ R-help@stat.math.ethz.ch 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] plotting lines that break if data break
I'm sorry, too long without coffee. Lately I have done numerous plots with superimposed non-linear quantile regression fits, and those do not break (which is fine), and I wrongly transposed this to lines in my head. Denis Le 06-02-07 à 22:06, Gabor Grothendieck a écrit : It does break already. Try this: plot(1:10, c(1:5,NA,7:10), type = l) plot(c(1:5,NA,7:10), 1:10, type = l) On 2/7/06, Denis Chabot [EMAIL PROTECTED] wrote: Hi, Sometimes data series (not necessarily time series) suffer breaks where data were expected, but not collected. Often the regular lines command to add such data to a plot is what I want, but other times I'd like the line to break where the data series is interrupted, instead of the line jumping to the next point in the series uninterrupted. Usually my data file contain one value of x but none of y, but alternatively a break could also appear as a NA value for both x and y. I have found I could use the segments command instead of lines, but this seems to require I manipulate my data (which may or may not contain breaks, and the number of breaks can vary if there are breaks at all). Is there another command that works like lines but will break the line if the data series suffer an interruption? Sincerely, Denis Chabot __ R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] lme syntax for PB examples
Hi helpeRs, I've been working through some examples in Pinhiero Bates( 2000) trying to understand how to translate to the new Lme4 syntax but without much luck. Below is what I think I should do, but either the answers don't come out the same or I get errors. In the Oxide problems I'm particularly interested in obtaining the levels coeficients but this options no longer seems to be available in lme4. How can levels infor be obtained in lme4? If someone can recreate the examples below in lme4 syntax so I can follow what is happening in the text I'd be grateful. Cheers Paul Cossens #Pixel # PB(2000) p40-45 Pixel-read.csv(Pixel.csv,header=TRUE); Pixel$Side-as.factor(Pixel$Side) Pixel$Dog-as.factor(Pixel$Dog) (fm1Pixel - lmer(pixel ~ day + I(day^2) +(day|Dog)+(1|Side), data = Pixel)) (fm2Pixel - lmer(pixel ~ day + I(day^2) +(day|Dog), data = Pixel)) (fm3Pixel - lmer(pixel ~ day + I(day^2) +(1|Dog:Side), data = Pixel)) or should I do it this way? Pixel$DS-with(Pixel,Dog:Side)[drop=TRUE] (fm3Pixel - lmer(pixel ~ day + I(day^2) +(1|DS), data = Pixel)) (fm4Pixel - lmer(pixel ~ day + I(day^2) +Side , data = Pixel)) #Oxide # PB(2000) p167-170 Oxide-read.csv(Oxide.csv,header=TRUE); Oxide$Source-as.factor(Oxide$Source) Oxide$Lot-as.factor(Oxide$Lot) Oxide$Wafer-as.factor(Oxide$Wafer) Oxide$Site-as.factor(Oxide$Site) fm1Oxide-lmer(Thickness~ (1|Lot)+(1|Lot:Wafer),data=Oxide) ) (fm2Oxide-lmer(Thickness~ (1|Lot),data=Oxide) ) coef(fm1Oxide) [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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] 15-min mean values
Thanks a lot to Gabor for his help with the solution of this problem. The solution using zoo(aggregate) is easy to implement efficient. I have calculated the 15min mean values of a 1min wind speed file containing 2.9 million records x 16 columns (size 179 MB) in just 144 seconds (R-2.1.1 running in a GNU/LINUX machine). Thanks to Bogdan too for his suggested solution using SQL, I have not tried that one yet. Augusto __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html