[R] installing knncat package
Hi all, I am wondering if anyone has problem installing 'knncat' package. I tried to install using 'Rcmd INSTALL knncat_1.1.1.tar.gz', error message appeared. I attached the message in the end. I allso tried to install from RGui, but it was not listed. Thanks in advance. Regards, jenny -- Making package knncat adding build stamp to DESCRIPTION making DLL ... making com.d from com.c making dodisc.d from dodisc.c making donn.d from donn.c making donnwrap.d from donnwrap.c making dsort.d from dsort.c making linpack.d from linpack.c making matrix.d from matrix.c making objective.d from objective.c making ords.d from ords.c making ranlib.d from ranlib.c making utilsR.d from utilsR.c gcc -Ic:/R/rw1081/src/include -Wall -O2 -I . -pedantic -Wall -DUSE_R_ALLOC -DC ALL_FROM_R -c com.c -o com.o gcc -Ic:/R/rw1081/src/include -Wall -O2 -I . -pedantic -Wall -DUSE_R_ALLOC -DC ALL_FROM_R -c dodisc.c -o dodisc.o gcc -Ic:/R/rw1081/src/include -Wall -O2 -I . -pedantic -Wall -DUSE_R_ALLOC -DC ALL_FROM_R -c donn.c -o donn.o gcc -Ic:/R/rw1081/src/include -Wall -O2 -I . -pedantic -Wall -DUSE_R_ALLOC -DC ALL_FROM_R -c donnwrap.c -o donnwrap.o donnwrap.c: In function `donnwrap': donnwrap.c:84: warning: passing arg 5 of `do_nn' from incompatible pointer type donnwrap.c:84: warning: passing arg 9 of `do_nn' from incompatible pointer type donnwrap.c:84: warning: passing arg 10 of `do_nn' from incompatible pointer type donnwrap.c:84: warning: passing arg 16 of `do_nn' from incompatible pointer type donnwrap.c:84: warning: passing arg 21 of `do_nn' from incompatible pointer type donnwrap.c:84: warning: passing arg 22 of `do_nn' from incompatible pointer type donnwrap.c:84: warning: passing arg 23 of `do_nn' from incompatible pointer type donnwrap.c:94: warning: passing arg 5 of `do_nn' from incompatible pointer type donnwrap.c:94: warning: passing arg 9 of `do_nn' from incompatible pointer type donnwrap.c:94: warning: passing arg 10 of `do_nn' from incompatible pointer type donnwrap.c:94: warning: passing arg 16 of `do_nn' from incompatible pointer type donnwrap.c:94: warning: passing arg 21 of `do_nn' from incompatible pointer type donnwrap.c:94: warning: passing arg 22 of `do_nn' from incompatible pointer type donnwrap.c:94: warning: passing arg 23 of `do_nn' from incompatible pointer type gcc -Ic:/R/rw1081/src/include -Wall -O2 -I . -pedantic -Wall -DUSE_R_ALLOC -DC ALL_FROM_R -c dsort.c -o dsort.o gcc -Ic:/R/rw1081/src/include -Wall -O2 -I . -pedantic -Wall -DUSE_R_ALLOC -DC ALL_FROM_R -c linpack.c -o linpack.o gcc -Ic:/R/rw1081/src/include -Wall -O2 -I . -pedantic -Wall -DUSE_R_ALLOC -DC ALL_FROM_R -c matrix.c -o matrix.o gcc -Ic:/R/rw1081/src/include -Wall -O2 -I . -pedantic -Wall -DUSE_R_ALLOC -DC ALL_FROM_R -c objective.c -o objective.o gcc -Ic:/R/rw1081/src/include -Wall -O2 -I . -pedantic -Wall -DUSE_R_ALLOC -DC ALL_FROM_R -c ords.c -o ords.o gcc -Ic:/R/rw1081/src/include -Wall -O2 -I . -pedantic -Wall -DUSE_R_ALLOC -DC ALL_FROM_R -c ranlib.c -o ranlib.o gcc -Ic:/R/rw1081/src/include -Wall -O2 -I . -pedantic -Wall -DUSE_R_ALLOC -DC ALL_FROM_R -c utilsR.c -o utilsR.o ar cr knncat.a *.o ranlib knncat.a windres --include-dir c:/R/rw1081/src/include -i knncat_res.rc -o knncat_res.o gcc --shared -s -o knncat.dll knncat.def knncat.a knncat_res.o -Lc:/R/rw1081/ src/gnuwin32 c:/R/rw1081/src/modules/lapack/libRlapack.a -lRblas -lg2c -lg2c -lR gcc.exe: c:/R/rw1081/src/modules/lapack/libRlapack.a: No such file or directory make[2]: *** [knncat.dll] Error 1 make[1]: *** [srcDynlib] Error 2 make: *** [pkg-knncat] Error 2 *** Installation of knncat failed *** __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] installing knncat package
This is an error in the package. In file src/Makevars it has LAPACK_LIBS=$(R_HOME)/src/modules/lapack/libRlapack.a which is a reference to the R sources. That should not be there: please remove it and this may well work. However, your version of R is rather old, which is why you are not seeing a pre-compiled version. R 2.0.1 will be out this week, and please upgrade to it when all the current packages which compile under Windows will be available to you, pre-compiled. On Mon, 15 Nov 2004, Jenny Edmondson wrote: Hi all, I am wondering if anyone has problem installing 'knncat' package. I tried to install using 'Rcmd INSTALL knncat_1.1.1.tar.gz', error message appeared. I attached the message in the end. I allso tried to install from RGui, but it was not listed. [...] gcc --shared -s -o knncat.dll knncat.def knncat.a knncat_res.o -Lc:/R/rw1081/src/gnuwin32 c:/R/rw1081/src/modules/lapack/libRlapack.a -lRblas -lg2c -lg2c -lR gcc.exe: c:/R/rw1081/src/modules/lapack/libRlapack.a: No such file or directory -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] argument rationalization
Hi I am writing a bunch of functions that take two, three or four arguments. These functions operate on vectors of the same length; but I want the function to behave sensibly if one or more arguments are scalars. + does this for two arguments: +(1:10,3)# interpreted as +(1:10,rep(3,10)) But my functions can take more arguments. Say f() takes three: f(1:10,1:10,1:10) # default f(3,1:10,1:10) # interpret as f(rep(3,10),1:10,1:10) f(1:10,3,1:10) # interpret as f(1:10,rep(3,10),1:10) f(1:10,3,5)# interpret as f(1:10,rep(3,10),rep(5,10)) and h() takes four: h(2,4,5,1:10)# interpret as h(rep(2,10),rep(4,10),rep(5,10),1:10) h(2,3,1:10,1)# interpret as h(rep(2,10),rep(3,10),1:10,rep(1:10) h(1:20,3,1:20,1) # interpret as h(1:20,rep(3,20),1:20,rep(1,20)) I haven't got any that need five yet, but this may change in the future. How do I implement this desired behaviour nicely? (I pass the arguments to .C(), which is why I need this). -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre SO14 3ZH tel +44(0)23-8059-7743 [EMAIL PROTECTED] (edit in obvious way; spam precaution) __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] argument rationalization
I think you should implement recycling, ideally at C level. But you could have f - function(x, y, z) { n - max(length(x), length(y), length(z)) .C(something, as.double(rep(x, len=n)), as.double(rep(y, len=n)), as.double(rep(z, len=n)), as.integer(n), ans)$ans } On Mon, 15 Nov 2004, Robin Hankin wrote: Hi I am writing a bunch of functions that take two, three or four arguments. These functions operate on vectors of the same length; but I want the function to behave sensibly if one or more arguments are scalars. + does this for two arguments: +(1:10,3)# interpreted as +(1:10,rep(3,10)) But my functions can take more arguments. Say f() takes three: f(1:10,1:10,1:10) # default f(3,1:10,1:10) # interpret as f(rep(3,10),1:10,1:10) f(1:10,3,1:10) # interpret as f(1:10,rep(3,10),1:10) f(1:10,3,5)# interpret as f(1:10,rep(3,10),rep(5,10)) and h() takes four: h(2,4,5,1:10)# interpret as h(rep(2,10),rep(4,10),rep(5,10),1:10) h(2,3,1:10,1)# interpret as h(rep(2,10),rep(3,10),1:10,rep(1:10) h(1:20,3,1:20,1) # interpret as h(1:20,rep(3,20),1:20,rep(1,20)) I haven't got any that need five yet, but this may change in the future. How do I implement this desired behaviour nicely? (I pass the arguments to .C(), which is why I need this). -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre SO14 3ZH tel +44(0)23-8059-7743 [EMAIL PROTECTED] (edit in obvious way; spam precaution) __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Problems installing packages on MacOS with R 2.00
Dear all, I have a problem installing a package required by Hmisc on MacOS 10.3.5 with R 2.00. g77 -fno-common -g -O2 -c avas.f -o avas.o g77 -fno-common -g -O2 -c rlsmo.f -o rlsmo.o gcc -bundle -flat_namespace -undefined suppress -L/usr/local/lib -o acepack.so ace.o avas.o rlsmo.o -L/usr/local/lib -L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2 -L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2/../../.. -lfrtbegin -lg2c -lSystem -lcc_dynamic -framework R ld: warning -L: directory name (/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2) does not exist ld: warning -L: directory name (/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2/../../..) does not exist ld: can't locate file for: -lfrtbegin make: *** [acepack.so] Error 1 ERROR: compilation failed for package 'acepack' I found on the Internet a fix for R 1.8 which suggests to delete the -lfrtbegin library from /Applications/StartR.app/RAqua.app/Contents/etc but this path does not exists anymore on R 2.00. How could I solve the problem. Thank you in advance for the help. Marco - Marco Chiarandini, Fachgebiet Intellektik, Fachbereich Informatik, Technische Universität Darmstadt, Hochschulstraße 10, D-64289 Darmstadt - Germany, Office: S2/02 Raum E317 Tel: +49.(0)6151.166802 Fax: +49.(0)6151.165326 email: [EMAIL PROTECTED] web page: http://www.intellektik.informatik.tu-darmstadt.de/~machud __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] argument rationalization
I think you should implement recycling, ideally at C level. But you could have f - function(x, y, z) { n - max(length(x), length(y), length(z)) .C(something, as.double(rep(x, len=n)), as.double(rep(y, len=n)), as.double(rep(z, len=n)), as.integer(n), ans)$ans } yes! this works exactly as desired. Thank you. Another thing that is incidentally satisfied by this scheme is to preserve attributes such as dimensions and dimnames. It seems to me to make sense to use the attributes of the longest argument, and then set them after the call to wit f - function(x, y, z) { lens - c(length(x), length(y), length(z)) all.attributes - list(attributes(x),attributes(y),attributes(z)) n - max(lens) attributes.desired - all.attributes[[which.max(lens)]] .C(something, as.double(rep(x, len=n)), as.double(rep(y, len=n)), as.double(rep(z, len=n)), as.integer(n), ans)$ans attributes(ans) - attributes.desired return(ans) } Is this good practice? best wishes rksh On Mon, 15 Nov 2004, Robin Hankin wrote: Hi I am writing a bunch of functions that take two, three or four arguments. These functions operate on vectors of the same length; but I want the function to behave sensibly if one or more arguments are scalars -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre SO14 3ZH tel +44(0)23-8059-7743 [EMAIL PROTECTED] (edit in obvious way; spam precaution) __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Problems installing packages on MacOS with R 2.00
It is R 2.0.0! Your problem is that you do not have g77 installed, or at least, not the same version as was used to compile your version of R. (Please do read the posting guide and tell us where you got R from -- I suspect you did not compile it yourself.) I think this should be in the MacOS X FAQ, but unfortunately the version on CRAN linked from the sidebar and the main FAQ at http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html is for R 1.9.1, not 2.0.0. Did your installation come with a current version? However, a further problem is that many packages which use Fortran code cannot be compiled for MacOS X as it does not have a shared Fortran run-time library. So I suspect that if you do install g77-3.4.2 you will find that you cannot compile package acepack, and that is why no pre-compiled version of the package is available. On Mon, 15 Nov 2004, Marco Chiarandini wrote: Dear all, I have a problem installing a package required by Hmisc on MacOS 10.3.5 with R 2.00. g77 -fno-common -g -O2 -c avas.f -o avas.o g77 -fno-common -g -O2 -c rlsmo.f -o rlsmo.o gcc -bundle -flat_namespace -undefined suppress -L/usr/local/lib -o acepack.so ace.o avas.o rlsmo.o -L/usr/local/lib -L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2 -L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2/../../.. -lfrtbegin -lg2c -lSystem -lcc_dynamic -framework R ld: warning -L: directory name (/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2) does not exist ld: warning -L: directory name (/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2/../../..) does not exist ld: can't locate file for: -lfrtbegin make: *** [acepack.so] Error 1 ERROR: compilation failed for package 'acepack' I found on the Internet a fix for R 1.8 which suggests to delete the -lfrtbegin library from /Applications/StartR.app/RAqua.app/Contents/etc but this path does not exists anymore on R 2.00. How could I solve the problem. PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html PLEASE do! -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Where has the Debian respository gone?
Dirk Eddelbuettel schrieb am 15.11.2004 02:35 [CRAN Debian respository] It has been turned off by the CRAN masters as the content had slipped further and further behind the Debian content. Current R and CRAN packages are on the Debian archives; you can install these on testing too. To the best of my knowledge, there are no backports of current R and Debian CRAN packages to Debian stable. Ok, thanks! Is there a list this fact was mentioned on? Greetings, Christoph __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Where has the Debian respository gone?
Dirk Eddelbuettel schrieb am 15.11.2004 04:12 On Sun, Nov 14, 2004 at 07:35:27PM -0600, Dirk Eddelbuettel wrote: [...] Current R and CRAN packages are on the Debian archives; you can install these on testing too. To the best of my knowledge, there are no backports of current R and Debian CRAN packages to Debian stable. Upon re-reading this, I should clarify that in this context CRAN packages refers to the several dozen CRAN packages that are in Debian; Thanks for the clarification. That's how I already understood it. the list is growing but still far from exhaustive. Yes, I saw it on the Ubuntu machine of my girl friend (I changed her Debian Woody/Sarge some weeks ago to Warty), when I used synaptic for the first time; didn't know, that there was so many CRAN packages for Debian! Up to now I always installed packages from within R by install.packages(foo). Has one of these methods advantages compared with the other? Greetings, Christoph __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Problems installing packages on MacOS with R 2.00
Dear Prof. Ripley, It is R 2.0.0! Your problem is that you do not have g77 installed, or at least, not the same version as was used to compile your version of R. (Please do read the posting guide and tell us where you got R from -- I suspect you did not compile it yourself.) I took R from http://cran.at.r-project.org/. True, I did not compiled it: it was the R 2.0.0 (lastest version) bin package. However, I have g77 version 3.4 (October 2003) installed on MacOS. I deleted both -lfrtbegin and -lg2c from FLIBS in /Library/Frameworks/R.framework/Resources/etc/Makeconf and now Hmisc compiles fine. I could not find a directory /usr/local/lib/gcc/powerpc-apple-darwin6.8/ in my installation. I think this should be in the MacOS X FAQ, but unfortunately the version on CRAN linked from the sidebar and the main FAQ at http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html is for R 1.9.1, not 2.0.0. Did your installation come with a current version? However, a further problem is that many packages which use Fortran code cannot be compiled for MacOS X as it does not have a shared Fortran run-time library. So I suspect that if you do install g77-3.4.2 you will find that you cannot compile package acepack, and that is why no pre-compiled version of the package is available. --- Marco Chiarandini, Fachgebiet Intellektik, Fachbereich Informatik, Technische Universität Darmstadt, Hochschulstraße 10, D-64289 Darmstadt - Germany, Office: S2/02 Raum E317 Tel: +49.(0)6151.166802 Fax: +49.(0)6151.165326 email: [EMAIL PROTECTED] web page: http://www.intellektik.informatik.tu-darmstadt.de/~machud __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Legend help needed
You have not called legend() in your codes below, so we do not know what your problem is. See other comments below. On Mon, 2004-11-15 at 01:08, Sean David Richards wrote: R : Version 1.9.1 Hi, Am having trouble adding a legend to scatterplot. R code is shown below. I have tried various incantations to add a legend (using the legend() function) to the resulting plot but without any success. Looks like it should be simple but I must be missing something. Any pointers would be welcome. Have looked at help(legend) etc. help(legend) provides many nice examples. Here is a simplified one : x - seq(-pi, pi, len = 65) plot(x, sin(x), type=l, lty=1, col=1) lines(x, cos(x), type=l, lty=2, col=2) legend(-pi, 1, legend=c(sin, cosine), lty=1:2, col=1:2) Or you can replace the last line with legend(locator(1), legend=c(sin, cosine), lty=1:2, col=1:2) where the legend will be placed on mouse left click. --8-- --- sfiles - c(72_12_12_V.csv , 150_25_15_V.csv, 150_25_20_V.csv, 150_25_25_V.csv, 150_25_40_V.csv, 150_25_60_V.csv, 150_25_90_V.csv, 240_40_40_V.csv) ## process each file in list for (i in 1:length(sfiles)) { data - read.csv(paste(../data/,sfiles[i],sep=)) ## assign columns to some nice names K - data[,8] AN - data[,3] * (data[,2] - data[,4]) ## plot K against AN Please give a simplified example. You do not need to show us all the preprocessing steps. It can be distracting. if ( i == 1) { plot(AN, K, ylim=c(1000,9000), xlim=c(0,1500), xlab=Area above Notch (mm), main=Size Effect Specimens) par(new=TRUE) } else{ plot(AN,K, pch=(i),ylim=c(1000,9000), xlim=c(0,1500), axes=FALSE,xlab=) par(new=TRUE) } } Have you considered points() or lines() here ? You could simplify to plot(0,1000, type=n, xlim=c(0,1500), ylim=c(1000,9000), xlab=Area above Notch (mm), main=Size Effect Speciments) n - length(sfiles) for (i in 1:n) { data - read.csv(paste(../data/,sfiles[i],sep=)) K- data[,8] AN - data[,3] * (data[,2] - data[,4]) points( AN, K, pch=i, col=i ) } legend( 1500, 9000, legend=paste(Data from, sfiles), pch=1:n, col=i ) --8-- --- __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Problems installing packages on MacOS with R 2.00
On Mon, 15 Nov 2004, Marco Chiarandini wrote: Dear Prof. Ripley, It is R 2.0.0! Your problem is that you do not have g77 installed, or at least, not the same version as was used to compile your version of R. (Please do read the posting guide and tell us where you got R from -- I suspect you did not compile it yourself.) I took R from http://cran.at.r-project.org/. True, I did not compiled it: it was the R 2.0.0 (lastest version) bin package. However, I have g77 version 3.4 (October 2003) installed on MacOS. Which is rather old, and this was looking for 3.4.2 (and 3.4.3 is current). Have you read the posting guide yet? I deleted both -lfrtbegin and -lg2c from FLIBS in You can safely delete -lfrtbegin. I don't believe you can safely delete -lg2c, as some packages do need code from it. On my systems that includes acepack, but as you have a system using libR.dylib, it may be that libR.dylib contains the routines that acepack needs from -lg2c. /Library/Frameworks/R.framework/Resources/etc/Makeconf and now Hmisc compiles fine. I could not find a directory /usr/local/lib/gcc/powerpc-apple-darwin6.8/ in my installation. I think this should be in the MacOS X FAQ, but unfortunately the version on CRAN linked from the sidebar and the main FAQ at http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html is for R 1.9.1, not 2.0.0. Did your installation come with a current version? However, a further problem is that many packages which use Fortran code cannot be compiled for MacOS X as it does not have a shared Fortran run-time library. So I suspect that if you do install g77-3.4.2 you will find that you cannot compile package acepack, and that is why no pre-compiled version of the package is available. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Power curves
What do you mean by power curves ? Is it the power of a study as the effect size varies or power output of a machine with some other parameter ? I usually generate a sequence of numbers (for the x-axis) that spans the range of interest and calculate its output. # Example 1 f - function(x) sin(x) x - seq(0, 10, by=0.01) y - f(x) plot(x, y, type=l) Or you can call plot(f, xlim=c(0, 10) ) # Example 2 plot(2:100, power.t.test(2:100, delta=1, sd=1, sig.level=0.05)$power) Regards, Adai On Mon, 2004-11-15 at 01:19, Duncan Harris wrote: How do I draw/calculate power curves in R? Cheers, Duncan. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Legend help needed
Sorry typo. The last line should read legend(1500, 9000, legend=paste(Data from, sfiles), pch=1:n, col=1:n ) ^^^ On Mon, 2004-11-15 at 11:39, Adaikalavan Ramasamy wrote: You have not called legend() in your codes below, so we do not know what your problem is. See other comments below. On Mon, 2004-11-15 at 01:08, Sean David Richards wrote: R : Version 1.9.1 Hi, Am having trouble adding a legend to scatterplot. R code is shown below. I have tried various incantations to add a legend (using the legend() function) to the resulting plot but without any success. Looks like it should be simple but I must be missing something. Any pointers would be welcome. Have looked at help(legend) etc. help(legend) provides many nice examples. Here is a simplified one : x - seq(-pi, pi, len = 65) plot(x, sin(x), type=l, lty=1, col=1) lines(x, cos(x), type=l, lty=2, col=2) legend(-pi, 1, legend=c(sin, cosine), lty=1:2, col=1:2) Or you can replace the last line with legend(locator(1), legend=c(sin, cosine), lty=1:2, col=1:2) where the legend will be placed on mouse left click. --8-- --- sfiles - c(72_12_12_V.csv , 150_25_15_V.csv, 150_25_20_V.csv, 150_25_25_V.csv, 150_25_40_V.csv, 150_25_60_V.csv, 150_25_90_V.csv, 240_40_40_V.csv) ## process each file in list for (i in 1:length(sfiles)) { data - read.csv(paste(../data/,sfiles[i],sep=)) ## assign columns to some nice names K - data[,8] AN - data[,3] * (data[,2] - data[,4]) ## plot K against AN Please give a simplified example. You do not need to show us all the preprocessing steps. It can be distracting. if ( i == 1) { plot(AN, K, ylim=c(1000,9000), xlim=c(0,1500), xlab=Area above Notch (mm), main=Size Effect Specimens) par(new=TRUE) } else{ plot(AN,K, pch=(i),ylim=c(1000,9000), xlim=c(0,1500), axes=FALSE,xlab=) par(new=TRUE) } } Have you considered points() or lines() here ? You could simplify to plot(0,1000, type=n, xlim=c(0,1500), ylim=c(1000,9000), xlab=Area above Notch (mm), main=Size Effect Speciments) n - length(sfiles) for (i in 1:n) { data - read.csv(paste(../data/,sfiles[i],sep=)) K- data[,8] AN - data[,3] * (data[,2] - data[,4]) points( AN, K, pch=i, col=i ) } legend( 1500, 9000, legend=paste(Data from, sfiles), pch=1:n, col=i ) --8-- --- __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Adaikalavan Ramasamy[EMAIL PROTECTED] Centre for Statistics in Medicine http://www.ihs.ox.ac.uk/csm/ Cancer Research UK Tel : 01865 226 677 Old Road Campus, Headington, Oxford Fax : 01865 226 962 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Somewhat off-topic : Hand and Taylor reference
I am sorry to trouble the list with this, but I'm hoping that someone will be able to help me track down this reference. I am looking for a good reference on repeated measures, and many of the relevant functions in R refer in their help to: Hand, D. J. and Taylor, C. C. (1987) _Multivariate Analysis of Variance and Repeated Measures._ Chapman and Hall. This sounds like a useful text, but I can't find it on Amazon. I can find: Multivariate Analysis of Variance for Behavioural Scientists (Chapman Hall Statistics Text Series) D.J. Hand, C.C. Taylor http://www.amazon.co.uk/exec/obidos/ASIN/0412258005/qid=1100520579/sr=1- 4/ref=sr_1_8_4/026-0799039-6262851#product-details Is this the same book? It has the same publication date. Alternatively, is the reference mentioned in R help now out of print? If so, are there any other books which you would recommend for this subject? Thanks in advance for any help with this and apologies if this query is inappropriate for the list. Rachel Pearce British Society of Blood and Marrow Transplantation __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] how can draw probability density plot?
Dear support, I want to draw a probability density plot in R. For example, I provide the mean and variance of a normal distribution, then R can provide me the probability density plot. Now I always generate random numbers of normal distribution and calculate their dnorm(mu, var), finally plot them. I am eager to know some directly operation. Thank you for your attention. I am looking forward to hearing from you soon. Best regards, Long Yu __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R: how can draw probability density plot?
I hope this example could help you best vito x-seq(-3.5,3.5,0.1) x [1] -3.5 -3.4 -3.3 -3.2 -3.1 -3.0 -2.9 -2.8 -2.7 -2.6 -2.5 -2.4 -2.3 -2.2 -2.1 [16] -2.0 -1.9 -1.8 -1.7 -1.6 -1.5 -1.4 -1.3 -1.2 -1.1 -1.0 -0.9 -0.8 -0.7 -0.6 [31] -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 [46] 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 [61] 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 d- dnorm(x,0,1) plot(d),type=l) you wrote: Dear support, I want to draw a probability density plot in R. For example, I provide the mean and variance of a normal distribution, then R can provide me the probability density plot. Now I always generate random numbers of normal distribution and calculate their dnorm(mu, var), finally plot them. I am eager to know some directly operation. Thank you for your attention. I am looking forward to hearing from you soon. Best regards, Long Yu = Diventare costruttori di soluzioni Became solutions' constructors The business of the statistician is to catalyze the scientific learning process. George E. P. Box Visitate il portale http://www.modugno.it/ e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_palese.shtml __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Somewhat off-topic : Hand and Taylor reference
Rachel Pearce [EMAIL PROTECTED] writes: Hand, D. J. and Taylor, C. C. (1987) _Multivariate Analysis of Variance and Repeated Measures._ Chapman and Hall. This sounds like a useful text, but I can't find it on Amazon. I can find: Multivariate Analysis of Variance for Behavioural Scientists (Chapman Hall Statistics Text Series) D.J. Hand, C.C. Taylor http://www.amazon.co.uk/exec/obidos/ASIN/0412258005/qid=1100520579/sr=1- 4/ref=sr_1_8_4/026-0799039-6262851#product-details Is this the same book? It has the same publication date. Alternatively, is the reference mentioned in R help now out of print? If so, are there any other books which you would recommend for this subject? It also has the same ISBN and is subtitled A practical approach for behavioural scientists... -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R: how can draw probability density plot?
I believe this is better and that you want! x-rnorm(1000,10,1) plot( function(y) dnorm(y, mean(x), sd(x)), from=min(x), to=max(x)) best vito You wrote: Dear support, I want to draw a probability density plot in R. For example, I provide the mean and variance of a normal distribution, then R can provide me the probability density plot. Now I always generate random numbers of normal distribution and calculate their dnorm(mu, var), finally plot them. I am eager to know some directly operation. Thank you for your attention. I am looking forward to hearing from you soon. Best regards, Long Yu = Diventare costruttori di soluzioni Became solutions' constructors The business of the statistician is to catalyze the scientific learning process. George E. P. Box Visitate il portale http://www.modugno.it/ e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_palese.shtml __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Somewhat off-topic : Hand and Taylor reference
The full library info is Multivariate analysis of variance and repeated measures : a practical approach for behavioural scientists Publisher London : Chapman and Hall, 1987. Description xiii, 262 p. : ill. ; 24 cm. Notes Bibliography: p. 208-209. - Includes index. ISBN0412258005 (pbk) 0412258102 although the part of the title after the colon is in very small print. It looks the same as that now published by CRC Press, who are showing that title at http://www.crcpress.com/shopping_cart/products/product_detail.asp?sku=C5800parent_id=501pc= So my guess is that Amazon have it garbled. On Mon, 15 Nov 2004, Rachel Pearce wrote: I am sorry to trouble the list with this, but I'm hoping that someone will be able to help me track down this reference. I am looking for a good reference on repeated measures, and many of the relevant functions in R refer in their help to: Hand, D. J. and Taylor, C. C. (1987) _Multivariate Analysis of Variance and Repeated Measures._ Chapman and Hall. This sounds like a useful text, but I can't find it on Amazon. I can find: Multivariate Analysis of Variance for Behavioural Scientists (Chapman Hall Statistics Text Series) D.J. Hand, C.C. Taylor http://www.amazon.co.uk/exec/obidos/ASIN/0412258005/qid=1100520579/sr=1- 4/ref=sr_1_8_4/026-0799039-6262851#product-details Is this the same book? It has the same publication date. Alternatively, is the reference mentioned in R help now out of print? If so, are there any other books which you would recommend for this subject? Thanks in advance for any help with this and apologies if this query is inappropriate for the list. Rachel Pearce British Society of Blood and Marrow Transplantation __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Error when scan()ning dead URL's
Hi, I often scan web pages directly into R using scan('http://etc...','') however this gives an error if the page/url doesn't exist, or the connection to it is not available. Is it possible to still use scan but have R return something other than an error (which crashes code) when the page or the connection isn't available. Cheers John Haynes __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Error when scan()ning dead URL's
Jonathan Croft [EMAIL PROTECTED] writes: I often scan web pages directly into R using scan('http://etc...','') however this gives an error if the page/url doesn't exist, or the connection to it is not available. Is it possible to still use scan but have R return something other than an error (which crashes code) when the page or the connection isn't available. Can't you just wrap it in a try() construct? -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] help for nls
Hello, I am beginning with R and I would like to test a non linear model. But I do not find exactly wath I am looking for in nls packages (or I do not know where to search). I would like to try a model like this : y=b * x exp(n)/(a exp(n) + x exp (n)) Where a = a0 + a1z b= b0 + b1z x and z are variables y the variable that I am trying to modelise a0, a1, b0 and b1 are parameters to determine. I am wondering if I can use nls and if so how do I have to write my command ? Thanks in advance for your help. Cyrille Barnérias Adjoint au chef d'échelon interrégional de Caen Inventaire forestier national 73 rue Marie Curie 14 200 Hérouville Saint-Clair France Tel : 02.31.47.71.53 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Using R in parallel on a 2 processor machine
Hi, I have installed R (2.0.0) onto a two processor machine running Windows XP (these two processors have been split into 4 logical processors), with 4Gb of RAM. Rather than multi-threading, I wanted to run 2 instances of R on the machine in parallel, which uses two of the logical processors. Unfortunately, R seems to be accessing a total of 1Gb of RAM, not taking advantage of 2 lots of 1Gb. This has led to memory problems, with one R process using the RAM, and the other one running into memory problems. Looking at previous posts on this issue, I have tried using gc(), to take back unused memory. This has allowed the two parallel processes to work, but has not given me access to the other 3Gb. Any help would be much appreciated into how R may run in parallel using more than 1Gb. Graham Graham Law Senior Scientist Epidemiology and Genetics Unit Department of Health Sciences University of York York YO10 5DD UK (t) +44 (0) 1904 32 1883 (m) +44 (0) 790 500 8828 [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Using R in parallel on a 2 processor machine
How about installing an operating system that knows its way around that much RAM? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Graham Law Sent: Monday, November 15, 2004 9:12 AM To: [EMAIL PROTECTED] Subject: [R] Using R in parallel on a 2 processor machine Hi, I have installed R (2.0.0) onto a two processor machine running Windows XP (these two processors have been split into 4 logical processors), with 4Gb of RAM. Rather than multi-threading, I wanted to run 2 instances of R on the machine in parallel, which uses two of the logical processors. Unfortunately, R seems to be accessing a total of 1Gb of RAM, not taking advantage of 2 lots of 1Gb. This has led to memory problems, with one R process using the RAM, and the other one running into memory problems. Looking at previous posts on this issue, I have tried using gc(), to take back unused memory. This has allowed the two parallel processes to work, but has not given me access to the other 3Gb. Any help would be much appreciated into how R may run in parallel using more than 1Gb. Graham Graham Law Senior Scientist Epidemiology and Genetics Unit Department of Health Sciences University of York York YO10 5DD UK (t) +44 (0) 1904 32 1883 (m) +44 (0) 790 500 8828 [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Using R in parallel on a 2 processor machine
Try reading the rw-FAQ! There is no way user processes in Windows XP can access all 4Gb of the address space, but if you tune both R and XP correctly you should be able to get above 2Gb in total. See the rw-FAQ for how to tune R. Nevertheless, as you have already been told, it is a lot easier to do this under a On Mon, 15 Nov 2004, Graham Law wrote: Hi, I have installed R (2.0.0) onto a two processor machine running Windows XP (these two processors have been split into 4 logical processors), with 4Gb of RAM. Rather than multi-threading, I wanted to run 2 instances of R on the machine in parallel, which uses two of the logical processors. Unfortunately, R seems to be accessing a total of 1Gb of RAM, not taking advantage of 2 lots of 1Gb. This has led to memory problems, with one R process using the RAM, and the other one running into memory problems. Looking at previous posts on this issue, I have tried using gc(), to take back unused memory. This has allowed the two parallel processes to work, but has not given me access to the other 3Gb. Any help would be much appreciated into how R may run in parallel using more than 1Gb. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] help for nls
Dear Cyrille, type ?nls in the R command line. This will show you how to use the nls function. And please read the posting guide (see bootom of each message). This will help you to get more helpful answers. Best wishes, Arne On Monday 15 November 2004 14:42, BARNERIAS Cyrille wrote: Hello, I am beginning with R and I would like to test a non linear model. But I do not find exactly wath I am looking for in nls packages (or I do not know where to search). I would like to try a model like this : y=b * x exp(n)/(a exp(n) + x exp (n)) Where a = a0 + a1z b= b0 + b1z x and z are variables y the variable that I am trying to modelise a0, a1, b0 and b1 are parameters to determine. I am wondering if I can use nls and if so how do I have to write my command ? Thanks in advance for your help. Cyrille Barnérias Adjoint au chef d'échelon interrégional de Caen Inventaire forestier national 73 rue Marie Curie 14 200 Hérouville Saint-Clair France Tel : 02.31.47.71.53 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Arne Henningsen Department of Agricultural Economics University of Kiel Olshausenstr. 40 D-24098 Kiel (Germany) Tel: +49-431-880 4445 Fax: +49-431-880 1397 [EMAIL PROTECTED] http://www.uni-kiel.de/agrarpol/ahenningsen/ __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R-2.0.1 is released
I've rolled up R-2.0.1.tgz a short while ago. This is a maintenance version mainly to fix a number of minor bugs and issues. (Some rather nasty ones were Windows-specific - please check the CHANGES file for those.) You can get it from http://cran.r-project.org/src/base/R-2.0.1.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Binaries for various platforms will appear in due course. There is also a version split for floppies. These are the md5sums for the freshly created files, in case you wish to check that they are uncorrupted: 6f75951d61cc321f597ea28ad43a9ada INSTALL b5519f795224506e7702f74dbbb152b1 NEWS 1a2248b10e3dbf078559705a25b52ca4 ONEWS fb47b1fdef4323031e24d541a2f36b2b R-2.0.1.tar.gz 4e334bc539e5a2d8cc3e6b8cca4171be R-2.0.1.tar.gz-split.aa bc7cb22034948998a4eeb18006a53094 R-2.0.1.tar.gz-split.ab b73f587c39599ce47bba00544f2cd100 R-2.0.1.tar.gz-split.ac bbec006c26c6a236c6b5e98989a2f0a2 R-2.0.1.tar.gz-split.ad 8d04842319525ba6cead4bff1b259263 R-2.0.1.tar.gz-split.ae e3d1af261c7ea83820597f6fef9e9449 R-2.0.1.tar.gz-split.af 3595c1939484762a6440a957908023ce R-2.0.1.tar.gz-split.ag 4492e468cc5003e06a2a85c496ff2672 R-2.0.1.tar.gz-split.ah fb47b1fdef4323031e24d541a2f36b2b R-latest.tgz b5509d1e6232e66dee66d9644bf65490 README 7a5a7cfe9419affd9574aba3cf525741 RESOURCES Here is the relevant bit of the NEWS file: CHANGES IN R VERSION 2.0.1 NEW FEATURES o Platform equivalence in library() is tested by a new function testPlatformEquivalence() which ignores the 'vendor' field and can be customized by cognescenti. o The assignment form of split() allows recycling of vectors within the value list. In particular, things like split(x, g) - lapply(split(x, g), mean) now work DOCUMENTATION o Manual `Writing R Extensions' has new sections on writing portable packages and on writing new front-ends for R -- the latter will be more comprehensive in R 2.1.0 which has new public header files. DEPRECATED DEFUNCT o The aqua module in MacOS X is deprecated. o Capabilities bzip2, GNOME, libz and PCRE are deprecated. o The GNOME GUI on Unix-alikes is deprecated as part of R; it will be available in another form as from R 2.1.0. o The undocumented use of UseMethod() with no argument is now formally deprecated. INSTALLATION CHANGES o Building on Alpha OSF/1 no longer forces the C flag -std1, which appears to be no longer needed. (PR#7257) o The compiler flag -mieee-fp is no longer used on i386 Linux (these days it is only passed to the linker and was only invoked for compilation steps). o -D__NO_MATH_INLINES is only used on older ix86 glibc-based systems which need it (tested at configure time). This leads to small improvements in speed and accuracy on modern systems. o If makeinfo = 4.5 is not available, warnings are given that some of the HTML manuals will be missing, and the index page given by help.start() will link to CRAN versions of those manuals. o Files aclocal.m4 and acinclude.m4 used in maintainer builds are not longer included in the distribution. C-LEVEL FACILITIES o It was not clear in 'Writing R Extensions' that some of the entry points in the 'Utilities' section were not declared in R.h (they were in R_ext/Applic.h). Now all the entry points in that section are declared in R_ext/Utils.h, included by R.h. BUG FIXES o The grid.grab() function in package grid would throw an error if there were no viewports pushed (now returns NULL). o model.frame.default() takes row names from the response variable if that has suitable names and there is no 'data' argument. (This follows S but was not previously implemented in R.) o write.table() was not respecting the 'dec' argument for complex numbers. o write.table() printed a mixture of numeric and complex numbers as all complex. (PR#7260) o R CMD INSTALL failed with versioned installs on packages which save images (only). o dlogis() gave NaN not 0 for large negative arguments. o Importing from another namespace was broken for versioned installs, incorrectly reporting something like package 'imported_from' does not have a name space. o The GNOME interface under Linux/Unix was broken. (PR#7276) o For the jpeg/png devices under Linux/Unix, under certain rare circumstances clipping needed to be cleared before starting a new page. (PR#7270, which has been the case since the devices were introduced in 1.1.0.) o First lattice plot (first grid.newpage() call) did not start a new page IF there had been a previous traditional graphics plot (on the same device). o
[R] Error whilst building packages
Dear All, I have been working on building a new version of the Wavethresh package for some time now. Having build a working version on Linux, I am getting the following error when checking on Windows: C:\Rpackages\R\rw2000\binRcmd check wavethresh * checking for working latex ... OK * using log directory 'C:/Rpackages/R/rw2000/bin/wavethresh.Rcheck' * checking for file 'wavethresh/DESCRIPTION' ... OK * checking if this is a source package ... OK installing R.css in C:/Rpackages/R/rw2000/bin/wavethresh.Rcheck make: *** [pkg-wavethresh] Error 255 *** Installation of wavethresh failed *** Removing 'C:/Rpackages/R/rw2000/bin/wavethresh.Rcheck/wavethresh' ERROR Installation failed. I've worked through many other problems but have been stuck on this one for a while - can anyone enlighten me? Thanks, Dan -- Dan Bailey School of Mathematics Room 1.2 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Multivariate Sampling
Dear all, I am looking for routines which allow multi-variate sampling from non-normal distributions (loglogistic) given correlations among the variables. Unfortunately, I could not find a suitable package for R. Does anybody know one? Many thanks and best regards, Stefan Albrecht [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] tsdiag() titles
I am using the ts package to fit ARIMA models, and the tsdiag() function to plot diagnostics. In doing so I'm generating an awful lot of diagnostic plots of different models and different data sets all within the same R session. So my question is, is there an option in tsdiag() similar to main=Title that I can use? This would be quite helpful when I print out the plots, so I can tell which plot goes with a particular data set and model. I can't seem to find any examples where this has been done, and no options (other than gof.lag) are listed in the R manual. library(ts) data(tbills) #Treasury Bills attach(tbills) ts.tbills-ts(tbills) diff.tbills-diff(ts.tbills) #Differenced Series arima.diff.tbills.100-arima(ts.tbills, order=c(1,0,0)) win.metafile(HW_ARIMA/tbill1.wmf) tsdiag(arima.diff.tbills.100, main=Treasury Bills) #main= does not work, is there a way to name the plot? dev.off() Thanks for any help or ideas. Andrew Kniss Assistant Research Scientist University of Wyoming Dept. 3354 1000 E. University Ave. Laramie, WY 82071 (307) 766-3949 [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R-2.0.1 is released
Whoops! You can get it from http://cran.r-project.org/src/base/R-2/R-2.0.1.tar.gz (Notice the R-2 subdir) I also forgot to sign it on behalf of The R Core Team. -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ___ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-announce __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] tsdiag() titles
You can use title, but the result is unsatisfying: fit - arima(lh, c(1,0,0)) tsdiag(fit) title(junk) Perhaps mtext with an appropriate par configuration? HTH, Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Andrew Kniss Sent: Monday, November 15, 2004 10:53 AM To: [EMAIL PROTECTED] Subject: [R] tsdiag() titles I am using the ts package to fit ARIMA models, and the tsdiag() function to plot diagnostics. In doing so I'm generating an awful lot of diagnostic plots of different models and different data sets all within the same R session. So my question is, is there an option in tsdiag() similar to main=Title that I can use? This would be quite helpful when I print out the plots, so I can tell which plot goes with a particular data set and model. I can't seem to find any examples where this has been done, and no options (other than gof.lag) are listed in the R manual. library(ts) data(tbills) #Treasury Bills attach(tbills) ts.tbills-ts(tbills) diff.tbills-diff(ts.tbills) #Differenced Series arima.diff.tbills.100-arima(ts.tbills, order=c(1,0,0)) win.metafile(HW_ARIMA/tbill1.wmf) tsdiag(arima.diff.tbills.100, main=Treasury Bills) #main= does not work, is there a way to name the plot? dev.off() Thanks for any help or ideas. Andrew Kniss Assistant Research Scientist University of Wyoming Dept. 3354 1000 E. University Ave. Laramie, WY 82071 (307) 766-3949 [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Error whilst building packages
On Mon, 15 Nov 2004, Dan Bailey wrote: Dear All, I have been working on building a new version of the Wavethresh package for some time now. Having build a working version on Linux, I am getting the following error when checking on Windows: C:\Rpackages\R\rw2000\binRcmd check wavethresh * checking for working latex ... OK * using log directory 'C:/Rpackages/R/rw2000/bin/wavethresh.Rcheck' * checking for file 'wavethresh/DESCRIPTION' ... OK * checking if this is a source package ... OK installing R.css in C:/Rpackages/R/rw2000/bin/wavethresh.Rcheck make: *** [pkg-wavethresh] Error 255 *** Installation of wavethresh failed *** Removing 'C:/Rpackages/R/rw2000/bin/wavethresh.Rcheck/wavethresh' ERROR Installation failed. I've worked through many other problems but have been stuck on this one for a while - can anyone enlighten me? Please try installing first -- you may get more informative error messages. But almost certainly only of your tools is missing, and you need to cross-check the list in README.packages. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] tsdiag() titles
Did you notice that tsdiag() plots about three plots and gives each a title? You can add a title to the array of plots using title(outer=TRUE), surprisingly enough, but you will need to adjust the outer margins to make room for it. Something like par(oma=c(0,0,2,0)) fit - arima(lh, c(1,0,0)) tsdiag(fit) title(Some title or another, outer = TRUE) On Mon, 15 Nov 2004, Andrew Kniss wrote: I am using the ts package to fit ARIMA models, and the tsdiag() function to plot diagnostics. In doing so I'm generating an awful lot of diagnostic plots of different models and different data sets all within the same R session. So my question is, is there an option in tsdiag() similar to main=Title that I can use? This would be quite helpful when I print out the plots, so I can tell which plot goes with a particular data set and model. I can't seem to find any examples where this has been done, and no options (other than gof.lag) are listed in the R manual. library(ts) data(tbills) #Treasury Bills attach(tbills) ts.tbills-ts(tbills) diff.tbills-diff(ts.tbills) #Differenced Series arima.diff.tbills.100-arima(ts.tbills, order=c(1,0,0)) win.metafile(HW_ARIMA/tbill1.wmf) tsdiag(arima.diff.tbills.100, main=Treasury Bills) #main= does not work, is there a way to name the plot? dev.off() Thanks for any help or ideas. Andrew Kniss Assistant Research Scientist University of Wyoming Dept. 3354 1000 E. University Ave. Laramie, WY 82071 (307) 766-3949 [EMAIL PROTECTED] -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595__ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] how to obtain predicted labels for test data using kernelpls
Dear members, My name is Seungho Huh. I am a statistician who tries to use the Kernel PLS method in a classification problem. I am sending this email to ask you something about the kernelpls function in R (pls.pcr package). I would like to obtain the predicted Y values for test data, using the Kernel PLS method. Let's take the example in the R help: data(NIR) attach(NIR) NIR.kernelpls - mvr(Xtrain, Ytrain, 1:6, validation = CV, method=kernelPLS) How can we get the predicted Y values (Ypred) for Xtest in this case? As far as I checked, there is no parameter to specify the test data in mvr or pls. I, therefore, thought about the kernelpls function as follows: Kernelpls(Xtrain, Ytrain, ncomp = 21, Xtest) Is this the correct way of getting Ypred for Xtest? I am afraid that it says in the help of kernelpls, this function should not be called directly, but through the generic pls function with the argument method=kernel (default). I would really appreciate it if you can give some advice on this. Thanks a lot for your time. Seungho Huh, Ph.D. Research Statistician RTI International North Carolina, USA [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R and fluxbox: 100% CPU usage
Hi, In July I reported a problem I was having with R and the fluxbox windows manager (with Linux). The interaction of R and fluxbox causes CPU to go to 100% when trying to create even a simple plot. It is the R process that is at 100%. R with any other window manager was fine, and all other applications (that I use) seem to run okay in fluxbox. I have updated both R (2.0.0) and fluxbox (0.9.10) and still have the same problem. I am not very familiar with gdb but gave it a go. I ran R and created a plot so that the R process was at 100% CPU usage. I then started gdb and attached the R process and CPU usage returned to normal (but I didn't get my plot). I detached the process and CPU usage went back up to 100%, attached it again and it went back to normal . . .. I would love to get this sorted out because I would like to use fluxbox, but can't because I am so dependent on R. Any ideas how I should proceed (incl. possibly spending more time reading the gdb man page). Thanks. Dave -- David Whiting University of Newcastle upon Tyne, UK __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] glim in R?
After some futile searches, I decided to ask the list to see if any of the sages out there would have an answer: I have a function I wrote a few years ago in S, which calls glim numerous times. I'd like to port it to R, but glm works differently from glim, which takes as part of its input an X design matrix. I probably could write a function to convert glim to glm, but hope this wouldn't be necessary... Tim Liao __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R and fluxbox: 100% CPU usage
On Mon, 2004-11-15 at 17:17 +, David Whiting wrote: Hi, In July I reported a problem I was having with R and the fluxbox windows manager (with Linux). The interaction of R and fluxbox causes CPU to go to 100% when trying to create even a simple plot. It is the R process that is at 100%. R with any other window manager was fine, and all other applications (that I use) seem to run okay in fluxbox. I have updated both R (2.0.0) and fluxbox (0.9.10) and still have the same problem. I am not very familiar with gdb but gave it a go. I ran R and created a plot so that the R process was at 100% CPU usage. I then started gdb and attached the R process and CPU usage returned to normal (but I didn't get my plot). I detached the process and CPU usage went back up to 100%, attached it again and it went back to normal . . .. I would love to get this sorted out because I would like to use fluxbox, but can't because I am so dependent on R. Any ideas how I should proceed (incl. possibly spending more time reading the gdb man page). Dave, Have you reported anything to the fluxbox folks for their consideration? Not exactly the same thing, but there was a problem a while back (under FC 1 if memory is correct) with Metacity which is GNOME's default window manager and Xemacs. When using Xemacs (with ESS for example) and you maximized the Xemacs window, CPU use went to 100% and Xemacs effectively locked. If you simply increased the size of the Xemacs window via dragging with the mouse, there was no problem. Under other window managers (ie. Xfwm4 which I use with Xfce), there was no problem. It was specific to Metacity under GNOME. To my knowledge the bug is unresolved and there was some dispute as to the source of the problem. I am not familiar with fluxbox, but their developers might have some insight into any particular interactions that might be the root cause of your problem. HTH, Marc Schwartz __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] glim in R?
Tim F Liao wrote: After some futile searches, I decided to ask the list to see if any of the sages out there would have an answer: I have a function I wrote a few years ago in S, which calls glim numerous times. I'd like to port it to R, but glm works differently from glim, which takes as part of its input an X design matrix. I probably could write a function to convert glim to glm, but hope this wouldn't be necessary... Tim Liao Would glm.fit do what you need? It has much less overhead than glm and takes a matrix as it's first argument. --sundar __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] glim in R?
Tim Liao wrote: After some futile searches, I decided to ask the list to see if any of the sages out there would have an answer: I have a function I wrote a few years ago in S, which calls glim numerous times. I'd like to port it to R, but glm works differently from glim, which takes as part of its input an X design matrix. I probably could write a function to convert glim to glm, but hope this wouldn't be necessary... I doubt that you will get any joy in locating a glim() function for R. No-one would write one; that would be wheel-re-invention given the existence of glm(). The glim() function is antiquated and is or should be deprecated. The technology has moved beyond that. What you really should do is re-write your code to call glm(). If it is ***really*** necessary to pass the design matrix, you should be able to o convert that matrix to a data frame, say ``ddd'' o call glm(formula,data=ddd) o the formula would presumably be simply something like ``y ~ .'' since the predictors would simply be all of the individual columns of your data frame. I can't see this as being particularly difficult recoding. Or if you insist, you could do just create your glim() function as: glim - function(y,X,...) { X - as.data.frame(X) glm(y~.,data=X,...) } (I can't really remember the glim syntax, but ``glim(y,X,...)'' is a reasonable facsimile.) If your design matrix has a constant column you would want to strip it out before passing the matrix to you glim() function. cheers, Rolf Turner [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] R on 64-bit Linux machine
Thanks to everyone for the info. It is very valuable. I am a little bit uneasy about conflicting reports regarding RHEL 3, but I guess at this point I just need to try and see. It's also very soothing to know that there is an official 64-bit build on CRAN. Thanks again for taking time to answer, Vadim __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Legend help needed
On 15 Nov 2004 at 12:11, Adaikalavan Ramasamy wrote: Have you considered points() or lines() here ? You could simplify to plot(0,1000, type=n, xlim=c(0,1500), ylim=c(1000,9000), xlab=Area above Notch (mm), main=Size Effect Speciments) n - length(sfiles) for (i in 1:n) { data - read.csv(paste(../data/,sfiles[i],sep=)) K- data[,8] AN - data[,3] * (data[,2] - data[,4]) points( AN, K, pch=i, col=i ) } legend( 1500, 9000, legend=paste(Data from, sfiles), pch=1:n, col=i:n) Thanks this got me going on the right track. The code is a lot more concise as well :) Using locator() instead of x,y coord was suggested by Tom and that showed me where my problem was. The legend was being created just not where it would be visible. I found this bit of code in the R-help archives and it makes thing a lot more straightforward when positioning a legend ## set the range of the usr coordinates to x = (0,1), y = (0,1) opar - par(no.readonly=TRUE) par(usr=c(0,1,0,1)) ## add the legend legend(0.75,0.9,sub(.csv,,nfiles), pch=1:length(nfiles), cex=0.7) Cheers -- Sean Richards C-fACS P.O. Box 84, Lincoln University, Canterbury, New Zealand Phone:(64)(3) 325-2811 ext 8636 Email: [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] logging messages
Hi all, I'm trying to learn R from an non-statistician's POV. I've got a statistician who uses R, but I'm the schmuck who has to integrate his R functions into an automated process. One of the things I would really like is the ability to log messages to file, specifically using syslog on a Linux box. (I also want to write messages to STDOUT based on a command-line flag, but I figure that can't be too hard to figure out. If it is too hard to figure out, you'll be seeing another message from me shortly. :-) Googling for syslog site:www.R-project.org however doesn't give me much hope. From what I gather, you guys just pipe everything to STDOUT. Is there a syslog module, er, extension for R? If so, how do I find it? TIA -- Faber http://www.linuxnj.com __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] anova, multiple comparison
hi, I try to used R to do one-way anova. here is the simple code f1- lm (y ~ block, data=yd) there are 8 levels of factor block, I also want produce multiple pairwise comparisons for the 8 levels of block, inlcuding mean and std err for each of the 8 lelevls. It is tidious to do pair test. I looked the manuals, find no clues. any suggest? Regards, Yuandan __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Barplot difficulties
Hello. I am an R newbie struggling to learn and use R . I have read many portions of the R Reference Manual, as well as the FAQs. Given that I learn something new each time, I know I might be missing something obvious. But I appeal to your good nature to help me through this initial problem. I have attached a pdf file to demonstrate what I desire and have listed what my data looks like in Excel (below). Following is the data and script I developed - which does not provide what I want. My immediate goal is to create a barplot in R similar to the attached pdf chart. But I am stuck on several problems. First, I would like to have 2 labels below the barplot - one label for each bar and one for each group of bars. Second, I would like to vary color by group (instead of by bar). I assume that I need to do use some sort of syntax within the color option but have not yet figured it out. I have made two different plot attempts -- one resulting in the bars being grouped appropriately but missing the labels below the x-axis; the other giving me the individual labels but not grouped as I need. This is my version information: platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major1 minor9.1 year 2004 month06 day 21 language R Thank you in advance for any help you can give me. ...heather -- Spreadsheet data to obtain attached pdf: Year GroupRate 2002 Alpha17.6 Beta 13.0 Gamma 8.9 Delta 7.1 Epsilon 6.0 Zeta 5.4 Eta 3.7 Theta 2.5 2003 Beta 11.6 Epsilon 8.7 Zeta 6.4 Theta 3.3 Xi 10.2 Omicron 7.9 2004 Alpha 8.9 Gamma 8.0 Delta 7.7 Episilon 6.9 Eta 6.1 Xi3.8 Omicron 1.2 -- R data set (sample.dat): Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Xi,Omicron 2002,17.6,13.0,8.9,7.1,6.0,5.4,3.7,2.5,0,0 2003,0,11.6,0,0,8.7,6.4,0,3.3,10.2,7.9 2004,8.9,0,8.0,7.7,6.9,0,6.1,0,3.8,1.2 -- My R code attempt: # Read in data sample - t(read.table(sample.dat, sep=,, header=T)) # Set color palette shade - palette(c(cyan2,yellow,magenta1)) # Set plot limits: ymax - as.integer(max(sample)+1) # Bar graph (get grouped plot but not grouped color nor individual labels below) par(mar=c(6,4,6,4)) barplot(sample, beside=T, xlab=Test and Year, ylab=Rate, font.lab=3, axis.lty=1, col=shade) legend(1,1, rownames(sample), xjust=-5.4, yjust=-2, col=shade, lty=1, lwd=2) title(main=Rate by Test and Year, outer=F, font.main=2, line=3) # Bar graph (get individual labels below but not grouped by year) barplot(t(sample), beside=T, xlab=Test and Year, ylab=Rate, font.lab=3, axis.lty=1, las=2, col=shade) legend(1,1, colnames(sample), xjust=-6, yjust=-7, col=shade, lty=1, lwd=2) title(main=Rate by Test and Year, outer=F, font.main=2, line=3) -- sample.pdf Description: Adobe PDF document __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] lme, two random effects, poisson distribution
Hello, I have a dataset concerning slugs. For each slug, the number of pumps per one time slot was counted. The number of pumps follows Bi(30, p) where p is very small, thus could be approximated by Poisson dist. (# of pumps is very often = 0) The slugs were observed during 12 time slots which are correlated in time as AR(1). The time slots are divided into two categories: Resting time slots (the first 10) Excited time slots (the last 2) I used model: pumps_ti = state_t + slugs_i + error_ti slugs and error are normaly distributed pumps_ti - # of pumps for i-th animal and t-th time slot x_t - order of the time slot (x_1 = 1, ..., x_12 = 12) state_t - state_t = 0 for resting time slots (t=1,...,10) state_t = 1 for excited time slots (t=11,12) slugs_i - ith animal, where i = 1,...,25 I would like to find out if the # of pumps depends on the variable state, assuming the correlation AR(1) between x_t and slugs being a random-effect on intercept. slugs.lmedata - groupedData(pumps ~ state | slugs, data=as.data.frame(data.slugs)) cs - corAR1(form= ~ x|slugs) res1 - lme(pumps ~ state, random = ~1 | slugs, data=slugs.lmedata, cor=cs) - Now, I would like to add a complication to the model: The slugs were observed in batches: Batch_1 = {slugs_1, slugs_2, slugs_3} Batch_2 = {slugs_5, slugs_6} Batch_3 = {slugs_7, slugs_8, slugs_9, slugs_10} Batch_4 = {slugs_11} . . . Batch_12 = {slugs_24, slugs_25} Notice that there are 12 batches, and the number of slugs in each batch differ, from 1 slug to 4 slugs. I consider batch to be another random-effect on intercept. Thus I fit model: pumps_tij = state_t + slugs_i + batch_ij + error_tij Slugs, batch and error are normally distributed, but slugs and batch are not nested factors. I had fit following (however I'm not sure if that is right): slugs.lmedataB - groupedData(pumps ~ state | slugs/batch, data=as.data.frame(data.slugs)) csB - corAR1(form= ~ x|slugs/batch) res1B - lme(pumps ~ state, random = ~1 | slugs/batch, data=slugs.lmedataB, cor=csB) QUESTIONS: 1) Are my models right? Do I model the res1B model properly? 2) Until now, I have assumed that the number of pumps follow the normal distribution. However I know that the variable pumps is distributed along Poisson distribution. How can I model that? I would like to use LOG or SQRT transformation, but I don't know how. * Thank you very much for all your help. Martina Pavlicova -- Department of Biostatistics Columbia University 722 W. 168th Street, 6th floor New York, NY 10032 Phone: (212) 305-9405 Fax: (212) 305-9408 Email: [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] glim in R?
Great suggestions, and it looks like either suggestion should work, although the output from glm may not conform to those from glim, thus some more code there perhaps. Many thanks, Tim Original message Date: Mon, 15 Nov 2004 14:28:50 -0400 (AST) From: Rolf Turner [EMAIL PROTECTED] Subject: Re: [R] glim in R? To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Tim Liao wrote: After some futile searches, I decided to ask the list to see if any of the sages out there would have an answer: I have a function I wrote a few years ago in S, which calls glim numerous times. I'd like to port it to R, but glm works differently from glim, which takes as part of its input an X design matrix. I probably could write a function to convert glim to glm, but hope this wouldn't be necessary... I doubt that you will get any joy in locating a glim() function for R. No-one would write one; that would be wheel-re- invention given the existence of glm(). The glim() function is antiquated and is or should be deprecated. The technology has moved beyond that. What you really should do is re-write your code to call glm(). If it is ***really*** necessary to pass the design matrix, you should be able to o convert that matrix to a data frame, say ``ddd'' o call glm(formula,data=ddd) o the formula would presumably be simply something like ``y ~ .'' since the predictors would simply be all of the individual columns of your data frame. I can't see this as being particularly difficult recoding. Or if you insist, you could do just create your glim() function as: glim - function(y,X,...) { X - as.data.frame(X) glm(y~.,data=X,...) } (I can't really remember the glim syntax, but ``glim (y,X,...)'' is a reasonable facsimile.) If your design matrix has a constant column you would want to strip it out before passing the matrix to you glim() function. cheers, Rolf Turner [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Barplot difficulties
On Mon, 2004-11-15 at 19:03 -0500, Heather J. Branton wrote: Hello. I am an R newbie struggling to learn and use R . I have read many portions of the R Reference Manual, as well as the FAQs. Given that I learn something new each time, I know I might be missing something obvious. But I appeal to your good nature to help me through this initial problem. I have attached a pdf file to demonstrate what I desire and have listed what my data looks like in Excel (below). Following is the data and script I developed - which does not provide what I want. My immediate goal is to create a barplot in R similar to the attached pdf chart. But I am stuck on several problems. First, I would like to have 2 labels below the barplot - one label for each bar and one for each group of bars. Second, I would like to vary color by group (instead of by bar). I assume that I need to do use some sort of syntax within the color option but have not yet figured it out. I have made two different plot attempts -- one resulting in the bars being grouped appropriately but missing the labels below the x-axis; the other giving me the individual labels but not grouped as I need. snip How about something like this: # Don't use 'sample' for the name here, as sample() is a function MyData - t(read.table(sample.dat, sep= , , header = TRUE)) # These may be closer to the PDF chart colors # You need to repeat them to color each group the same, rather # than alternating bar colors MyCols - rep(c(lightcyan,cornsilk,lavender), each = 10) # adjust the margins par(mar = c(7, 5, 6, 4)) # Now do the barplot: # Note barplot() returns the bar midpoints in 'mp' # use 'names.arg' for the individual bar names from MyData # set 'las = 2' for vertical labels # set 'ylim' to c(0, 20) for the y axis range # set 'yaxt = n' to not draw the y axis tick marks mp - barplot(MyData, beside = TRUE, col = MyCols, main = Rate by Group and Year, ylab = Rate, names.arg = rep(rownames(MyData), 3), las = 2, cex.names = 0.75, ylim = c(0,20), yaxt = n) # Now set up the y axis tick marks and labels ticks - seq(0, 20, 2) axis(2, at = ticks, las = 1, labels = formatC(ticks, format = f, digits = 1)) # Draw a box around the whole thing box() # Now draw the years. Note from ?barplot that colMeans(mp) are # the group midpoints mtext(side = 1, at = colMeans(mp), line = 3.5, text = colnames(MyData)) # Now draw the x axis label mtext(side = 1, line = 5.5, text = Test and Year) Hope that gets you what you need. You can adjust the font sizes, etc. as you require. Note that unlike Excel, the 0 (zero) columns are not dropped. :-) HTH, Marc Schwartz __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] how to obtain predicted labels for test data using kerne lpls
You need to do some extra work if you want to do classification with a regression method. One simple way to do classification with PLS is to code the classes as 0s and 1s (assuming there are only two classes) or -1s and 1s, fit the model, then threshold the prediction; e.g., those with predicted values 0.5 (in the 0/1 coding) get labeled as 0s. There's a predict() method for mvr objects, and that's what you need to use to get prediction on test set. There's one more complication: The CV done internal to mvr is optimizing the MSE (because it rightly thinks it has a regression problem), but that will almost certainly not be the thing to do for classification. You have two choices: Do your own CV, or modify code in pls.pcr to do the right CV when given classification data. You might want to look at the `gpls' package, which started out as part of BioConductor, then was made available on CRAN, but now seem to have move back to BioConductor. It treats classification problems in a more `natural' way. HTH, Andy From: Huh, Seungho Dear members, My name is Seungho Huh. I am a statistician who tries to use the Kernel PLS method in a classification problem. I am sending this email to ask you something about the kernelpls function in R (pls.pcr package). I would like to obtain the predicted Y values for test data, using the Kernel PLS method. Let's take the example in the R help: data(NIR) attach(NIR) NIR.kernelpls - mvr(Xtrain, Ytrain, 1:6, validation = CV, method=kernelPLS) How can we get the predicted Y values (Ypred) for Xtest in this case? As far as I checked, there is no parameter to specify the test data in mvr or pls. I, therefore, thought about the kernelpls function as follows: Kernelpls(Xtrain, Ytrain, ncomp = 21, Xtest) Is this the correct way of getting Ypred for Xtest? I am afraid that it says in the help of kernelpls, this function should not be called directly, but through the generic pls function with the argument method=kernel (default). I would really appreciate it if you can give some advice on this. Thanks a lot for your time. Seungho Huh, Ph.D. Research Statistician RTI International North Carolina, USA [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Re: lme, two random effects, poisson distribution
Hello all, I think that with the help of Mark Irwin, we solved the problem: We fit the model using glmmPQL and instead of using variable, 'state', we model the independent fixed-effect 'state' as I(x10); i.e. it's 0 for resting time slots and 1 for excited times slots. Here is the code: = slugs.lmedata - groupedData(y ~ I(x10) | slugs/batch, data=as.data.frame(data.slugs)) csnew - corAR1(form = ~ x | slugs/batch) res.glmm - glmmPQL(pumps ~ I(x10), random = ~1|slugs/batch, family = poisson, data=slugs.lmedata, correlation=csnew) The summary of the model looks like this: = summary(res.glmm) Linear mixed-effects model fit by maximum likelihood Data: slugs.lmedata AIC BIClogLik 1265.934 1288.157 -626.9672 Random effects: Formula: ~1 | slugs (Intercept) StdDev: 0.6959097 Formula: ~1 | batch %in% slugs (Intercept) Residual StdDev:1.138034 1.304958 Correlation Structure: AR(1) Formula: ~x | slugs/batch Parameter estimate(s): Phi -0.2820534 Variance function: Structure: fixed weights Formula: ~invwt Fixed effects: y ~ I(x 10) Value Std.Error DF t-value p-value (Intercept) -0.5004731 0.2006282 142 -2.494531 0.0138 I(x 10)TRUE 1.2553644 0.2494294 142 5.032944 0. Correlation: (Intr) I(x 10)TRUE -0.32 Standardized Within-Group Residuals: Min Q1Med Q3Max -2.0856605 -0.5439464 -0.3606277 0.1855235 5.7606962 Number of Observations: 300 Number of Groups: slugs batch %in% slugs 25 157 *** I think this is the right model. But I am interested very much in your opinions. I do not use mixed-effect modelling very often. Thank your for all your help. Martina Quoting Martina Pavlicova, PhD [EMAIL PROTECTED]: Hello, I have a dataset concerning slugs. For each slug, the number of pumps per one time slot was counted. The number of pumps follows Bi(30, p) where p is very small, thus could be approximated by Poisson dist. (# of pumps is very often = 0) The slugs were observed during 12 time slots which are correlated in time as AR(1). The time slots are divided into two categories: Resting time slots (the first 10) Excited time slots (the last 2) I used model: pumps_ti = state_t + slugs_i + error_ti slugs and error are normaly distributed pumps_ti - # of pumps for i-th animal and t-th time slot x_t - order of the time slot (x_1 = 1, ..., x_12 = 12) state_t - state_t = 0 for resting time slots (t=1,...,10) state_t = 1 for excited time slots (t=11,12) slugs_i - ith animal, where i = 1,...,25 I would like to find out if the # of pumps depends on the variable state, assuming the correlation AR(1) between x_t and slugs being a random-effect on intercept. slugs.lmedata - groupedData(pumps ~ state | slugs, data=as.data.frame(data.slugs)) cs - corAR1(form= ~ x|slugs) res1 - lme(pumps ~ state, random = ~1 | slugs, data=slugs.lmedata, cor=cs) - Now, I would like to add a complication to the model: The slugs were observed in batches: Batch_1 = {slugs_1, slugs_2, slugs_3} Batch_2 = {slugs_5, slugs_6} Batch_3 = {slugs_7, slugs_8, slugs_9, slugs_10} Batch_4 = {slugs_11} . . . Batch_12 = {slugs_24, slugs_25} Notice that there are 12 batches, and the number of slugs in each batch differ, from 1 slug to 4 slugs. I consider batch to be another random-effect on intercept. Thus I fit model: pumps_tij = state_t + slugs_i + batch_ij + error_tij Slugs, batch and error are normally distributed, but slugs and batch are not nested factors. I had fit following (however I'm not sure if that is right): slugs.lmedataB - groupedData(pumps ~ state | slugs/batch, data=as.data.frame(data.slugs)) csB - corAR1(form= ~ x|slugs/batch) res1B - lme(pumps ~ state, random = ~1 | slugs/batch, data=slugs.lmedataB, cor=csB) QUESTIONS: 1) Are my models right? Do I model the res1B model properly? 2) Until now, I have assumed that the number of pumps follow the normal distribution. However I know that the variable pumps is distributed along Poisson distribution. How can I model that? I would like to use LOG or SQRT transformation, but I don't know how. * Thank you very much for all your help. Martina Pavlicova -- Department of Biostatistics Columbia University 722 W. 168th Street, 6th floor New York, NY 10032 Phone: (212) 305-9405 Fax: (212) 305-9408 Email: [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] anova, multiple comparison
On Tue, 16 Nov 2004, Yuandan Zhang wrote: I try to used R to do one-way anova. here is the simple code f1- lm (y ~ block, data=yd) there are 8 levels of factor block, I also want produce multiple pairwise comparisons for the 8 levels of block, inlcuding mean and std err for each of the 8 lelevls. It is tidious to do pair test. I looked the manuals, find no clues. any suggest? ?TukeyHSD library(help=multcomp) Chapter 6 of MASS4, a book recommended in the FAQ, has worked examples, and its scripts are included in the VR package for R. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html