Re: [R] Princomp(), prcomp() and loadings()

2004-11-04 Thread F.Tusell
El mié, 03-11-2004 a las 17:34, Prof Brian Ripley escribió: On Wed, 3 Nov 2004, F.Tusell wrote: In comparing the results of princomp and prcomp I find: 1. The reported standard deviations are similar but about 1% from each other, which seems well above round-off error. That

Re: [R] Robust Poisson regression

2004-11-04 Thread Henric Nilsson
At 18:54 2004-11-02 -0400, you wrote: Anybody knows if there exists somewhere in R some implementation of robust Poisson regression, where robust is taken in the sense as usen in rlm(MASS). I found something in the package wle, but only for the Poisson distribution, not for regression. Take a

Re: [R] Suggested color schemes for points, not regions?

2004-11-04 Thread Martin Maechler
KevinW == Kevin Wright [EMAIL PROTECTED] on Wed, 3 Nov 2004 08:06:59 -0800 (PST) writes: KevinW I have seen a couple of posts about color schemes like those at the KevinW ColorBrewer site. Most recently: KevinW http://geography.uoregon.edu/datagraphics/color_scales.htm

[R] Finding out the number of times a loop has run

2004-11-04 Thread Kevin Wang
Hi, Suppose I have: for(i in 1:10) rnorm(10) (just a fake example, as my actual example is too long) Is it possible to get the loop to print out i each time it has run? Something like: for(i in 1:10) { print(i) rnorm(10) } will only print i after the loop is

Re: [R] Finding out the number of times a loop has run

2004-11-04 Thread Peter Dalgaard
Kevin Wang [EMAIL PROTECTED] writes: Hi, Suppose I have: for(i in 1:10) rnorm(10) (just a fake example, as my actual example is too long) Is it possible to get the loop to print out i each time it has run? Something like: for(i in 1:10) { print(i)

Re: [R] Finding out the number of times a loop has run

2004-11-04 Thread Kevin Wang
Hi, On Thu, 4 Nov 2004, Peter Dalgaard wrote: Kevin, you must have seen this on the list before! Either use flush.console() or turn off the output buffering (Windows FAQ 6.3). Whoopsssorry, I must be tiredneed another cup of coffee. Kev Ko-Kang Kevin

Re: [R] Finding out the number of times a loop has run

2004-11-04 Thread Uwe Ligges
Kevin Wang wrote: Hi, Suppose I have: for(i in 1:10) rnorm(10) (just a fake example, as my actual example is too long) Is it possible to get the loop to print out i each time it has run? Something like: for(i in 1:10) { print(i) rnorm(10) } will only print i

Re: [R] Plotting a linear model object with R 2.0 for Mac OS X

2004-11-04 Thread Uwe Ligges
Justin Manjourides wrote: I'm using R for Mac OS X Aqua GUI version 2.0 When using plot() with a linear model object, the plot of the LSR line does not appear. I get the residual plots, the Normal Q-Q plots and Cook's Differnce plot, just not the first plot with the fitted line. I just get an

[R] keep dimension of a sub matrix

2004-11-04 Thread JC Vaugeois
Hi, is there any way to keep a sub matrix dimension? exemple : i1-1; i2-1 j1-2; j2-3; ret -matrix(1,4,4)[i1:i2,j1:j2] ; dim(ret) is NULL because the submatrix single col or single row is coerce to a vector automaticaly. How can i bypass this cast : submatrix-vector ??? Thank you.

Re: [R] keep dimension of a sub matrix

2004-11-04 Thread Dimitris Rizopoulos
just use matrix(1,4,4)[i1:i2,j1:j2, drop=FALSE] Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/396887 Fax: +32/16/337015 Web:

Re: [R] keep dimension of a sub matrix

2004-11-04 Thread Eric Lecoutre
See help([) which informs you about the additional argument drop: ret -matrix(1,4,4)[i1:i2,j1:j2,drop=FALSE] ; BTW, you do not need to end lines of code with a ; ... Eric At 12:06 4/11/2004, JC Vaugeois wrote: Hi, is there any way to keep a sub matrix dimension? exemple : i1-1; i2-1 j1-2; j2-3;

Re: [R] keep dimension of a sub matrix

2004-11-04 Thread Peter Dalgaard
JC Vaugeois [EMAIL PROTECTED] writes: Hi, is there any way to keep a sub matrix dimension? exemple : i1-1; i2-1 j1-2; j2-3; ret -matrix(1,4,4)[i1:i2,j1:j2] ; dim(ret) is NULL because the submatrix single col or single row is coerce to a vector automaticaly. How can i bypass this

[R] Specifying error terms in aov and lme

2004-11-04 Thread Nathaniel Street
I need to specify error terms properly in a mixed-effects anova model. I know you can add error terms in aov using Error and can specify random factors in lme but I am not sure how these get treated. When making the calculations for fixed and random factors, are the correct error terms used

[R] sub- and superscript in plot labels

2004-11-04 Thread Gavin Simpson
Dear List, I need to add a subscript and a superscript to some of the ions in the labels on some plots. I have got to here but now I'm stuck: plot(1:10, xlab = expression(paste(nm SO[4], , mu, eq cm^{-2}, yr^{-1}))) Which gives almost what I require. No matter what I tried, however, I

[R] Labelling contour lines

2004-11-04 Thread Nathaniel Street
I am using contour to draw contour lines onto a photo (jpeg) of a leaf on a white background. I have two problems: 1) The contour gets plotted at right angles to the jpeg image. I guess this is a problem of referencing the start and end points of the image matrix but I can't see how to over

Re: [R] (no subject)-about the waring/errors in ks.test

2004-11-04 Thread Adaikalavan Ramasamy
[In future, please press reply all as there might be others in the mailing list who can help you] Without a (short) reproducible example, it would be difficult to say. BTW, I think you have mistyped the error/warning message. Does it actually say cannot compute _correct_ p-value or cannot

Re: [R] Legend placement in barplot?

2004-11-04 Thread Dan Bolser
On Wed, 3 Nov 2004, Marc Schwartz wrote: On Wed, 2004-11-03 at 09:55, Dan Bolser wrote: This has been asked before, but all the answers are hidiously complex. The legend.text=TRUE option of barplot is almost exactly what I need, except I need a legend.placement='tl' (top left)

Re: [R] sub- and superscript in plot labels

2004-11-04 Thread Prof Brian Ripley
On Thu, 4 Nov 2004, Gavin Simpson wrote: Dear List, I need to add a subscript and a superscript to some of the ions in the labels on some plots. I have got to here but now I'm stuck: plot(1:10, xlab = expression(paste(nm SO[4], , mu, eq cm^{-2}, yr^{-1}))) Which gives almost

Re: [R] sub- and superscript in plot labels

2004-11-04 Thread Gavin Simpson
Gavin Simpson wrote: Dear List, I need to add a subscript and a superscript to some of the ions in the labels on some plots. I have got to here but now I'm stuck: plot(1:10, xlab = expression(paste(nm SO[4], , mu, eq cm^{-2}, yr^{-1}))) Which gives almost what I require. No matter what I

Re: [R] Specifying error terms in aov and lme

2004-11-04 Thread Peter Dalgaard
Nathaniel Street [EMAIL PROTECTED] writes: I need to specify error terms properly in a mixed-effects anova model. I know you can add error terms in aov using Error and can specify random factors in lme but I am not sure how these get treated. When making the calculations for fixed and

Re: [R] Reading word by word in a dataset

2004-11-04 Thread John
Thanks, Tony. I got a very good idea of using flush in scan() from your reply, so that I successfully did my little job. But, my next question arises if I want to extract the list of the price items only in the 2nd column in my example. I did it the following way. Is it the right way to do? Or do

RE: [R] Reading word by word in a dataset

2004-11-04 Thread John
Dear Andy, Why does my 'read.table()' NOT work in this example? I have the error, subscript out of bounds, as you see below. My R version is 1.9.0. system(more mtx.ex.1) i1-apple 10$ New_York i2-banana 5$ London i3-strawberry 7$ Japan read.table(mtx.ex.1, colClasses=c(character,NULL,NULL),

RE: [R] sub- and superscript in plot labels

2004-11-04 Thread BXC (Bendix Carstensen)
try: plot(1:10, xlab = substitute( expression(paste(nm SO[4]^{2-x}, , mu, eq cm^{-2}, yr^{-1})), list(x=) ) ) I have no understanding of why it works, formula fidgeting usually requires use of subtitute(). Btw. I started out

[R] Sweave and transparent PDF?

2004-11-04 Thread Benno Pütz
Hello, I have run across the following problem: Creating PDF files manually by using pdf(version=1.4) I can make graphs using the new transparency feature of R2.0. If, however, I try to create the same graphs with Sweave, all transparent stuff is gone. This os likely due to the default version

Re: [R] Legend placement in barplot?

2004-11-04 Thread Dan Bolser
On Wed, 3 Nov 2004, Gabor Grothendieck wrote: Dan Bolser dmb at mrc-dunn.cam.ac.uk writes: : : This has been asked before, but all the answers are hidiously complex. : : The : : legend.text=TRUE : : option of barplot is almost exactly what I need, except I need a : : legend.placement='tl'

[R] list files ignoring the case option

2004-11-04 Thread Adaikalavan Ramasamy
Sorry if this is a question more on regular expressions. I am dealing with several files which have been badly named. For example the files are given either the extensions txt, TXT or Txt. I wish to select all those files ending with 'txt' ignoring case. Here is how I would do it in bash (Redhat

RE: [R] Reading word by word in a dataset

2004-11-04 Thread Prof Brian Ripley
On Thu, 4 Nov 2004, John wrote: Dear Andy, Why does my 'read.table()' NOT work in this example? I have the error, subscript out of bounds, as you see below. My R version is 1.9.0. ^ That is your problem. It works in the current version of R, 2.0.0. Using

Re: [R] sub- and superscript in plot labels

2004-11-04 Thread Prof Brian Ripley
On Thu, 4 Nov 2004, Gavin Simpson wrote: Prof Brian Ripley wrote: On Thu, 4 Nov 2004, Gavin Simpson wrote: Dear List, I need to add a subscript and a superscript to some of the ions in the labels on some plots. I have got to here but now I'm stuck: plot(1:10, xlab =

Re: [R] list files ignoring the case option

2004-11-04 Thread Prof Brian Ripley
On Thu, 4 Nov 2004, Adaikalavan Ramasamy wrote: Sorry if this is a question more on regular expressions. I am dealing with several files which have been badly named. For example the files are given either the extensions txt, TXT or Txt. I wish to select all those files ending with 'txt'

Re: [R] calling a var by name in another var

2004-11-04 Thread Thomas Lumley
On Thu, 4 Nov 2004, Oskar Villani wrote: Hello list, I'd like to use a variable (or a column of a data frame) by using its name as a string. E.g.: Data2003 - c(150,200,120) Data2004 - c(145,211,110) myvar1 - Data2003 myvar2 - Data2004 # now I'd like do do this total - Data2003 + Data2004 # in any

Re: [R] Compilation error on mgcv_1.1-7 on OS X (10.3)

2004-11-04 Thread Jon Egil Strand
I expect your version of R was not compiled on your own system, although you don't say (please see the posting guide). (I also presume this is a Macintosh but you could have said.) Prof Ripley, thank you for your answer. Indeed you are correct in that I was using precompiled R-2.0 on a

Re: [R] problems with seq.dates

2004-11-04 Thread Gabor Grothendieck
Ciprian_Marin at ssga.com writes: : : There seem to be a bug in the seq.dates function in the chron package for R : 2.0. Please see below: : : when the specified frequency is months, seq.dates does not return the end : of the specified interval all the time: : : seq.dates(from = 05/31/04, to

[R] highly biased PCA data?

2004-11-04 Thread Dan Bolser
Hello, supposing that I have two or three clear categories for my data, lets say pet preferece across fish, cat, dog. Lets say most people rate their preference as being mostly one of the categories. I want to do pca on the data to see three 'groups' of people, one group for fish, one for cat

RE: [R] highly biased PCA data?

2004-11-04 Thread Berton Gunter
Dan: 1) There is no guarantee that PCA will show separate groups, of course, as that is not its purpose, although it is frequently a side effect. 2) If you were to use a classification method of some sort (discriminant analysis, neural nets, SVM's, model=based classification, ...), my

Re: [R] list files ignoring the case option

2004-11-04 Thread Adaikalavan Ramasamy
Thanks to Sundar Dorai-Raj, Prof. Ripley and Berton Gunter for the solution. I think I will take Prof. Ripley's suggestion and stick with my initial solution for code readability but I am sure the regexp stuff will come handy next time. On Thu, 2004-11-04 at 15:10, Prof Brian Ripley wrote: On

RE: [R] highly biased PCA data?

2004-11-04 Thread Dan Bolser
On Thu, 4 Nov 2004, Berton Gunter wrote: Dan: 1) There is no guarantee that PCA will show separate groups, of course, as that is not its purpose, although it is frequently a side effect. 2) If you were to use a classification method of some sort (discriminant analysis, neural nets, SVM's,

[R] Recovering R Workspace

2004-11-04 Thread Karuri, Stella
Hi, I have a problem with R. My R software crashed, so that every time I restart R I get the message 'Fatal Error: Unable to restore saved data in .Rdata'. I can re-install R, is it possible to obtain the objects saved in my workspace or is it a lost cause. Thanks Stella

Re: [R] highly biased PCA data?

2004-11-04 Thread Gabor Grothendieck
Dan Bolser dmb at mrc-dunn.cam.ac.uk writes: : : Hello, supposing that I have two or three clear categories for my data, : lets say pet preferece across fish, cat, dog. Lets say most people rate : their preference as being mostly one of the categories. : : I want to do pca on the data to see

Re: [R] automation / interactivity of plots on S-PLUS

2004-11-04 Thread Uwe Ligges
Please do NOT crosspost! Please read the posting guide! This list is intended for *R* related questions. Uwe Ligges COMBES Florence wrote: Dear all, I have 2 questions maybe more for developpers, and about an S-PLUS script. I think that people from R and maybe Bioconductor could also help me. 1--

Re: [R] Labelling contour lines

2004-11-04 Thread Uwe Ligges
Nathaniel Street wrote: I am using contour to draw contour lines onto a photo (jpeg) of a leaf on a white background. I have two problems: 1) The contour gets plotted at right angles to the jpeg image. I guess you either haven't realized the ordering of the y axis or you have created the

[R] biplot drawing conc ellipses

2004-11-04 Thread T. Murlidharan Nair
Is there an option to draw concentration ellipses in biplots ? It seems really nice to summarize large number of points of each group. Cheers../ Murli __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] [ANN] a new R reference card available

2004-11-04 Thread Tom Short
The first release of a new quick reference card for R is available at: http://www.rpad.org/Rpad/R-refcard.pdf This is a four-page reference listing common R functions with short summaries. The reference card contains considerable material from Emmanuel Paradis's excellent R for Beginners

[R] decision about random effects in lme

2004-11-04 Thread Thomas Petzoldt
Hello, in an experimental field study my collegue made a design with samples on two manipulated sampling sites (site: control, treatment). Within each site she sampled 3 traps (trap) at day and night (light: light, dark) at 3 consecutive days (day). We applied lme models with abundance as

Re: [R] biplot drawing conc ellipses

2004-11-04 Thread Pierre BADY
Hi all, you can see in the library(ade4). there is a nice graphical function called #8216;s.class#8217;. Example for a principal components analysis: ?s.class data(meaudret) pca1 - dudi.pca(meaudret$mil, scan = FALSE, nf = 4) # plot row coordinates s.class(pca1$li, meaudret$plan$dat, sub =

Re: [R] Legend placement in barplot?

2004-11-04 Thread F Z
You can use locator() nested within legend() i.e. plot(YourVariable) legend(locator(1),legend=Your Legend) Once you call this command it will display Your Legend in the place where you left clicked your mouse. Beware that, as described in the documentation ...'locator' is only supported on

Re: [R] Legend placement in barplot?

2004-11-04 Thread Dan Bolser
On Fri, 5 Nov 2004, F Z wrote: You can use locator() nested within legend() i.e. plot(YourVariable) legend(locator(1),legend=Your Legend) Once you call this command it will display Your Legend in the place where you left clicked your mouse. Beware that, as described in the documentation

RE: [R] highly biased PCA data?

2004-11-04 Thread Liaw, Andy
I am no expert on this sort of matters, but that has never stopped me from tossing in my $0.02... As Gabor and Bert hinted, this is what I would try: Run randomForest on the data, using sampsize=c(10, 10, 10) and importance=TRUE, for example. Then take the few most important variables with

[R] Covariance bug in R-1.8.0

2004-11-04 Thread lederer
R-1.8.0 seems to calculate wrong covariances, when the argument of cov() is a matrix or a data frame. The following should produce a matrix of zeroes and NaNs: x - matrix(c(NA ,NA ,0.9068995 ,NA ,-0.3116229, -0.0607 ,0.7310134 ,NA ,1.738362 ,0.6276125, 0.6615581

Re: [R] Using East-european characters in R

2004-11-04 Thread Vaidotas Zemlys
Hi, On Tue, 2 Nov 2004 15:54:30 +0100, Ale iberna [EMAIL PROTECTED] wrote: Does anybody know how to produce a East-European character - c with a v-shaped hat in R (in text or plot)? I do know how to get , - s,z, with a v-shaped hat, but not this one. Thanks in advance for any