Re: [R] scatter plot with 1 standard deviation for each point
FD wrote: Hi, Could anyone give suggestions how to plot a scatter plot with 1 standard deviation for each point. To make it clearer, here is a simple example: the scatterplot is plot(X, Y), but I want to add 1 standard deviation according to the value of Z for each Y. X Y Z 1 3.51.1 . . . . . . . . . Hi FD, There are lots of ways to do this (if I understand what you want). library(plotrix) # first way plot(1,3.5) dispbars(1,3.5,1.1) # second way plotCI(1,3.5,1.1) Another version of plotCI lives in the gplots package. errbar is in the Hmisc and sfsmisc packages. plotMeans in the Rcmdr package. and probably quite a few more. Jim __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] image 256 x 920 data points too slow
Dear R gurus, I'm trying to visualize a matrix 256 x 920 using image(), but i find the display too slow (~ 1 minute –– admittedly, my iBook G4 isn't very fast). The aim is not to get a good resolution image, but rather have a quick look at the matrix. I couldn't find a way to plot a smaller set of points from my data in a sensible manner (basically, i want to decrease the resolution). Is there an easy option for this purpose in image(), or possibly the lattice equivalent? Minimal example: x-c(1:256) y-c(1:920) z-x%*%t(y) image(x,y,z) Best regards, baptiste __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Setting a pdf reader different from acroread under *nix
Under FreeBSD 6.2 I installed R 2.6.0. Trying to load e.g. vignette(zoo) R calls acroread automagically. I instead would like to use the lighter kde built-in pdf reader kGhostView- Is this possible? Vittorio __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Error in if loop
I have created a if loop as follows: name = e if (name == v) { u = 0 } else u = 1 however i am getting error : Error: unexpected 'else' in else definitely I can write in : ifelse() form, however I want to write in this way. Can anyone tell me where is my error? thanks in advance - Forgot the famous last words? Access your message archive online. Click here. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] formatting a list
Hi Jim, thanks a lot. It works, however - my other problem is that I need to transpose the original table before reading it into the list because the data come from Excel and it can't handle 7000 columns. I could read it in R transpose end write into a new tab delim file and then read it back in, but I would think that there might be a way in R to do both. Would you know about the way? Tomas jim holtman wrote: another choice is: x - scan('temp.txt', what=c(rep(list(0), 19))) On 10/20/07, Tomas Vaisar [EMAIL PROTECTED] wrote: Hi, I am new to R and need to read in a file with 19 columns and 7000 rows and make it into a list of 7000 lists with 19 items each. For a simpler case of 10 by 10 table I used x -scan(file, list(0,0,0,0,0,0,0,0,0,0)), perhaps clumsy, but it did the job. However with the large 19x7000 (which needs to be transposed) I am not sure how to go about it. Coudl somebody suggest a way? Thanks, Tomas __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Error in if loop
On 21/10/2007, stat stat [EMAIL PROTECTED] wrote: I have created a if loop as follows: name = e if (name == v) { u = 0 } else u = 1 however i am getting error : Error: unexpected 'else' in else There are 3 issues here: 1. Do you appreciate the difference between ifelse and if ? What are you actually trying to do - in this context, ifelse would usually be more sensible but as you've not said what you want to do, it is difficult to guess. 2. I don't get the same error as you. Which version of R are you using? if (name==v) + { + u=0 + } else u=1 Error: syntax error This error message makes it clear that there is a syntax problem. In fact, look at the lefthand column of characters and you should see what the problem is 3. R is interpreting your code as two separate expressions because you are using an interactive shell. Try this instead: if (name=='v') { u=1 } else { u=0 } Hope this helps. Best wishes, Mark -- Dr. Mark Wardle Specialist registrar, Neurology Cardiff, UK __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Error in if loop
Dear Mark, Thanks for this. Can you please explain me what is the difference between ifelse and if? generally if there is more than one syntax within the 'if' I use 'if' loop otherwise I use 'ifelse' loop. Is it the only difference between them? Mark Wardle [EMAIL PROTECTED] wrote: On 21/10/2007, stat stat wrote: I have created a if loop as follows: name = e if (name == v) { u = 0 } else u = 1 however i am getting error : Error: unexpected 'else' in else There are 3 issues here: 1. Do you appreciate the difference between ifelse and if ? What are you actually trying to do - in this context, ifelse would usually be more sensible but as you've not said what you want to do, it is difficult to guess. 2. I don't get the same error as you. Which version of R are you using? if (name==v) + { + u=0 + } else u=1 Error: syntax error This error message makes it clear that there is a syntax problem. In fact, look at the lefthand column of characters and you should see what the problem is 3. R is interpreting your code as two separate expressions because you are using an interactive shell. Try this instead: if (name=='v') { u=1 } else { u=0 } Hope this helps. Best wishes, Mark -- Dr. Mark Wardle Specialist registrar, Neurology Cardiff, UK thanks in advance - Forgot the famous last words? Access your message archive online. Click here. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Setting a pdf reader different from acroread under *nix
On 21 October 2007 at 09:39, Douglas Bates wrote: | On 10/21/07, [EMAIL PROTECTED] | [EMAIL PROTECTED] wrote: | Under FreeBSD 6.2 I installed R 2.6.0. | Trying to load e.g. vignette(zoo) R calls acroread automagically. | I instead would like to use the lighter kde built-in pdf reader kGhostView- | Is this possible? | | Yes. If you set an environment variable R_PDFVIEWER to the full name | of the kGhostView executable before configuring and building R. | | Alternatively you could create a file Renviron.site in the R_HOME/etc | directory that defines R_PDFVIEWER to be the full name of the | kGhostView executable (usually something like /usr/bin/kghostview). Not to beat the issue to death, but one also can i) set options(pdfviewer=kpdf) (or kghostview) in either a running R session, or your ~/.Rprofile or the global Rprofile.site ii) set the R_PDFVIEWER environment variable somewhere before R gets started; choices would be ~/.profile or /etc/profile or /etc/bash.bashrc or ~/.bashrc; adapt accordingly for your local shell. I like i) -- using ~/.Rprofile seems natural to me. YMMV. Hth, Dirk -- Three out of two people have difficulties with fractions. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] exporting text output to pdf
Hello, I am new to R and I am trying to figure out how to print text output from an operation like table() to a pdf file. Is there a simple command to do this, or do you need to work with connections at a rudimentary level? Thanks you, Jesse [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] exporting text output to pdf
Look at the xtable package and latex in the Hmisc package. On 10/21/07, Jesse D Lecy [EMAIL PROTECTED] wrote: Hello, I am new to R and I am trying to figure out how to print text output from an operation like table() to a pdf file. Is there a simple command to do this, or do you need to work with connections at a rudimentary level? Thanks you, Jesse [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] formatting a list
What is it that you want to do? The 'scan' statement give you a list of length 7000 with 19 entries each. Do you want to create a matrix that has 7000 rows by 19 columns? If so, then you just have to take the output of the 'scan' and do: x.matrix - do.call('rbind', x) # gives 7000 x 19 matrix. So I am still not sure exactly what your input is and what you want to do with it. On 10/21/07, Tomas Vaisar [EMAIL PROTECTED] wrote: Hi Jim, thanks a lot. It works, however - my other problem is that I need to transpose the original table before reading it into the list because the data come from Excel and it can't handle 7000 columns. I could read it in R transpose end write into a new tab delim file and then read it back in, but I would think that there might be a way in R to do both. Would you know about the way? Tomas jim holtman wrote: another choice is: x - scan('temp.txt', what=c(rep(list(0), 19))) On 10/20/07, Tomas Vaisar [EMAIL PROTECTED] wrote: Hi, I am new to R and need to read in a file with 19 columns and 7000 rows and make it into a list of 7000 lists with 19 items each. For a simpler case of 10 by 10 table I used x -scan(file, list(0,0,0,0,0,0,0,0,0,0)), perhaps clumsy, but it did the job. However with the large 19x7000 (which needs to be transposed) I am not sure how to go about it. Coudl somebody suggest a way? Thanks, Tomas __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] exporting text output to pdf
Gabor Grothendieck ggrothendieck at gmail.com writes: Look at the xtable package and latex in the Hmisc package. On 10/21/07, Jesse D Lecy jdlecy at maxwell.syr.edu wrote: .. I am new to R and I am trying to figure out how to print text output from an operation like table() to a pdf file. Is there a simple command to do this, or do you need to work with connections at a rudimentary level? ... or, as a lightweight solution, use function textplot in package gplots Dieter __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] image 256 x 920 data points too slow
Thanks, it works nicely. In the meantime, I came across a similar approach taken in the documentation of ggplot2, using a small sample of the diamonds data. Thanks all again, baptiste On 21 Oct 2007, at 12:25, Katharine Mullen wrote: I'm not aware of any existing function that does what you want, but you could easily write a function to sample from x, y, z, and then pass the sampled values to image. e.g., sam - function(sx,sy,x,y,z){ xind-seq(1,length(x),by=sx) yind-seq(1,length(y),by=sy) samplex-x[xind] sampley-y[yind] samplez-z[xind,yind] list(x=samplex,y=sampley,z=samplez) } newval-sam(sx=13.3,sy=15,x=x,y=y,z=z) image(newval$x,newval$y,newval$z) On Sun, 21 Oct 2007, [ISO-8859-1] baptiste Auguié wrote: Dear R gurus, I'm trying to visualize a matrix 256 x 920 using image(), but i find the display too slow (~ 1 minute –– admittedly, my iBook G4 isn't very fast). The aim is not to get a good resolution image, but rather have a quick look at the matrix. I couldn't find a way to plot a smaller set of points from my data in a sensible manner (basically, i want to decrease the resolution). Is there an easy option for this purpose in image(), or possibly the lattice equivalent? Minimal example: x-c(1:256) y-c(1:920) z-x%*%t(y) image(x,y,z) Best regards, baptiste __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting- guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help installing Rstem package
Hi to all, Hi have a dificult installing the Rstem package from Duncan Lang ( http://www.omegahat.org/Rstem/). I use 2.6.0 R version, and 0.2-3 from the tm package. I can't get a correct instalation of this packages and I tryed some ways to pass this problem but with no sucess. Anyone can help me? I try some insues in this forum like: install.packages(Rstem, repos = http://www.omegahat.org/R;) Warning message: package 'Rstem' is not available ... AND... install.packages(Rstem, repos = http://www.omegahat.org/R;, type=source) trying URL 'http://www.omegahat.org/R/src/contrib/Rstem_0.3-1.tar.gz' Content type 'application/x-gzip' length 606408 bytes (592 Kb) opened URL downloaded 592 Kb 'perl' nÆo reconhecido como um comando interno ou externo, programa operacional ou ficheiro batch. The downloaded packages are in C:\Documents and Settings\Milheiros\Definições locais\Temp\RtmpigDbEc\downloaded_packages Warning message: In install.packages(Rstem, repos = http://www.omegahat.org/R;, : installation of package 'Rstem' had non-zero exit status Thanks in advance!! Regars, Filipe Almeida [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Help installing Rstem package
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Filipe Almeida wrote: Hi to all, Hi have a dificult installing the Rstem package from Duncan Lang ( http://www.omegahat.org/Rstem/). I use 2.6.0 R version, and 0.2-3 from the tm package. I can't get a It is helpful to tell us that you are on Windows. correct instalation of this packages and I tryed some ways to pass this problem but with no sucess. Anyone can help me? I try some insues in this forum like: install.packages(Rstem, repos = http://www.omegahat.org/R;) Warning message: package 'Rstem' is not available You can try it again as I just put a binary version of the package for R-2.6.0 on the repository. ... AND... install.packages(Rstem, repos = http://www.omegahat.org/R;, type=source) trying URL 'http://www.omegahat.org/R/src/contrib/Rstem_0.3-1.tar.gz' Content type 'application/x-gzip' length 606408 bytes (592 Kb) opened URL downloaded 592 Kb To build the package from source, you need to install some supporting tools such as a C compiler and Perl. These are easily downloaded thanks to Duncan Murdoch's packaging of them. But using the new binary for this package, you won't need these. 'perl' nÆo ‚ reconhecido como um comando interno ou externo, programa operacional ou ficheiro batch. The downloaded packages are in C:\Documents and Settings\Milheiros\Definições locais\Temp\RtmpigDbEc\downloaded_packages Warning message: In install.packages(Rstem, repos = http://www.omegahat.org/R;, : installation of package 'Rstem' had non-zero exit status Thanks in advance!! Regars, Filipe Almeida [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHG6GF9p/Jzwa2QP4RAv0tAJ9RAtqJ0SpIqfQiBZgjgFbCOHLwiQCeI48b dlRWVqYr+l+qcIoyNC61BWE= =a4bB -END PGP SIGNATURE- __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Help installing Rstem package
You are using WIndows (unstated). There is a binary available, and using 1) Packages | Select repositories select Omegahat 2) Packages | Install packages select Rstem works for me. On Sun, 21 Oct 2007, Filipe Almeida wrote: Hi to all, Hi have a dificult installing the Rstem package from Duncan Lang ( http://www.omegahat.org/Rstem/). I use 2.6.0 R version, and 0.2-3 from the tm package. I can't get a correct instalation of this packages and I tryed some ways to pass this problem but with no sucess. Anyone can help me? I try some insues in this forum like: install.packages(Rstem, repos = http://www.omegahat.org/R;) Warning message: package 'Rstem' is not available ... AND... install.packages(Rstem, repos = http://www.omegahat.org/R;, type=source) trying URL 'http://www.omegahat.org/R/src/contrib/Rstem_0.3-1.tar.gz' Content type 'application/x-gzip' length 606408 bytes (592 Kb) opened URL downloaded 592 Kb 'perl' nÆo reconhecido como um comando interno ou externo, programa operacional ou ficheiro batch. The downloaded packages are in C:\Documents and Settings\Milheiros\Definições locais\Temp\RtmpigDbEc\downloaded_packages Warning message: In install.packages(Rstem, repos = http://www.omegahat.org/R;, : installation of package 'Rstem' had non-zero exit status Please read the 'R Installation and Administration' manual and install the tools that it suggests. Thanks in advance!! Regars, Filipe Almeida [[alternative HTML version deleted]] -- 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@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Error in if loop
No. Think of if only as a means to control program flow. Use ifelse to use conditional logic on each item of a vector Best wishes, Mark On 21/10/2007, stat stat [EMAIL PROTECTED] wrote: Dear Mark, Thanks for this. Can you please explain me what is the difference between ifelse and if? generally if there is more than one syntax within the 'if' I use 'if' loop otherwise I use 'ifelse' loop. Is it the only difference between them? Mark Wardle [EMAIL PROTECTED] wrote: On 21/10/2007, stat stat wrote: I have created a if loop as follows: name = e if (name == v) { u = 0 } else u = 1 however i am getting error : Error: unexpected 'else' in else There are 3 issues here: 1. Do you appreciate the difference between ifelse and if ? What are you actually trying to do - in this context, ifelse would usually be more sensible but as you've not said what you want to do, it is difficult to guess. 2. I don't get the same error as you. Which version of R are you using? if (name==v) + { + u=0 + } else u=1 Error: syntax error This error message makes it clear that there is a syntax problem. In fact, look at the lefthand column of characters and you should see what the problem is 3. R is interpreting your code as two separate expressions because you are using an interactive shell. Try this instead: if (name=='v') { u=1 } else { u=0 } Hope this helps. Best wishes, Mark -- Dr. Mark Wardle Specialist registrar, Neurology Cardiff, UK thanks in advance Forgot the famous last words? Access your message archive online. Click here. __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ -- Dr. Mark Wardle Specialist registrar, Neurology Cardiff, UK __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] formatting a list
The data I have is tab delimited file with 7000 lines of 19 values each (representing 7000 permutations on 19 variables). I want to get it into the ROCR package which expects the data to be in lists - single list of 19 values for each permutation, e.g. list of 7000 lists of 19 values each. I hope this is little clearer. Tomas jim holtman wrote: What is it that you want to do? The 'scan' statement give you a list of length 7000 with 19 entries each. Do you want to create a matrix that has 7000 rows by 19 columns? If so, then you just have to take the output of the 'scan' and do: x.matrix - do.call('rbind', x) # gives 7000 x 19 matrix. So I am still not sure exactly what your input is and what you want to do with it. On 10/21/07, Tomas Vaisar [EMAIL PROTECTED] wrote: Hi Jim, thanks a lot. It works, however - my other problem is that I need to transpose the original table before reading it into the list because the data come from Excel and it can't handle 7000 columns. I could read it in R transpose end write into a new tab delim file and then read it back in, but I would think that there might be a way in R to do both. Would you know about the way? Tomas jim holtman wrote: another choice is: x - scan('temp.txt', what=c(rep(list(0), 19))) On 10/20/07, Tomas Vaisar [EMAIL PROTECTED] wrote: Hi, I am new to R and need to read in a file with 19 columns and 7000 rows and make it into a list of 7000 lists with 19 items each. For a simpler case of 10 by 10 table I used x -scan(file, list(0,0,0,0,0,0,0,0,0,0)), perhaps clumsy, but it did the job. However with the large 19x7000 (which needs to be transposed) I am not sure how to go about it. Coudl somebody suggest a way? Thanks, Tomas __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] formatting a list
That is what I thought and that is the format that the 'scan' approach should provide. I was just confused when you said that you were going to have to transpose it, write it and then read it back in for some reason. I understand that Excel can not handle 7000 columns, but was wondering where that came into play. On 10/21/07, Tomas Vaisar [EMAIL PROTECTED] wrote: The data I have is tab delimited file with 7000 lines of 19 values each (representing 7000 permutations on 19 variables). I want to get it into the ROCR package which expects the data to be in lists - single list of 19 values for each permutation, e.g. list of 7000 lists of 19 values each. I hope this is little clearer. Tomas jim holtman wrote: What is it that you want to do? The 'scan' statement give you a list of length 7000 with 19 entries each. Do you want to create a matrix that has 7000 rows by 19 columns? If so, then you just have to take the output of the 'scan' and do: x.matrix - do.call('rbind', x) # gives 7000 x 19 matrix. So I am still not sure exactly what your input is and what you want to do with it. On 10/21/07, Tomas Vaisar [EMAIL PROTECTED] wrote: Hi Jim, thanks a lot. It works, however - my other problem is that I need to transpose the original table before reading it into the list because the data come from Excel and it can't handle 7000 columns. I could read it in R transpose end write into a new tab delim file and then read it back in, but I would think that there might be a way in R to do both. Would you know about the way? Tomas jim holtman wrote: another choice is: x - scan('temp.txt', what=c(rep(list(0), 19))) On 10/20/07, Tomas Vaisar [EMAIL PROTECTED] wrote: Hi, I am new to R and need to read in a file with 19 columns and 7000 rows and make it into a list of 7000 lists with 19 items each. For a simpler case of 10 by 10 table I used x -scan(file, list(0,0,0,0,0,0,0,0,0,0)), perhaps clumsy, but it did the job. However with the large 19x7000 (which needs to be transposed) I am not sure how to go about it. Coudl somebody suggest a way? Thanks, Tomas __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] [R-pkgs] ggplot2 - version 0.5.6
ggplot2 === ggplot2 is a plotting system for R, based on the grammar of graphics, which tries to take the good parts of base and lattice graphics and avoid bad parts. It takes care of many of the fiddly details that make plotting a hassle (like drawing legends) as well as providing a powerful model of graphics that makes it easy to produce complex multi-layered graphics. Find out more at http://had.co.nz/ggplot2, and check out the over 500 examples of ggplot in use. Changes in version 0.5.6 Improved error messages and other notifications: * all geoms and position adjustments should now give an informative error message when required aesthetics are missing * better error messages if data not a data frame, or mapping not created by aes or aes_string * better errors for qplot when variables missing or data invalid * better error if somehow you are missing necessary scales * stat_bin informs you of the default choice of binwidth * stat_smooth gives helpful error messages for common problems * printing a geom now displays the data set that it uses (if not the default) Other improvements: * colour and fill legends now surround by background plot colour * can now draw arrow heads with geom_segment, and have added an example demonstrating drawing a vector field * density plots should always include 0 on y axis * default boxplot outlier changed colour to black * stat_smooth supports categorical variables a little better * implemented hash methods for all ggplot objects. This is the first step in making it easier for me to compare all examples between versions for quality control purposes New data: * seals, contributed by David Brillinger and Charlotte Wickham, used for vector field example Bug fixes: * geoms hline, vline and abline now all work correctly when a grouping variable is used * block histograms (where individuals are identifiable) now work correctly * all ggplot objects should now print properly from the command line * fixed bug in geom_path when only 1 point * segments geom now works correctly for more coordinate systems * order variables in scatterplot matrix by order of variables in data.frame * geom_density deals with missing values correctly when displaying scaled densities * fixed bug in calculating categorical ranges * fixed bug in drawing error bars Subtractions * now relies on R 2.6 * removed grid.gedit and grid.gremove, and code replaced by grid.ls -- http://had.co.nz/ ___ R-packages mailing list [EMAIL PROTECTED] https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Sweave Xtable row names
Hi, How do one avoid rownames when xtable is used to make tables for Latex. = MSe - 0.12 MSa - 0.15 MSap - 0.13 MSp - 0.14 k - 5 n - 4 r - 30 EV - 5.15*sqrt(MSe) AV - 5.15*sqrt((MSa - MSap)/(n *k)) Iap - 5.15 * sqrt((MSap-MSe)/r) GRR - sqrt((EV)^2 + (AV)^2 + (Iap)^2) PV - 5.15 * sqrt((MSp -MSap)/(k * r)) Value - c(MSe, MSa, MSap, MSp, k, n, r, EV, AV, Iap, GRR, PV) Name - c(MSe, MSa, MSap, MSp, k, n, r, EV, AV, Iap, GRR, PV) foo1 - data.frame(Name, Value) xtable(foo1) @ -- Klaus F. Østergaard, farremosen(at)gmail dot com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Sweave Xtable row names
See ?print.xtable, e.g. print(x, include.rownames = FALSE) On 10/21/07, Klaus Friis Østergaard [EMAIL PROTECTED] wrote: Hi, How do one avoid rownames when xtable is used to make tables for Latex. = MSe - 0.12 MSa - 0.15 MSap - 0.13 MSp - 0.14 k - 5 n - 4 r - 30 EV - 5.15*sqrt(MSe) AV - 5.15*sqrt((MSa - MSap)/(n *k)) Iap - 5.15 * sqrt((MSap-MSe)/r) GRR - sqrt((EV)^2 + (AV)^2 + (Iap)^2) PV - 5.15 * sqrt((MSp -MSap)/(k * r)) Value - c(MSe, MSa, MSap, MSp, k, n, r, EV, AV, Iap, GRR, PV) Name - c(MSe, MSa, MSap, MSp, k, n, r, EV, AV, Iap, GRR, PV) foo1 - data.frame(Name, Value) xtable(foo1) @ -- Klaus F. Østergaard, farremosen(at)gmail dot com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Sweave Xtable row names
2007/10/22, Gabor Grothendieck [EMAIL PROTECTED]: See ?print.xtable, e.g. print(x, include.rownames = FALSE) Thanks -- Klaus F. Østergaard, farremosen(at)gmail dot com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Test
This is test reply. Please ignore my email -- 石井一夫 日本Rubyの会 [EMAIL PROTECTED] http://officeparis.org/blog/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Format of a data frame
The goal is to smooth a scatterplot using the LOESS locally weighted regression program and a gam. There are 156 points. Thus x can have the value 1, or 2, etc., up to a maximum of x = 156. The y values are random, with a Poisson distribution, or the next thing to it. After reading in the data, I was able to generate a model, named mod, as follows: mod - gam(y~lo(x), family=poisson, x = TRUE) Next, I want to look at some values of the fitted curve: Specifically x =1, x = 2, and x = 3. Upon looking up predict.gam, I see the following: Usage predict.gam (object, newdata, type, dispension, se.fit = FALSE, na.action, terms ...) One of the arguments of the function is named newdata. I see: newdata A data frame containing the values at which predictions are requested. [snip] Only those predictors, referred to in the right side of the formula, need be present by name in newdata. I am having difficulty figuring out the format of the data frame. For example, how many columns should it have? Should it have a column for the three values of x? Probably there is a rather standard format for data frames, but I am having trouble looking it up. Perhaps some one would point me to the place in the documentation where this is discussed. Tom Jones __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Format of a data frame
If you look at the example for predict.gam, it should be clear that the data frame has a column(s) for the value(s) you want to predict for: newd - data.frame(x0=(0:30)/30,x1=(0:30)/30,x2=(0:30)/30,x3=(0:30)/30) pred - predict.gam(b,newd) head(newd) x0 x1 x2 x3 1 0. 0. 0. 0. 2 0.0333 0.0333 0.0333 0.0333 3 0.0667 0.0667 0.0667 0.0667 4 0.1000 0.1000 0.1000 0.1000 5 0.1333 0.1333 0.1333 0.1333 6 0.1667 0.1667 0.1667 0.1667 On 10/21/07, Thomas L Jones, PhD [EMAIL PROTECTED] wrote: The goal is to smooth a scatterplot using the LOESS locally weighted regression program and a gam. There are 156 points. Thus x can have the value 1, or 2, etc., up to a maximum of x = 156. The y values are random, with a Poisson distribution, or the next thing to it. After reading in the data, I was able to generate a model, named mod, as follows: mod - gam(y~lo(x), family=poisson, x = TRUE) Next, I want to look at some values of the fitted curve: Specifically x =1, x = 2, and x = 3. Upon looking up predict.gam, I see the following: Usage predict.gam (object, newdata, type, dispension, se.fit = FALSE, na.action, terms ...) One of the arguments of the function is named newdata. I see: newdata A data frame containing the values at which predictions are requested. [snip] Only those predictors, referred to in the right side of the formula, need be present by name in newdata. I am having difficulty figuring out the format of the data frame. For example, how many columns should it have? Should it have a column for the three values of x? Probably there is a rather standard format for data frames, but I am having trouble looking it up. Perhaps some one would point me to the place in the documentation where this is discussed. Tom Jones __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Newbie help: Data in an arma fit
I'd like to fit an ARMA(1,1) model to some data (Federal Reserve Bank interest rates) that looks like: ... 30JUN2006, 5.05 03JUL2006, 5.25 04JUL2006, N lt; here! 05JUL2006, 5.25 ... One problem is that holidays have that N for their data. As a test, I tried fitting ARMA(1,1) with and without the holidays deleted. In other words, I fit the above data as well as this data: ... 30JUN2006, 5.05 03JUL2006, 5.25 05JUL2006, 5.25 ... and the ARMA coefficients came out different. My question is: Should I delete all the holidays from my data file? What exactly does R do with the N values in the fit for the ARMA coefficients? As a related question, the weekends don't have entries (since the FRB is closed on all weekends). Does the fact that my data is not regularly spaced pose a problem for ARMA fitting? Many thanks! -- View this message in context: http://www.nabble.com/Newbie-help%3A-Data-in-an-arma-fit-tf4668584.html#a13336403 Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Input appreciated: R teaching idea + a way to improve R-wiki
Bill, very interesting comment. However, do you believe that by posting these tutorials on a wiki they could, even if initially faulty, be improved by the community over time? Ricardo On 10/22/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I think you need to see how things work before making any decision on this. While the principle seems OK, in a optimistic sort of way, you may be a little disappointed by the outcome. Some will likely be superb, useful, well written and accessible. Others, I suspect, will fall short of this ideal, with some falling a fair way short. That's the way students learn, after all. They should use these exercises to straighten things out in their own minds, and some of them seem to have rather twisted ideas, at least initially, even at graduate-level. Some people argue it's useful to see the learning process in action, and some books I could mention seem to be written this way - but they don't get very good reviews. I just think there is a real danger here of giving misleading and inefficient teaching materials a spurious cloak of legitimacy, even if there are disclaimers all over it. I see a need to be very cautious about this, in other words. Bill Venables CSIRO Laboratories PO Box 120, Cleveland, 4163 AUSTRALIA Office Phone (email preferred): +61 7 3826 7251 Fax (if absolutely necessary): +61 7 3826 7304 Mobile: +61 4 8819 4402 Home Phone: +61 7 3286 7700 mailto:[EMAIL PROTECTED] http://www.cmis.csiro.au/bill.venables/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matthew Keller Sent: Monday, 22 October 2007 9:45 AM To: R list Subject: [R] Input appreciated: R teaching idea + a way to improve R-wiki Hi all, I will be teaching a graduate-level course on R at CU Boulder next semester. I have a teaching idea that might also help improve the R wiki page... I wanted to know what you all thought of it and wanted to solicit some advice about doing it. During the latter part of the course, students will choose a topic of interest (e.g., hierarchical linear modeling), and show how to achieve it in R. They would present their findings to the class, and would also be responsible for writing a concise but well-written How To manual on the topic. These would be ~ 5-10 pages and would include basic background of the statistical procedure and a commented example with code in R. The goal would be for these to read like Baron Li's Notes on the use of R for psychology experiments and questionnaires. Originally I was going to post these as PDFs on my own web-page and let them grow into a compendium of how-to manuals as I teach this course over the years. However, perhaps a better idea, and one that probably benefits more people, is to have my students post their short manuals (not as PDFs but rather typed in) on the R-wiki page. Does this seem like a good idea to folks? Another question has to do with how barren the current R wiki page is... is it still being actively developed or has the community given up on it? Finally, any thoughts on where on the R-wiki site we should post our How To manuals? The tips and tricks section seems to barely be more than snippets of conversations from this list-serve (often sans the context). My guess is that the Guides section is where these should go. Your input would be most appreciated. Best, Matt -- Matthew C Keller Asst. Professor of Psychology University of Colorado at Boulder www.matthewckeller.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] strsplit
Hello R Gurus: I would like to take a character string and split at the $ sign. I thought that strsplit would do it, but here are the results: vv [1] whine$ts1 vv [1] whine$ts1 strsplit(vv,$) [[1]] [1] whine$ts1 Does anyone have any suggestions, please? Thanks, Edna Bell __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] loess coefficients output
loess() is a 'local' fitting procedure, which means that it fits a different regression at each prediction point. (In principle, for there are computational short cuts: see ?loess.control.) Since each fit is only used for a single prediction, its coeffiicients are not of interest and not made available. On Sun, 21 Oct 2007, Paul Hutson wrote: May I inquire about how to obtain the coefficients from a loess fit of multiple covariates? I have tried terms and coef, but it does not provide me with the coefficients to identify the terms of the entire regression equation. Many thanks Paul -- Paul R. Hutson, Pharm.D. Associate Professor UW School of Pharmacy 777 Highland Avenue Madison WI 53705- Tel 608.263.2496 Fax 608.265.5421 Pager 608.265.7000, p7856 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- 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@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] strsplit
Try strsplit(vv,$,fixed=TRUE) --- Edna Bell [EMAIL PROTECTED] wrote: Hello R Gurus: I would like to take a character string and split at the $ sign. I thought that strsplit would do it, but here are the results: vv [1] whine$ts1 vv [1] whine$ts1 strsplit(vv,$) [[1]] [1] whine$ts1 Does anyone have any suggestions, please? Thanks, Edna Bell __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] strsplit
On Mon, 22 Oct 2007, Edna Bell wrote: Hello R Gurus: I would like to take a character string and split at the $ sign. I thought that strsplit would do it, but here are the results: vv [1] whine$ts1 vv [1] whine$ts1 strsplit(vv,$) [[1]] [1] whine$ts1 Does anyone have any suggestions, please? Study the help page? split: character vector (or object which can be coerced to such) containing regular expression(s) (unless 'fixed = TRUE') to use for splitting. is a big hint to try vv - whine$ts1 strsplit(vv,$, fixed=TRUE) [[1]] [1] whine ts1 Thanks, Edna Bell __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. 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 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.