[R] help in plotting

2007-11-23 Thread G Ilhamto
Dear list, I want to combine several plots in one graph. I did this: plot(a1); plot(a2, add=TRUE); ...plot(a5, add=TRUE) The problem is the more plot we put, the more complex the graph. Is there any way to label each line; or other way just to make sure I know which one which? Thank you for the h

Re: [R] missing values

2007-11-23 Thread Charilaos Skiadas
Here's my take on it, don't know if you cared at all about optimizing the first couple of lines: data <- data.frame(x=rep(c("A","B"),5), y=c(NA,NA,rnorm(8))) means <- with(data,ave(y, as.character(x), FUN=function(x) mean(x, na.rm=TRUE))) data$y <- ifelse(is.na(data$y),means,data$y) I tend to

[R] grDevices

2007-11-23 Thread amna khan
Dear Sir I am using R 2.6.0. In R console grDevices are not giving results like "png", "postcript", xlim, etc. I think they are not activated? I request you to please provide guidance in this regard. Regards -- AMINA SHAHZADI Department of Statistics GC University Lahore, Pakistan.

Re: [R] looking for function like rollmean()

2007-11-23 Thread Gabor Grothendieck
If you are referring to rollmean in the zoo package then na.pad = TRUE will cause the output to be the same length as the input: > library(zoo) > rollmean(zoo(1:10), 3, na.pad = TRUE) 1 2 3 4 5 6 7 8 9 10 NA 2 3 4 5 6 7 8 9 NA > rollmean(zoo(matrix(1:10, 5)), 3, na.pad = TRUE) 1

Re: [R] updating matrix from a dataframe

2007-11-23 Thread Bill.Venables
Here's one way. new.matrix <- my.matrix new.matrix[] <- with(my.df, my.value[match(my.matrix, my.id)]) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Milton Cezar Ribeiro Sent: Saturday, 24 November 2007 7:14 AM To: R-help Subject: [R] updating matrix f

Re: [R] help pleaseeeeeeeee

2007-11-23 Thread Steven McKinney
Hi Clara, I suspect your error is happening because your input data is short (9 observations). In the help for ar() for argument "order.max" it states order.maxMaximum order (or order) of model to fit. Defaults to 10*log10(N) where N is the number of observations except for method="mle

[R] looking for function like rollmean()

2007-11-23 Thread Jonas Stein
Hi, i have some data, that has 1-5 % noise. I want to smooth this data without loosing rows. rollmean() would be great, but it returns a vector of different size as the initial vector. -- kind regards, Jonas Stein <[EMAIL PROTECTED]> __ R-help@r-pr

Re: [R] multiple comparisons/tukey kramer

2007-11-23 Thread hadley wickham
> However, I don't know what exactly glht does, and the help file is > extremely terse. It offers the following options (in contrMat()): > > contrMat(n, type=c("Dunnett", "Tukey", "Sequen", "AVE", > "Changepoint", "Williams", "Marcus", > "McDermo

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-23 Thread hadley wickham
> This is a strange argument. A good package will get a good review, which > may help it to become better. A review of a weak package can point out how > it can be fixed. Reviews will not become stale, just because packages are > frequently updated by their authors (like some that could be menti

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-23 Thread John Maindonald
R as a whole could benefit from systematic attention. There may be scope for several special issues of JSS. - R overview and philosophy - R penetration and influence, in the statistics community, in machine learning, and in a variety of application areas. - R as a vehicle for fostering commun

Re: [R] problem updating packages on Ubuntu 7.10

2007-11-23 Thread Daniel Nordlund
> -Original Message- > From: Vincent Goulet [mailto:[EMAIL PROTECTED] > Sent: Friday, November 23, 2007 7:47 AM > To: Daniel Nordlund > Cc: [EMAIL PROTECTED] > Subject: Re: [R] problem updating packages on Ubuntu 7.10 > > Le jeu. 22 nov. à 14:19, Daniel Nordlund a écrit : > > > I am runni

Re: [R] help pleaseeeeeeeee

2007-11-23 Thread Steven McKinney
Hi Jim, Yes indeed, after several more attempts at executing the example, I did also eventually trip the error (on the 11th execution of res.ar<-ar(x,aic=TRUE,demean=F)): > res.ar$x.mean [1] 0 > res.ar$resid Qtr1 Qtr2 Qtr3 Qtr4 1978 -0.2052083 -0

Re: [R] multiple comparisons/tukey kramer

2007-11-23 Thread Tyler Smith
Thank you for your response. I think you have misunderstood what I'm asking, though. On 2007-11-23, Emmanuel Charpentier <[EMAIL PROTECTED]> wrote: > > - Tukey HSD will enable you to test the p(p-1)/2 pair differences one > can create with p groups ; > - Dunnett's procedure is made to compare (p-

Re: [R] updating matrix from a dataframe

2007-11-23 Thread jim holtman
Try this (not a lot of error checking -- assumes values 1-5 are in the matrix and in my.id): new.matrix <- my.df$my.value[match(my.matrix, my.df$my.id)] dim(new.matrix) <- dim(my.matrix) On Nov 23, 2007 4:13 PM, Milton Cezar Ribeiro <[EMAIL PROTECTED]> wrote: > Dear all, > > I have a matrix which

Re: [R] help pleaseeeeeeeee

2007-11-23 Thread jim holtman
When I tried it on my Windows system, I executed the script at least 4 times in succession before I got the error: > # time series > x<-ts(c(-0.2052083,-0.3764986,-0.3762448,0.3740089,0.2737568,2.8235722,- + 1.7783313,0.2728676,-0.3273164),start=c(1978,3),frequency=4,end=c(1980,3)) > > # ar funct

[R] missing values: a question

2007-11-23 Thread lamack lamack
Dear all, Is there a best way to do the following task? x = rep(c("A","B"),5)y = rnorm(10)data = data.frame(x,y)data$y[1:2] = c(NA,NA)means = ave(data$y,as.character(data$x),FUN=function(x)mean(x,na.rm=T))aux = which(is.na(data$y))d

[R] updating matrix from a dataframe

2007-11-23 Thread Milton Cezar Ribeiro
Dear all, I have a matrix which values varying from 1 to 5. I also have a table with a column that match with matrix values (=my.id). my.matrix<-matrix(sample(1:5,100,replace=T),nc=10) image(my.matrix) my.df<-data.frame(cbind(my.id=1:5,my.value=c(0.1,0.3,0.2,0.9,1))) my.df How can I create a ne

Re: [R] help pleaseeeeeeeee

2007-11-23 Thread Steven McKinney
Hi Clara, Your example works fine on my Apple Mac running R 2.6.0. You should include the output of sessionInfo() so others will know what platorm you are working on. > # time series > x<-ts(c(-0.2052083,-0.3764986,-0.3762448,0.3740089,0.2737568,2.8235722,- + 1.7783313,0.2728676,-0.3273164),sta

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-23 Thread Antony Unwin
On 23 Nov 2007, at 4:51 pm, hadley wickham wrote: > There are two common types of review. When reviewing a paper, you are > helping the author to make a better paper (and it's initiated by the > author). When reviewing a book, you are providing advise on whether > someone should make an expensiv

Re: [R] missing values

2007-11-23 Thread jim holtman
you could use this instead of the last two statements; don't know if it makes any simpler since it is just combining into one statement what you had in two: data$y[is.na(data$y)] <- means[is.na(data$y)] On Nov 23, 2007 1:49 PM, lamack lamack <[EMAIL PROTECTED]> wrote: > > > > Dear all, there is

Re: [R] ggplo2: fixed extent greater than data?

2007-11-23 Thread hadley wickham
On 11/23/07, thegeologician <[EMAIL PROTECTED]> wrote: > > Hi everyone! > > I'm digging into ggplot for some while now, I must say it's great! But - as > some others have posted before, and hadley knows very well himself - the > documentation is lacking some bits... > > So I have to pose that quest

Re: [R] multiple comparisons/tukey kramer

2007-11-23 Thread Emmanuel Charpentier
Tyler Smith a écrit : > Hi, > > I'm trying to make sense of the options for multiple comparisons > options in R. I've found the following options: [ Snip ... ] > As I understand it, there is no universal consensus as to which test > is best. There is no such thing. Each of the procedures is aim

Re: [R] PCA with NA

2007-11-23 Thread Birgit Lemcke
Thanks to all for your help. Only to complete this: The NA´s in my case mean that I have no information for this character in this species. These are not ecological data, so I have to deal somehow with the NA´s without replacing by zero. I think Thibauts help is very useful. Thanks a lot B

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-23 Thread Thaden, John J
Antony Unwin <[EMAIL PROTECTED]> and Johannes Huesing <[EMAIL PROTECTED]> discussed ways to assist navigation of the universe of R packages. AU: >>> ...R is a language and the suggestions so far seem to >>> me like dictionary suggestions, whereas maybe what John >>> is looking for is something

Re: [R] PCA with NA

2007-11-23 Thread Patrick Burns
The 'factor.model.stat' function (available in the public domain area of http://www.burns-stat.com) fits a principal components factor model to data that can have NAs. You might be able to copy what it does for your purposes. It does depend on there being some variables (columns) that have no missi

[R] missing values

2007-11-23 Thread lamack lamack
Dear all, there is a best way to do the following task? x = rep(c("A","B"),5) y = rnorm(10) data = data.frame(x,y) data$y[1:2] = c(NA,NA) means = ave(data$y,as.character(data$x),FUN=function(x)mean(x,na.rm=T)) aux = which(is.na(data$y)

[R] ggplo2: fixed extent greater than data?

2007-11-23 Thread thegeologician
Hi everyone! I'm digging into ggplot for some while now, I must say it's great! But - as some others have posted before, and hadley knows very well himself - the documentation is lacking some bits... So I have to pose that question directly: I'd like to produce a series of maps with different d

Re: [R] matrix (column-wise) multiple regression

2007-11-23 Thread Gabor Grothendieck
You can look at the components of the output using str and pick out what you want using $ and attr. idx <- 1:2 z <- lm(as.matrix(iris[idx]) ~., iris[-idx]) str(z) str(summary(z)) On Nov 23, 2007 1:10 PM, Morgan Hough <[EMAIL PROTECTED]> wrote: > Hi Gabor, > > Thanks for your reply. I have it work

Re: [R] matrix (column-wise) multiple regression

2007-11-23 Thread Morgan Hough
Hi Gabor, Thanks for your reply. I have it working now. A couple of follow-ups if I may. I have a shell script parsing the output to find the brain areas where there is a significant effect of diagnosis but its a bit of a hack. I was wondering whether there are R specific tools for parsing/sum

[R] Binary data

2007-11-23 Thread Joe Bloggs
Hi, can anyone give me some advice on dealing with binary data in R efficiently? Are there any packages with fast binary vector datatypes &/or algorithms (e.g. Hamming distance, set covering)? __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

Re: [R] anova planned comparisons/contrasts

2007-11-23 Thread Dieter Menne
Tyler Smith mail.mcgill.ca> writes: > I'm trying to figure out how anova works in R by translating the > examples in Sokal And Rohlf's (1995 3rd edition) Biometry. I've hit a > snag with planned comparisons, their box 9.4 and section 9.6. It's a > basic anova design: > how to do contrast..

[R] PCA with NA

2007-11-23 Thread Birgit Lemcke
Dear all, (Mac OS X 10.4.11, R 2.6.0) I have a quantitative dataset with a lot of Na´s in it. So many, that it is not possible to delete all rows with NA´s and also not possible, to delete all variables with NA´s. Is there a function for a principal component analysis, that can deal with so

[R] complex conjugates roots from polyroot?

2007-11-23 Thread Spencer Graves
Hi, All: Is there a simple way to detect complex conjugates in the roots returned by 'polyroot'? The obvious comparison of each root with the complex conjugate of the next sometimes produces roundoff error, and I don't know how to bound its magnitude: (tst <- polyroot(c(1, -.6, .4)))

[R] intercept in lars fit

2007-11-23 Thread Young Cho
I am trying to extract coefficients from lars fit and can't find how to get intercept. E.g. y = rnorm(10) x = matrix(runif(50),nrow=10) X = data.frame(y,x) fit1 = lars(as.matrix(X[,2:6]),as.matrix(X[,1])) fit2 = lm(y~.,data=X) Then, if I do: > predict(fit1,s=1,mode='fraction',type='coefficients')

[R] multiple comparisons/tukey kramer

2007-11-23 Thread Tyler Smith
Hi, I'm trying to make sense of the options for multiple comparisons options in R. I've found the following options: pairwise.t.test, which provides standard t-tests, with options for choosing an appropriate correction for multiple comparisons TukeyHSD, which provides the usual Tukey test glht(

[R] R2winBUGS & WinBUGS gui

2007-11-23 Thread Evan Cooch
I am trying to figure out if it is possible to run winBUGS from within R, using R2winBUGS, without having winBUGS spawn any windows (basically - 'true' batch - no GUI actions at all). The reason being I have a machine which I (and several others) ssh/telnet into, and would like to run winBUGS w

Re: [R] anova planned comparisons/contrasts

2007-11-23 Thread Tyler Smith
On 2007-11-22, Peter Alspach <[EMAIL PROTECTED]> wrote: > Tyler > > For balanced data like this you might find aov() gives an output which > is more comparable to Sokal and Rohlf (which I don't have): > >> trtCont <- C(sugars$treatment, matrix(c(-4,1,1,1,1, 0,-1,3,-1,-1), 5, > 2)) >> sugarsAov <-

Re: [R] PCA with NA

2007-11-23 Thread Thibaut Jombart
Birgit Lemcke wrote: >Dear all, >(Mac OS X 10.4.11, R 2.6.0) >I have a quantitative dataset with a lot of Na´s in it. So many, that >it is not possible to delete all rows with NA´s and also not >possible, to delete all variables with NA´s. >Is there a function for a principal component analysi

Re: [R] PCA with NA

2007-11-23 Thread ONKELINX, Thierry
Dear Birgit, You need to think about why you have that many NA's. In case of vegetation data, it is very common to have only a few species present in a site. So how would you record the abundance of a species that is absent? NA or 0 (zero)? One could argument that it needs to be NA because you

[R] Mutual information

2007-11-23 Thread Michael Kubovy
Dear R helpers, I have a data frame > summary(emPat) pairE subjpattern far-near : 18 sub1 : 37 urb:123 long-short : 18 sub2 : 37 bpb: 72 supported-unsupported: 18 sub3 : 37 prp: 67 large-small

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-23 Thread hadley wickham
On 11/23/07, hadley wickham <[EMAIL PROTECTED]> wrote: > > Above all there are lots of packages. As the software editor of the > > Journal of Statistical Software I suggested we should review R > > packages. No one has shown any enthusiasm for this suggestion, but I > > think it would help. Any

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-23 Thread hadley wickham
> Above all there are lots of packages. As the software editor of the > Journal of Statistical Software I suggested we should review R > packages. No one has shown any enthusiasm for this suggestion, but I > think it would help. Any volunteers? There are two common types of review. When review

Re: [R] problem updating packages on Ubuntu 7.10

2007-11-23 Thread Vincent Goulet
Le jeu. 22 nov. à 14:19, Daniel Nordlund a écrit : > I am running Ubuntu 7.10 and R-2.6.0, and I am having trouble > updating packages. There appears to be a problem involving > gfortran. For example, here is the output of an attempt to update > the Hmisc package. > > * Installing *source*

[R] help pleaseeeeeeeee

2007-11-23 Thread Clara Cordeiro
Dears Sirs During my computational work I encountered unexpected behavior when calling "ar" function, namely # time series x<-ts(c(-0.2052083,-0.3764986,-0.3762448,0.3740089,0.2737568,2.8235722,- 1.7783313,0.2728676,-0.3273164),start=c(1978,3),frequency=4,end=c(1980,3)) # ar function res.ar<-ar(x

Re: [R] matrix (column-wise) multiple regression

2007-11-23 Thread Gabor Grothendieck
Perhaps something like this: > idx <- 1:2 > lm(as.matrix(iris[idx]) ~., iris[-idx]) Call: lm(formula = as.matrix(iris[idx]) ~ ., data = iris[-idx]) Coefficients: Sepal.Length Sepal.Width (Intercept) 3.682982 3.048497 Petal.Length0.905946 0.154676 Pet

[R] matrix (column-wise) multiple regression

2007-11-23 Thread Morgan Hough
Hi there, I am analyzing a table of brain volume measures where each brain area (183 of them) is a column with a label and volume values. I have another table of explanatory variables (age, gender, diagnosis and IntraCranialVol) that I have been using to model the brain volume differences. I h

Re: [R] [R-wiki] Packages - a great resource, but hard to find the right one

2007-11-23 Thread Philippe Grosjean
Martin Maechler wrote: >> "JH" == Johannes Huesing <[EMAIL PROTECTED]> >> on Thu, 22 Nov 2007 22:14:57 +0100 writes: > > JH> Antony Unwin <[EMAIL PROTECTED]> [Thu, Nov 22, > JH> 2007 at 12:43:07PM CET]: > >> There have been several constructive responses to John > >> S

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-23 Thread Jonathan Baron
I'm coming late to this thread, so I don't know if anyone mentioned RSiteSearch. See http://finzi.psych.upenn.edu/R/library/utils/html/RSiteSearch.html You can also do this directly through a browser (which is how I usually do it). In the RSiteSearch() function use restrict="functions". In the w

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-23 Thread Martin Maechler
> "JH" == Johannes Huesing <[EMAIL PROTECTED]> > on Thu, 22 Nov 2007 22:14:57 +0100 writes: JH> Antony Unwin <[EMAIL PROTECTED]> [Thu, Nov 22, JH> 2007 at 12:43:07PM CET]: >> There have been several constructive responses to John >> Sorkin's comment, but none of them ar

Re: [R] Friendly way to link R - MySQL and non-(R and Mysql) users ?

2007-11-23 Thread Ptit_Bleu
I found the file tkttest.r in the directory tcltk/demo. >From this I hope I will be able to do what I want to. Again thank you for your help, Ptit Bleu. -- View this message in context: http://www.nabble.com/Friendly-way-to--link-R---MySQL-and-non-%28R-and-Mysql%29-users---tf4844081.html#a13911

Re: [R] Friendly way to link R - MySQL and non-(R and Mysql) users ?

2007-11-23 Thread Ptit_Bleu
It's me again (the last message for today - promised). The following script can be very helpful to me (from http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/editboxes.html) but I' like to enter several parameters and have a single 'ok' box to validate all the entered paramaters. Anyone can h

Re: [R] Package specific dependencies...

2007-11-23 Thread Neil Shephard
On Nov 22, 2007 4:14 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > The SystemRequirements field on the DESCRIPTION file is used > to document the system requirements. For example, the DESCRIPTION > file for Ryacas (which requires yacas) is shown below. > > Package: Ryacas > Version: 0.2-8 >

Re: [R] more outrageous plotting

2007-11-23 Thread S Ellison
Within the base package collection, see ?colorRamp and ?colorRampPalette Then or.to.blue<-colorRampPalette(c("orange","green","blue")) #green included to avoid muddy blues plot(df$X, df$Y,type="n") text(df$X, df$Y, labels=df$Z, col=or.to.blue(length(df$Z))[rank(df$Z)]) You don't need to order by

Re: [R] rbinom with computed probability

2007-11-23 Thread Ingmar Visser
I don't run into problems doing this: x=rnorm(300) z=rnorm(300) for (i in 1:300){ p[i]<-exp(-0.834+0.002*x[i]+0.023*z[i])/(1+exp(-0.834+0.002*x[i]+0.023 +z[i])); T[i]<-rbinom(1,1,p[i]) } hth, Ingmar On 23 Nov 2007, at 10:25, sigalit mangut-leiba wrote: > Hello, > I have a loop with probabilit

Re: [R] Friendly way to link R - MySQL and non-(R and Mysql) users ?

2007-11-23 Thread Ptit_Bleu
Hi Peter, In fact, just the beginning of the script is interesting to me. I'm just looking for a simple example : a single box with 3 entries and 3 labels before. Something like the example below but with a label before each entry. I know it is obvious but I don't manage to combine all the examp

[R] rbinom with computed probability

2007-11-23 Thread sigalit mangut-leiba
Hello, I have a loop with probability computed from a logistic model like this: for (i in 1:300){ p[i]<-exp(-0.834+0.002*x[i]+0.023*z[i])/(1+exp(-0.834+0.002*x[i]+0.023 +z[i])) x and z generated from normal distribution. I get 300 different probabilities And I want to generate variables from bern

Re: [R] Friendly way to link R - MySQL and non-(R and Mysql) users ?

2007-11-23 Thread Peter Dalgaard
Ptit_Bleu wrote: > Dear Gabor, > > Thanks for the links. > I found a a tcl script (see below ; from http://wiki.tcl.tk/15977) which > could be a good starting point but I'm not able to translate it into R. > Could you help me ? > In particularly, what is the command corresponding to > append_float_

Re: [R] more outrageous plotting

2007-11-23 Thread Jim Lemon
Juan Pablo Fededa wrote: > Dear Contributors: > > I have the next matrix: > > "X" "Y" "Z" > > 1 2 526 > 2 5 723 > 310 110 > 4 7 1110 > 5 9 34 > 6 8 778 > 7 1 614 > 8 4 876 > 9 6 249 > 10 3 14 > > I want

Re: [R] Friendly way to link R - MySQL and non-(R and Mysql) users ?

2007-11-23 Thread Ptit_Bleu
Dear Gabor, Thanks for the links. I found a a tcl script (see below ; from http://wiki.tcl.tk/15977) which could be a good starting point but I'm not able to translate it into R. Could you help me ? In particularly, what is the command corresponding to append_float_dialog_item ? I looked in ?tclt

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-23 Thread Antony Unwin
Johannes Hüsing wrote > > Above all there are lots of packages. As the software editor of the > > Journal of Statistical Software I suggested we should review R > > packages. > > You mean: prior to submission? No. > > No one has shown any enthusiasm for this suggestion, but I > > think it would

[R] bootstrap for nlme

2007-11-23 Thread Marc Bernard
Dear All, Is there any bootstrap function in nlme for a non linear mixed model. Either a non-parametric or parametric one. Thanks Bernard - [[alternative HTML version deleted]] _

Re: [R] Summary: Process multiple columns of data.frame

2007-11-23 Thread Gregor Gorjanc
Thompson, David (MNR ontario.ca> writes: > Thank you Jim Holtman and Mark Leeds for your help. > > Original question: > >How do I do the following more concisely? > > Bout[is.na(Bout$bd.n), 'bd.n'] <- 0 > > Bout[is.na(Bout$ht.n), 'ht.n'] <- 0 > > Bout[is.na(Bout$dbh.n), 'dbh.n'] <- 0