[R] How to compile R with command completion?

2009-09-29 Thread Peng Yu
Hi, I want to compile R with command completion. But I don't find such an option in configure. Can somebody let me know how to enable command completion in an R session? Regards, Peng __ R-help@r-project.org mailing list

Re: [R] How to compile R with command completion?

2009-09-29 Thread Peng Yu
On Tue, Sep 29, 2009 at 3:47 PM, Tobias Verbeke tobias.verb...@gmail.com wrote: Peng Yu wrote: I want to compile R with command completion. But I don't find such an option in configure. Can somebody let me know how to enable command completion in an R session? AFAIK this is not an option

Re: [R] How to compile R with command completion?

2009-09-30 Thread Peng Yu
On Tue, Sep 29, 2009 at 10:39 PM, Martin Morgan mtmor...@fhcrc.org wrote: Peng Yu wrote: On Tue, Sep 29, 2009 at 3:47 PM, Tobias Verbeke tobias.verb...@gmail.com wrote: Peng Yu wrote: I want to compile R with command completion. But I don't find such an option in configure. Can somebody let

[R] How to get duplicated items in a vector?

2009-10-01 Thread Peng Yu
Hi, x=c(rep(1,3),rep(3,2)) x [1] 1 1 1 3 3 duplicated(x) [1] FALSE TRUE TRUE FALSE TRUE As shown in the above code, 'duplicated' doesn't return 'F' for the first '1' and first '3' in 'x'. I am wondering if there is a function that can return an indicator for any element whether it appears

[R] How to show clustering results?

2009-10-03 Thread Peng Yu
Hi, I know the following code can show the dendrogram. But I also want to plot the points on a figure and have circles (or boxes) around the points in a cluster (see http://www.autonlab.org/tutorials/kmeans11.pdf for some examples). I am wondering how to do so in R. Regards, Peng x1 = c(0,0) x2

[R] Is there a recent book on Q-Q plot and data visualization in general?

2009-10-06 Thread Peng Yu
Hi, I want to look for some detailed explanation on the properties of Q-Q plot and how the properties are derived. In R, there is the following reference. Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth Brooks/Cole. Somebody also mentioned the following

Re: [R] Is there a recent book on Q-Q plot and data visualization in general?

2009-10-06 Thread Peng Yu
=booksqid=1254856526sr=8-1#reader Regards, Peng On Tue, Oct 6, 2009 at 9:50 AM, Paul Hiemstra p.hiems...@geo.uu.nl wrote: Hi Peng Yu, Chapter 13 of the following book provides a good description of the assumption done when using regression and other techniques. It also discusses the QQplot

[R] Robust estimation references

2009-10-07 Thread Peng Yu
Hi, Can somebody help recommend some good introductory textbooks on robust estimation (graduate school level)? I found this one, but the reviews on this are quite diverse.

[R] 64-bit R on mac

2009-10-08 Thread Peng Yu
Hi, My Mac OS is Leopard. I downloaded R-GUI-5496-2.9-leopard-Leopard64.dmg from http://r.research.att.com/. I run R from the image disk, but it always quit unexpectedly. What could cause the problem? Is it because that I have a 32 bit R installed already installed in the same machine. Regards,

Re: [R] How to start R in mac with the current directory as the current working directory?

2009-10-08 Thread Peng Yu
On Thu, Oct 8, 2009 at 10:57 AM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi Peng, On Oct 8, 2009, at 11:21 AM, Peng Yu wrote: Hi, I installed R on mac (see below). When I start it from a terminal by the following command, the current working directory is always '~' no matter

[R] Is there a book that summarizes different correlation methods?

2009-10-08 Thread Peng Yu
Hi, I know what the following correlation methods (pearson, kendall, spearman) are through wiki. But I'm wondering if there is a good book that discuss why these metrics are defined and when to use one coefficient versus the others. cor.test(x, y, alternative = c(two.sided, less,

[R] Why H1=1? (H's the hat matrix)

2009-10-11 Thread Peng Yu
Suppose I have the following hat matrix: H=X(X'X)^{-1}X' X is a n by p matrix, where n = p and X_{i,1} = 1 I'm wondering why H1 = 1. (Here, 1 is column vector, whose each element is the number 1) Thank you! __ R-help@r-project.org mailing list

[R] mkdir in R?

2009-10-12 Thread Peng Yu
Hi, Besides calling shell command mkdir by system(), I'm wondering if there is a buildin command in R to make a new directory. Regards, Peng __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] What is the correct way to define __hash__?

2009-10-12 Thread Peng Yu
On Mon, Oct 12, 2009 at 4:03 PM, Robert Kern robert.k...@gmail.com wrote: On 2009-10-12 15:45 PM, Peng Yu wrote: Hi, I'm wondering what is the general way to define __hash__. I could add up all the members. But I am wondering if this would cause a performance issue for certain classes

[R] S4 tutorial

2009-10-13 Thread Peng Yu
I'm looking for some tutorial on S4. I only find the following one, which is not in English. Can somebody let me know if there is any introductory material? I'm very familiar with OO and C++. If there is some material that suits my background, it will be great.

[R] How to get the definition of a class?

2009-10-13 Thread Peng Yu
Hi, ExonFeatureSet I have an object of the above class. The following document mentioned it. http://www.bioconductor.org/packages/2.5/bioc/vignettes/oligo/inst/doc/ClassesUsedInOligo.pdf But I would like to see its defintion. I'm wondering if there is a way in R to give me the definition of

[R] Understanding hclust and dendrogram

2009-10-13 Thread Peng Yu
?hclust listed several references. I'm wondering what is the best resource that explained clustering algorithms, dendrogram and various clustering algorithms that are implemented in R. Thank you! __ R-help@r-project.org mailing list

[R] Request update on A (Not So) Short Introduction to S4

2009-10-13 Thread Peng Yu
There are several '?'s on the last page of the following document. Apparently, they are not correct. Could somebody correct it? cran.r-project.org/doc/contrib/Genolini-S4tutorialV0-5en.pdf __ R-help@r-project.org mailing list

Re: [R] How to get the definition of a class?

2009-10-13 Thread Peng Yu
On Tue, Oct 13, 2009 at 9:38 PM, Martin Morgan mtmor...@fhcrc.org wrote: Peng Yu wrote: Hi, ExonFeatureSet I have an object of the above class. The following document mentioned it. http://www.bioconductor.org/packages/2.5/bioc/vignettes/oligo/inst/doc/ClassesUsedInOligo.pdf But I would

[R] reference on fisher.test()

2009-10-15 Thread Peng Yu
Can somebody point me a book on Fisher's exact test? I looked a few webpages. But the descriptions on the webpages are not very complete. Is there a book on that covers all the aspect of Fisher's exact test that is implemented in R? __

Re: [R] reference on fisher.test()

2009-10-15 Thread Peng Yu
On Thu, Oct 15, 2009 at 4:19 PM, RICHARD M. HEIBERGER r...@temple.edu wrote: On Thu, Oct 15, 2009 at 4:56 PM, Peng Yu pengyu...@gmail.com wrote: Can somebody point me a book on Fisher's exact test? I looked a few webpages. But the descriptions on the webpages are not very complete

[R] How odds ratio is computed in fisher.test()?

2009-10-16 Thread Peng Yu
I'm wondering how odds ratio is computed. I thought that it is (n11/n12)/(n21/n22), but it is not what fisher.test() computes. Could somebody let me know? n11=3 n12=1 n21=1 n22=3 n1_=n11+n12 n2_=n21+n22 n_1=n11+n21 n_2=n12+n22 x=rbind(c(n11,n12),c(n21,n22))

[R] Recommendation on a probability textbook (conditional probability)

2009-10-16 Thread Peng Yu
I need to refresh my memory on Probability Theory, especially on conditional probability. In particular, I want to solve the following two problems. Can somebody point me some good books on Probability Theory? Thank you! 1. Z=X+Y, where X and Y are independent random variables and their

Re: [R] Recommendation on a probability textbook (conditional probability)

2009-10-16 Thread Peng Yu
What's the title? On Fri, Oct 16, 2009 at 8:16 PM, Yi Du abraham...@gmail.com wrote: Hogg's book is enough for you considering your problems. Yi On Fri, Oct 16, 2009 at 7:12 PM, Peng Yu pengyu...@gmail.com wrote: I need to refresh my memory on Probability Theory, especially on conditional

Re: [R] Recommendation on a probability textbook (conditional probability)

2009-10-16 Thread Peng Yu
/probability_book/book.html -Ista On Fri, Oct 16, 2009 at 9:12 PM, Peng Yu pengyu...@gmail.com wrote: I need to refresh my memory on Probability Theory, especially on conditional probability. In particular, I want to solve the following two problems. Can somebody point me some good books on Probability

[R] looking for reference that covers convergence in distribution

2009-10-17 Thread Peng Yu
I am looking for a good probability book that describes convergence in distribution. I have looked through Introduction to Probability by Charles M. Grinstead, J. Laurie Snell, but I don't find any formal description on convergence in distribution. Could somebody recommend a good book that cover

Re: [R] looking for reference that covers convergence in distribution

2009-10-17 Thread Peng Yu
On Sat, Oct 17, 2009 at 3:28 PM, Peter Dalgaard p.dalga...@biostat.ku.dk wrote: Ben Bolker wrote: Peng Yu wrote: I am looking for a good probability book that describes convergence in distribution. I have looked through Introduction to Probability by Charles M. Grinstead, J. Laurie Snell

[R] How to plot multiple data sets with different colors (also with legend)?

2009-10-18 Thread Peng Yu
The following commands only show the data in 'y'. I'm wondering how to show the data in 'x' as well. I also want to add a legend to show that blue points corresponds to 'x' and yellow points correspond to 'y'. Could somebody let me know what the correct commands should be?

Re: [R] How to plot multiple data sets with different colors (also with legend)?

2009-10-18 Thread Peng Yu
On Sun, Oct 18, 2009 at 5:42 PM, Matthieu Dubois matth...@gmail.com wrote: Hi, the blue point is not shown simply because it is printed outside the current plot area. If you want to use the base graphics, you have to manually define the xlim and ylim of the plot. Legend is added with the

[R] Why points() is defined specially for a 1 by 2 matrix?

2009-10-18 Thread Peng Yu
x=cbind(1:4,3:6) png('one_point.png') plot(x[1:3,],xlim=c(-1,11),ylim=c(-1,11),pch=1) points(x[4,],pch=2)# this is plotted as two points #although I meant only one point legend(topleft, c(x,y),pch=c(1,2)) dev.off() The above code will produce 5 points instead of 4 points. If I want to have 4

[R] What is the difference between prcomp and princomp?

2009-10-18 Thread Peng Yu
Some webpage has described prcomp and princomp, but I am still not quite sure what the major difference between them is. Can they be used interchangeably? In help, it says 'princomp' only handles so-called R-mode PCA, that is feature extraction of variables. If a data matrix is

Re: [R] What is the difference between prcomp and princomp?

2009-10-18 Thread Peng Yu
On Sun, Oct 18, 2009 at 10:42 PM, Peng Yu pengyu...@gmail.com wrote: Some webpage has described prcomp and princomp, but I am still not quite sure what the major difference between them is. Can they be used interchangeably? In help, it says     'princomp' only handles so-called R-mode PCA

Re: [R] What is the difference between prcomp and princomp?

2009-10-19 Thread Peng Yu
On Mon, Oct 19, 2009 at 5:02 AM, Mark Difford mark_diff...@yahoo.co.uk wrote: Peng Yu wrote: Some webpage has described prcomp and princomp, but I am still not quite sure what the major difference between them is. The main difference, which could be extracted from the information given

Re: [R] What an element in loading is missing? (princomp)

2009-10-19 Thread Peng Yu
On Mon, Oct 19, 2009 at 1:58 AM, Peter Ehlers ehl...@ucalgary.ca wrote: Peng Yu wrote: Please see below that [3,1] of loadings is not printed. I am wondering what the problem is? Not trying ?loadings, perhaps?? 'loadings' gives me the same thing. pca_result$loadings Loadings: Comp

[R] population variance and sample variance

2009-10-19 Thread Peng Yu
It seems that var() computes sample variance. It is straight forward to compute population variance from sample variance. However, I feel that it is still convenient to have a function that can compute population variance. Is there a population variance function available in R? $ Rscript var.R

Re: [R] What is the difference between prcomp and princomp?

2009-10-19 Thread Peng Yu
On Mon, Oct 19, 2009 at 9:31 AM, Peng Yu pengyu...@gmail.com wrote: On Mon, Oct 19, 2009 at 5:02 AM, Mark Difford mark_diff...@yahoo.co.uk wrote: Peng Yu wrote: Some webpage has described prcomp and princomp, but I am still not quite sure what the major difference between them

[R] Is there a way to specify drop=FALSE as the global default?

2009-10-19 Thread Peng Yu
tmp - matrix(1:2) tmp tmp[,1,drop=FALSE] See the above example. Is there a way to make 'drop=FALSE' as global default, so that when I say 'tmp[,1]', R will treat it as 'tmp[,1,drop=FALSE]'? __ R-help@r-project.org mailing list

[R] underflow of fisher.test result

2009-10-20 Thread Peng Yu
fisher.test() gives a very small p-value, which is underflow on my machine. However, the log of it should not be underflow. I'm wondering if there is a way get log() of a small p-value. An approximation is acceptable in this case. Thank you!

Re: [R] underflow of fisher.test result

2009-10-20 Thread Peng Yu
On Tue, Oct 20, 2009 at 9:14 AM, Ted Harding ted.hard...@manchester.ac.uk wrote: On 20-Oct-09 13:34:49, Peng Yu wrote: fisher.test() gives a very small p-value, which is underflow on my machine. However, the log of it should not be underflow. I'm wondering if there is a way get log

[R] How to make R packages?

2009-10-22 Thread Peng Yu
I found the following document on making R packages. But it is old. I'm wondering if there is more current ones and hopefully more complete ones. http://biosun1.harvard.edu/courses/individual/bio271/lectures/L6/Rpkg.pdf __ R-help@r-project.org mailing

Re: [R] How to make R packages?

2009-10-23 Thread Peng Yu
://www.biostat.wisc.edu/~kbroman/Rintro/Rwinpack.html HTH, Jorge On Fri, Oct 23, 2009 at 12:10 AM, Peng Yu wrote: I found the following document on making R packages. But it is old. I'm wondering if there is more current ones and hopefully more complete ones. http://biosun1.harvard.edu/courses

[R] reference for mahalanobis {stats}

2009-10-23 Thread Peng Yu
The help on mahalanobis {stats} does not include any reference. I'm interested in understand why Mahalanobis is defined in its current way and how to use it. Could somebody point me a good book on this? I have looked through a few books, but they all give very light explanation on it.

Re: [R] reference for mahalanobis {stats}

2009-10-23 Thread Peng Yu
On Fri, Oct 23, 2009 at 10:59 AM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Oct 23, 2009, at 11:36 AM, Peng Yu wrote: The help on mahalanobis {stats} does not include any reference. I'm interested in understand why Mahalanobis is defined in its current way and how to use

[R] How apply a function to a list while maintaining list name?

2009-10-24 Thread Peng Yu
I use lapply to apply a function to the list 'L'. But of course, the list names in 'X' is not maintained. I'm wondering if there is a function that can maintain the list names as well as apply the function. $ Rscript lapply.R L=list(x=c('a','b'), y=c('a','b')) L $x [1] a b $y [1] a b

[R] What is the most efficient practice to develop an R package?

2009-10-26 Thread Peng Yu
I am reading Section 5 and 6 of http://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf It seems that I have to do the following two steps in order to make an R package. But when I am testing these package, these two steps will run many times, which may take a lot of time. So when I

Re: [R] What is the most efficient practice to develop an R package?

2009-10-26 Thread Peng Yu
On Mon, Oct 26, 2009 at 11:22 AM, Dirk Eddelbuettel e...@debian.org wrote: On 26 October 2009 at 07:57, Martin Morgan wrote: | Peng Yu wrote: | I am reading Section 5 and 6 of | http://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf | | It seems that I have to do

[R] Why 'validity' is not called? (S4)

2009-10-26 Thread Peng Yu
I thought that 'validity' defined in 'setClass' should be called in 'new'. Could somebody let me know why 'validity' is not called? How to make it be called? setClass( + Class='A', + representation=representation( + x='numeric' + ), + validity=function(object){ +

[R] R.oo and S4?

2009-10-26 Thread Peng Yu
There are different way to make R classes. I know R.oo and S4. I'm wondering which one is the current popular one. Which one is current recommended when make new R packages? Thank you! __ R-help@r-project.org mailing list

[R] How to browse all the functions in a package?

2009-10-26 Thread Peng Yu
'?removeClass' shows that 'removeClass' is from package 'package:methods'. Is there a command which can show me all the functions and the classed defined in a package such as 'package:methods'? __ R-help@r-project.org mailing list

Re: [R] Why 'validity' is not called? (S4)

2009-10-26 Thread Peng Yu
On Mon, Oct 26, 2009 at 1:49 PM, Martin Morgan mtmor...@fhcrc.org wrote: Peng Yu wrote: I thought that 'validity' defined in 'setClass' should be called in 'new'. Could somebody let me know why 'validity' is not called? How to make it be called? setClass( +     Class

[R] How to change a slot by a method?

2009-10-26 Thread Peng Yu
In the following code, 'multiply' doesn't multiply a...@x by 2. I'm wondering how to define a method that can change the slot of a class. $ Rscript setGeneric.R setClass( + Class='A', + representation=representation( + x='numeric' + ) + ) [1] A setMethod( +

[R] How to reduce key strokes when defining S4 classes?

2009-10-26 Thread Peng Yu
I feel tedious when I define a S4 class and the methods. For each method, I have to call both setMethod and setGeneric (or both setReplaceMethod and setGeneric). I would like a more compact grammar so that I can reduce the key strokes. I'm wondering if there is a better way available. setClass(

Re: [R] How to reduce key strokes when defining S4 classes?

2009-10-27 Thread Peng Yu
On Mon, Oct 26, 2009 at 11:56 PM, mtmor...@fhcrc.org wrote: Quoting Peng Yu pengyu...@gmail.com: I feel tedious when I define a S4 class and the methods. For each method, I have to call both setMethod and setGeneric (or both setReplaceMethod and setGeneric). I would like a more compact

[R] Why 'return' is needed in R?

2009-10-27 Thread Peng Yu
It seems that 'return' is not necessary when returning a value. If this is the case, I don't understand why 'return' is a keyword in R. Is there a case in which I have to use 'return'? f-function(x) { + x + } g-function(x) { + return(x) + } print(f(2)) [1] 2 print(g(2)) [1] 2

[R] What is the difference between anova {stats} and aov?

2009-10-27 Thread Peng Yu
There are anova {stats} and aov in R. It seems that anova takes an object returned by a model fitting function. But I don't see any examples for anova. Can somebody give me a simple example on anova? What is the difference between anova and aov? __

[R] How to quit unwanted execution immediately?

2009-10-27 Thread Peng Yu
Occasionally, I start a command (taking long time to finish) that I did not really want to start. I type 'ctrl+C' to try to quit the execution. However, R does not quit the execution of the command immediately. I'm wondering if R could response to ctrl+C immediately.

[R] How to clear colnames?

2009-10-27 Thread Peng Yu
I only see how to assign values to colnames() in help. Is there a way to remove colnames? colnames(x) - value __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Why I get this error? Error in close.connection(f) : invalid connection

2009-10-27 Thread Peng Yu
I don't understand why I can not close 'f'. This may be very simple, but I don't see why. Could somebody let me know? $ cat gzfile.csv ,V1,V2,V3,V4,V5 1,1,5,9,13,17 2,2,6,10,14,18 3,3,7,11,15,19 4,4,8,12,16,20 $ Rscript gzfile.R f = file(gzfile.csv) A = read.csv(f) A X V1 V2 V3 V4 V5 1 1 1

Re: [R] How to clear colnames?

2009-10-27 Thread Peng Yu
wrote: colnames(x) - NULL On Oct 27, 2009, at 8:09 PM, Peng Yu wrote: I only see how to assign values to colnames() in help. Is there a way to remove colnames? colnames(x) - value __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] [BioC] Is there a package similar to mogene10stprobeset.db by for Affymetrix Exon Arrays?

2009-10-27 Thread Peng Yu
-oriented platform), then you can use SQLForge in AnnotationDbi to generate an annotation package.  To do so see the SQLForge vignette which can be found in the AnnotationDbi package right here: http://www.bioconductor.org/packages/devel/bioc/html/AnnotationDbi.html  Marc Peng Yu wrote

[R] How to union the elements in a list?

2009-10-28 Thread Peng Yu
Suppose that I have a list of vectors. I want to compute the union of all the vectors in the list. I could use 'for' loop to do so. But I'm wondering what would be a better solution that does not need a 'for' loop. l=list(a=c(1,3,4), b=c(1,3,6), c=c(1,3,7), )

[R] Weird error: Error in xj[i] : invalid subscript type 'list'

2009-10-29 Thread Peng Yu
I got the error. I haven't been able to get a stand along case so that I can show it here. But could somebody give some clue on what could cause this error? Since I never defined xj[i], I don't understand where this error come from. Error in xj[i] : invalid subscript type 'list'

Re: [R] underflow of fisher.test result

2009-11-01 Thread Peng Yu
On Tue, Oct 20, 2009 at 8:14 AM, Ted Harding ted.hard...@manchester.ac.uk wrote: On 20-Oct-09 13:34:49, Peng Yu wrote: fisher.test() gives a very small p-value, which is underflow on my machine. However, the log of it should not be underflow. I'm wondering if there is a way get log

[R] reference on p.adjust()

2009-11-02 Thread Peng Yu
I'm wondering if there is a textbook that summarize the methods on adjusting p-values for multiple comparisons. Most of the references on p.adjust() are over 10 years old. I feel it would be better if somebody could recommend me a textbook on multiple hypothesis correction, so that I can quickly

[R] How to exclude certain columns by column names?

2009-11-02 Thread Peng Yu
I can exclude columns by column number using '-'. But I wondering if there is an easy way to exclude some columns by column names. x=cbind(c(1,2),c(3,4)) x [,1] [,2] [1,]13 [2,]24 colnames(x)=c('a','b') x a b [1,] 1 3 [2,] 2 4 x[,-'a'] Error in -a : invalid argument

Re: [R] reference on p.adjust()

2009-11-03 Thread Peng Yu
2009/11/3 Uwe Ligges lig...@statistik.tu-dortmund.de: Peng Yu wrote: I'm wondering if there is a textbook that summarize the methods on adjusting p-values for multiple comparisons. Most of the references on p.adjust() are over 10 years old. Being 10 years old does not mean the calculus

[R] How to load a specific variable from an RData file?

2009-11-05 Thread Peng Yu
I'm wondering if there is any option available in load() such that I can specify which variable I want to load from an RData file. I don't see such option in the help. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] How to load a specific variable from an RData file?

2009-11-05 Thread Peng Yu
On Thu, Nov 5, 2009 at 6:43 PM, Peng Yu pengyu...@gmail.com wrote: I'm wondering if there is any option available in load() such that I can specify which variable I want to load from an RData file. I don't see such option in the help. __ R-help@r

Re: [R] How to load a specific variable from an RData file?

2009-11-05 Thread Peng Yu
             x.m nfree - get('nfree', e1) ls()  # now it is in the global workspace. [1] e1    nfree How to remove the environment 'e1' after I get 'nfree'? On Thu, Nov 5, 2009 at 6:43 PM, Peng Yu pengyu...@gmail.com wrote: I'm wondering if there is any option available in load() such that I

Re: [R] Error: cannot allocate vector of size 3.4 Gb

2009-11-07 Thread Peng Yu
a fresh session of R and then tries to read in the data - how much resource do you have available when you try reading in the data? having 8GB RAM does not mean that you have 8GB when you tried the task. b On Nov 7, 2009, at 12:08 AM, Peng Yu wrote: On Fri, Nov 6, 2009 at 5:00 PM, Marc

Re: [R] Error: cannot allocate vector of size 3.4 Gb

2009-11-07 Thread Peng Yu
chip, the math is the same i mentioned before. having 8 GB, you should be able to read in 70 samples of this chip. if you can't, that's because you don't have enough resources when trying to read. best, b On Nov 7, 2009, at 10:12 AM, Peng Yu wrote: On Fri, Nov 6, 2009 at 8:19 PM, Benilton

[R] reference on contr.helmert and typo on its help page.

2009-11-08 Thread Peng Yu
I'm wondering which textbook discussed the various contrast matrices mentioned in the help page of 'contr.helmert'. Could somebody let me know? BTW, in R version 2.9.1, there is a typo on the help page of 'contr.helmert' ('cont.helmert' should be 'contr.helmert').

Re: [R] reference on contr.helmert and typo on its help page.

2009-11-08 Thread Peng Yu
On Sun, Nov 8, 2009 at 11:28 AM, Peter Dalgaard p.dalga...@biostat.ku.dk wrote: Gabor Grothendieck wrote: On Sun, Nov 8, 2009 at 11:59 AM, Peng Yu pengyu...@gmail.com wrote: On Sun, Nov 8, 2009 at 10:11 AM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 08/11/2009 11:03 AM, Peng Yu wrote

[R] ordered factor and unordered factor

2009-11-08 Thread Peng Yu
I don't understand under what situation ordered factor rather than unordered factor should be used. Could somebody give me some examples? What are the implications of order vs. unordered factors? Could somebody recommend a textbook to me? __

Re: [R] reference on contr.helmert and typo on its help page.

2009-11-08 Thread Peng Yu
: Dear Peng Yu, Perhaps you're referring to my text, Applied Linear Regression Analysis and Generalized Linear Models, since I seem to recall that you sent me a number of questions about it. See Section 9.1.2 on linear contrasts for the answer to your question. I hope this helps,  John

[R] R process gets killed spontaneously

2009-11-09 Thread Peng Yu
My R process has been killed for a few times, although the system administrator did not do so. It happened when R attempted to allocate a lot of memory. I'm wondering whether R would spontaneously kill itself if it can not allocate enough memory? __

Re: [R] reference on contr.helmert and typo on its help page.

2009-11-09 Thread Peng Yu
On Sun, Nov 8, 2009 at 7:32 PM, John Fox j...@mcmaster.ca wrote: Dear Peng, I'm tempted to try to get an entry in the fortunes package but will instead try to answer your questions directly: I can not install 'fortunes'. What are the fortunes packages about? install.packages(fortunes,

[R] What is the equivalent of column.prods() from S in R?

2009-11-09 Thread Peng Yu
Chambers' book Statistical Models in S mentioned 'column.prods()'. But I don't find it in R. I'm wondering if there is an equivalent in R? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] ordered factor and unordered factor

2009-11-09 Thread Peng Yu
Of Peng Yu Sent: Sunday, November 08, 2009 4:28 PM To: r-h...@stat.math.ethz.ch Subject: [R] ordered factor and unordered factor I don't understand under what situation ordered factor rather than unordered factor should be used. Could somebody give me some examples? What are the implications

Re: [R] R process gets killed spontaneously

2009-11-10 Thread Peng Yu
session? (screen is a very nice program that will keep your sessions alive after you log out, but it was killing off my big memory jobs for unknown reasons.) Eric - Original message - From: Peng Yu pengyu...@gmail.com To: r-h...@stat.math.ethz.ch Date: Tue, 10 Nov 2009 10:23:18

[R] What parts of 'Statistical Models in S' are not applicable to R?

2009-11-10 Thread Peng Yu
According to Amazon review, 'Statistical Models in S' is a key reference for understanding the methods implemented in several of S-PLUS' high-end statistical functions, including 'lm()', predict()', 'design()', 'aov()', 'glm()', 'gam()', 'loess()', 'tree()', 'burl.tree()', 'nls()' and 'ms()'. But

[R] How to get the names of list elements when iterating over a list?

2009-11-11 Thread Peng Yu
I need to get the names of the list elements when I iterate over a list. I'm wondering how to do so? alist=list(a=c(1,3),b=c(-1,3),c=c(-2,1)) sapply(alist,function(x){ #need to use the name of x for some subsequent process }) __

Re: [R] Is there a way to specify drop=FALSE as the global default?

2009-11-11 Thread Peng Yu
On Mon, Oct 19, 2009 at 7:57 PM, Peng Yu pengyu...@gmail.com wrote: tmp - matrix(1:2) tmp tmp[,1,drop=FALSE] See the above example. Is there a way to make 'drop=FALSE' as global default, so that when I say 'tmp[,1]', R will treat it as 'tmp[,1,drop=FALSE]'? Is there a way to set drop

Re: [R] R.oo and S4?

2009-11-11 Thread Peng Yu
model (or pure object model). proto tends to apply in user interface applications and there is some info on which other packages make use of proto on the proto home page at: http://r-proto.googlecode.com On Mon, Oct 26, 2009 at 2:47 PM, Peng Yu pengyu...@gmail.com wrote: There are different way

[R] How to show all the functions and classes that are defined in a library?

2009-11-13 Thread Peng Yu
library(some_library_name) Suppose I load a library. I'm wondering what command I should use to list all the functions, classes and variables defined in the library. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] refactoring in R

2009-11-13 Thread Peng Yu
I'm wondering if there are some tips for refactoring in R. I found the following website, which is still preliminary. Is there any program that can help me do refactoring in R? http://www.r-developer.org/projects/show/refactoring __

Re: [R] refactoring in R

2009-11-13 Thread Peng Yu
and may be you are able to state a minimally reproducible code/example with what you really need. Bests milton On Fri, Nov 13, 2009 at 9:30 PM, Peng Yu pengyu...@gmail.com wrote: I'm wondering if there are some tips for refactoring in R. I found the following website, which is still

Re: [R] refactoring in R

2009-11-14 Thread Peng Yu
at https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/statet-user HTH, Tobias P.S. The refactoring methods are available under the Source menu, and there is one [simple rename] made available as a QuickFix (Ctrl+1). Peng Yu wrote: I found the examples of how to change the code

[R] How to get the string '\'?

2009-11-15 Thread Peng Yu
I can not get the string '\'. Could somebody let me know how to get it? print('\') + + print('\\') [1] \\ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] How to get the string '\'?

2009-11-15 Thread Peng Yu
My question was from replacing a pattern by '\\'. How to replace '/' in string by '\'? string='abc/efg' gsub('/','\\',string) On Sun, Nov 15, 2009 at 5:07 PM, David Winsemius dwinsem...@comcast.net wrote: ?cat cat(\\) \ On Nov 15, 2009, at 5:30 PM, Peng Yu wrote: I can not get

Re: [R] How to get the string '\'?

2009-11-15 Thread Peng Yu
On Sun, Nov 15, 2009 at 6:05 PM, David Winsemius dwinsem...@comcast.net wrote: On Nov 15, 2009, at 6:35 PM, Peng Yu wrote: My question was from replacing a pattern by '\\'. How to replace '/' in string by '\'? string='abc/efg' gsub('/','\\',string) No,  that was most definitely _not_

[R] How to name a tag in a list or a data.frame from a string?

2009-11-15 Thread Peng Yu
Suppose I have a string variable string='some_string' Now I want to have a list, where tag is the same as the string in the variable string. I'm wondering if this is possible in R. list(tag=1:3) data.frame(tag=1:3) __ R-help@r-project.org mailing

[R] How to generate dependency file that can be used by gnu make?

2009-11-15 Thread Peng Yu
gcc has options like -MM, which can generate the dependence files for a C/C++ file that I can be used by gnu make. I'm wondering if there is a tool that can generate dependence file for an R script. For example, I have an R script test.R #test.R load('input.RData')

Re: [R] How to generate dependency file that can be used by gnu make?

2009-11-16 Thread Peng Yu
On Sun, Nov 15, 2009 at 8:45 PM, Peng Yu pengyu...@gmail.com wrote: gcc has options like -MM, which can generate the dependence files for a C/C++ file that I can be used by gnu make. I'm wondering if there is a tool that can generate dependence file for an R script. For example, I have an R

Re: [R] [Rd] How to generate dependency file that can be used by gnu make?

2009-11-17 Thread Peng Yu
to parse the R syntax to resolve your problem. On Tue, Nov 17, 2009 at 11:51 AM, Peng Yu pengyu...@gmail.com wrote: On Sun, Nov 15, 2009 at 8:45 PM, Peng Yu pengyu...@gmail.com wrote: gcc has options like -MM, which can generate the dependence files for a C/C++ file that I can be used by gnu

[R] How to choose appropriate linear model? (ANOVA)

2009-11-18 Thread Peng Yu
I'm wondering how to choose an appropriate linear model for a given problem. I have been reading Applied Linear Regression Models by John Neter, Michael H Kutner, William Wasserman and Christopher J. Nachtsheim. I'm still not clear how to choose an appropriate linear model. For multi-factor

[R] Cochran's Theorem

2009-11-18 Thread Peng Yu
I want to understand ANOVA better. But a few textbook that I have do not describe Cochran's Theorem in details. Could somebody recommend a book for me? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] How to wait for a user response in Rscript?

2009-11-19 Thread Peng Yu
:31 EDT 2009, Peng Yu pengyu...@gmail.com wrote: Hi, In 'example(barplot)' running in R, I see 'Hit Return to see next plot:', then R waits for my input. I am wondering how to wait for a user response in Rscript. Regards, Peng __ R-help@r

[R] Is there an variant of apply() that does not return anything?

2009-11-19 Thread Peng Yu
There are a few version of apply() (e.g., lapply(), sapply()). I'm wondering if there is one that does not return anything but just silently apply a function to the list argument. For example, the plot function is applied to each element in 'alist'. It is redundant to return anything from apply.

Re: [R] Is there an variant of apply() that does not return anything?

2009-11-19 Thread Peng Yu
On Thu, Nov 19, 2009 at 4:27 PM, Marc Schwartz marc_schwa...@me.com wrote: On Nov 20, 2009, at 10:21 AM, Peng Yu wrote: There are a few version of apply() (e.g., lapply(), sapply()). I'm wondering if there is one that does not return anything but just silently apply a function to the list

  1   2   3   4   >