Re: [R] Location of Packages?

2009-09-14 Thread ivo welch
thanks, everyone. I was a bit confused. I now think that the "car" error was because the package on the cran website itself was built under 2.9.2, not because I had an old version lying around, which my package continued to use instead of a newer version that I would just have installed. I was a

Re: [R] Location of Packages?

2009-09-14 Thread cls59
iaw4 wrote: > > > PS: do I need to install the car packages under the 64-bit version, or > will > it be seen by the 64 bit version if I do a 32-bit install? Or do I need > to > do a double install? for safety, I did it under the command line version, > which I presume is still 32-bit, and th

Re: [R] Error: C stack usage is too close to the limit

2009-09-14 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Luis Ridao Cruz > Sent: Monday, September 14, 2009 6:24 AM > To: R-help > Subject: [R] Error: C stack usage is too close to the limit > > R-help, > > I 'm trying to optimize a m

Re: [R] call for input

2009-09-14 Thread Paul Hiemstra
Martin Batholdy wrote: Hi, is there a way to make a call for an input at some point of a process ..? I don't know how to describe it well ... like; please enter your first name: > and then, what is typed in should be saved into a variable. __ R

Re: [R] How can I get "predict.lm" results with manual calculations ? (a floating point problem)

2009-09-14 Thread Tony Plate
Results can be slightly different when matrix algebra routines are called. Here's your example again. When the prediction is computed directly using matrix multiplication, the result is the same as 'predict' produces (at least in this case.) set.seed(1) n <- 100 x <- rnorm(n) y <- rnorm(n)

Re: [R] Location of Packages?

2009-09-14 Thread Martin Maechler
> "iw" == ivo welch > on Mon, 14 Sep 2009 12:03:59 -0400 writes: iw> Sorry, one more: on OSX, I deleted my old 2.9.2 R.app, and installed the 64 iw> bit version of 2.9.0. I then did an "install.packages("car")" under my new iw> 2.9.0. It seems to have worked, but alas,

Re: [R] (no subject)

2009-09-14 Thread Steve Lianoglou
Hi, On Sep 14, 2009, at 10:19 AM, asie soheili wrote: I want to comput prime component of a graph. please guide mi. If you're working with graphs, you'll want to check out the igraph package: http://cran.r-project.org/web/packages/igraph/ http://igraph.sourceforge.net/ -steve -- Steve L

Re: [R] local sequence function

2009-09-14 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Henrique > Dallazuanna > Sent: Monday, September 14, 2009 9:59 AM > To: smu > Cc: r-help@r-project.org > Subject: Re: [R] local sequence function > > Try this also: > > with(rl

Re: [R] acf gives correlations > 1

2009-09-14 Thread Ted Harding
This is quite a nasty one! I've been having a look at it, and I think it would be useful to go back to first principles. Given a series u[1:N], the correlation coefficient between u[1:(N-k)] and u[(k+1):N] is c(k) = cov(u[1:(N-k)],u[(k+1):N])/sqrt(var(u[1:(N-k)])*var(u(k+1):N])) in which, in par

Re: [R] Merge data frames but prefer values in on

2009-09-14 Thread JiHO
On 2009-September-11 , at 13:55 , wrote: Maybe: do.call(rbind, lapply(with(xy <- rbind(x, y), split(xy, list(a, b), drop = TRUE)), tail, 1)) On Fri, Sep 11, 2009 at 3:45 AM, jo wrote: Thanks for the post-processing ideas. But is there any way to do that in one step? Thanks but by "in o

[R] ggplot2 legend text....a basic question

2009-09-14 Thread Julian Burgos
Hello fellow R's, I´ve been learning to use the ggplot2 library, and after a full day of work I still have a couple of basic questions. Here is an example: mydata=data.frame(x=runif(20),y=runif(20),n=runif(20)) mydata2=data.frame(x=c(0.4,0.6,0.5),y=c(0.4,0.4,0.6)) ggplot(mydata, aes(x, y)) +

Re: [R] Strange question/result about SVM

2009-09-14 Thread Ravi Varadhan
Noah, It may be just me - but how does "any" of your questions on prediction modeling relate to R? It seems to me that you have been getting a lot of "free" consulting from this forum that is supposed to be a forum for help on R-related issues. Ravi. ---

Re: [R] Eliminate cases in a subset of a dataframe

2009-09-14 Thread John Kane
At a quick glance, your code seems to be deleting columns not rows try y[-c(11,22,33), ] --- On Mon, 9/14/09, Hollix wrote: > From: Hollix > Subject: [R] Eliminate cases in a subset of a dataframe > To: r-help@r-project.org > Received: Monday, September 14, 2009, 10:57 AM > > Hi folks, >

Re: [R] Eliminate cases in a subset of a dataframe

2009-09-14 Thread James W. MacDonald
linmod2 <- update(linmod, data = subdata[-c(11,22,33),]) Hollix wrote: Hi folks, I created a subset of a dataframe (i.e., selected only men): subdata <- subset(data,data$gender==1) After a residual diagnostic of a regression analysis, I detected three outliers: linmod <- lm(y ~ x, data=subda

Re: [R] local sequence function

2009-09-14 Thread Dimitris Rizopoulos
try the following: v <- c(NA,NA,TRUE,TRUE,NA,TRUE,NA,TRUE,TRUE,TRUE) l <- as.numeric(!is.na(v)) tmp <- cumsum(l) tmp - cummax((!l) * tmp) I hope it helps. Best, Dimitris smu wrote: hey, I can not find a function for the following problem, hopefully you can help me. I have a vactor like t

Re: [R] 64-bit OSX binary for 2.9.2

2009-09-14 Thread David Winsemius
On Sep 14, 2009, at 11:59 AM, Steve Lianoglou wrote: Hi, On Sep 14, 2009, at 11:44 AM, ivo welch wrote: dear R wizards: I am looking for a binary package distribution of R 2.9.2 for OSX . Looking at http://r.research.att.com/ , there seems to be only a binary for 2.9.0 . is the 2.9.2

[R] Strange question/result about SVM

2009-09-14 Thread Noah Silverman
Hello, I have a very unusual situation with an SVM and wanted to get the group's opinion. We developed an experiment where we train the SVM with one set of data (train data) and then test with a completely independent set of data (test data). The results were VERY good. I found and error

Re: [R] Eliminate cases in a subset of a dataframe

2009-09-14 Thread Steve Lianoglou
Hi Holger, On Sep 14, 2009, at 10:57 AM, Hollix wrote: Hi folks, I created a subset of a dataframe (i.e., selected only men): subdata <- subset(data,data$gender==1) After a residual diagnostic of a regression analysis, I detected three outliers: linmod <- lm(y ~ x, data=subdata) plot(linmo

Re: [R] local sequence function

2009-09-14 Thread Henrique Dallazuanna
Try this also: with(rle(v), unlist(sapply(lengths, FUN = seq)) * v) On Mon, Sep 14, 2009 at 12:20 PM, smu wrote: > hey, > > I can not find a function for the following problem, hopefully you can > help me. > > I have a vactor like this one > > v = c(NA,NA,TRUE,TRUE,NA,TRUE,NA,TRUE,TRUE,TRUE) >

[R] loading a package .Rda file at package load time

2009-09-14 Thread Rajarshi Guha
Hi, I have seen the answer to this sometime before but I just can't find it again - pointers appreciated. I have a package that contains some data.frames saved as .Rda files in the data/ directory. When the package is loaded I would like to have them be available in the workspace (without the user

Re: [R] Function "Varcov" in Design (Ver. 2.2-0) package

2009-09-14 Thread Frank E Harrell Jr
Please read r-help messages from 2 days ago that contain a simple work-around. Frank Sascha Wolfer wrote: Hi, I'm running into an error message for the "anova"-function I never got before with the Design (Version 2.2-0) package. There seems to be a missing function "Varcov", please check m

Re: [R] call for input

2009-09-14 Thread Steve Lianoglou
Hi, On Sep 14, 2009, at 11:48 AM, Martin Batholdy wrote: Hi, is there a way to make a call for an input at some point of a process ..? I don't know how to describe it well ... like; please enter your first name: > and then, what is typed in should be saved into a variable. See: ?re

Re: [R] Which "apply" function to use?

2009-09-14 Thread baptiste auguie
Hi, try this, rowMeans(as.data.frame(Coefs)) # or apply(as.data.frame(Coefs), 1, mean) HTH, baptiste 2009/9/14 Masca, N. > Dear All, > > I have a problem which *should* be pretty straightforward to resolve - but > I can't work out how! > > I have a list of 3 coefficient estimates for 4 diffe

Re: [R] acf gives correlations > 1

2009-09-14 Thread Liviu Andronic
Hello On Mon, Sep 14, 2009 at 2:53 PM, Steve Jones wrote: > Looks like I'll have to compute the acf myself. Shame, but such is life. > Wouldn't na.omit be an option? Liviu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

Re: [R] Function "Varcov" in Design (Ver. 2.2-0) package

2009-09-14 Thread Uwe Ligges
This is an error in the most recent Hmisc update. The authors promised to deliver another update that fixes this issue. Uwe Ligges Sascha Wolfer wrote: Hi, I'm running into an error message for the "anova"-function I never got before with the Design (Version 2.2-0) package. There seems t

Re: [R] installation problem

2009-09-14 Thread cls59
wesley mathew wrote: > > Hello All > > I have some problem for installing XML_2.6-0.tar . I am working in widows > and R version is R-2.9.1 > > Unfortunately, I think there are some problems with CRAN being able to build the XML package for Windows, at least the page: http://cran.r-proje

[R] Function "Varcov" in Design (Ver. 2.2-0) package

2009-09-14 Thread Sascha Wolfer
Hi, I'm running into an error message for the "anova"-function I never got before with the Design (Version 2.2-0) package. There seems to be a missing function "Varcov", please check my function calls (it's in german but I think you get the error): > library(Design)##

[R] Location of Packages?

2009-09-14 Thread ivo welch
Sorry, one more: on OSX, I deleted my old 2.9.2 R.app, and installed the 64 bit version of 2.9.0. I then did an "install.packages("car")" under my new 2.9.0. It seems to have worked, but alas, I still get an error that package 'car' was built under R version 2.9.2 . Where exactly does R under OS

Re: [R] installation problem

2009-09-14 Thread Paul Hiemstra
wesley mathew wrote: Hello All I have some problem for installing XML_2.6-0.tar . I am working in widows and R version is R-2.9.1 >*install.packages("XML")* After selecting a CRAN mirror ** *Error :-* Warning: unable to access index for repository http://cran.pt.r-project.org/bin/windows/co

Re: [R] How to refer to the last a few rows?

2009-09-14 Thread Federman, Douglas
Try the tail() function -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peng Yu Sent: Monday, September 14, 2009 11:32 AM To: r-h...@stat.math.ethz.ch Subject: [R] How to refer to the last a few rows? Hi, x=matrix(1:60,nr=6) I can

Re: [R] installation problem

2009-09-14 Thread Uwe Ligges
wesley mathew wrote: Hello All I have some problem for installing XML_2.6-0.tar . I am working in widows and R version is R-2.9.1 >*install.packages("XML")* After selecting a CRAN mirror ** *Error :-* Warning: unable to access index for repository http://cran.pt.r-project.org/bin/windows/

Re: [R] Question about Factors

2009-09-14 Thread Don MacQueen
The suggestions from others to use lattice's xyplot, or ggplot2 are good. If you want an explicit loop you can do something like: for ( nm in unique(mydat$Name) ) { with( subset( mydf, Name==nm) , { plot(Time, Value, title=nm) readline('CR to continue ') } ) } At 5:19

Re: [R] Which "apply" function to use?

2009-09-14 Thread cls59
Masca, N. wrote: > > Dear All, > > I have a problem which *should* be pretty straightforward to resolve - but > I can't work out how! > > I have a list of 3 coefficient estimates for 4 different datasets: > > Coefs<-list(c(1,0.6,0.5),c(0.98,0.65,0.4),c(1.05,0.55,0.45),c(0.99,0.50,0.47)) > >

[R] call for input

2009-09-14 Thread Martin Batholdy
Hi, is there a way to make a call for an input at some point of a process ..? I don't know how to describe it well ... like; please enter your first name: > and then, what is typed in should be saved into a variable. __ R-help@r-project.org m

Re: [R] 64-bit OSX binary for 2.9.2

2009-09-14 Thread Steve Lianoglou
Hi, On Sep 14, 2009, at 11:44 AM, ivo welch wrote: dear R wizards: I am looking for a binary package distribution of R 2.9.2 for OSX . Looking at http://r.research.att.com/ , there seems to be only a binary for 2.9.0 . is the 2.9.2 version binary package available somewhere? (at this p

Re: [R] how to recode with an if-type statement

2009-09-14 Thread baptiste auguie
Of course if w9zd9_1, w9zd9_2, w9zd9_3 were elements of a data.frame (or even a list), you could use indexing, w9zd9 = data.frame(w9zd9_1 = 1:10, w9zd9_2 = 1:10, w9zd9_3 = -2*1:10) average = function(numbers=1, w9zd9){ if(numbers == 1L) return(w9zd9[ ,1]) # vector case fails with rowMeans rowM

[R] installation problem

2009-09-14 Thread wesley mathew
Hello All I have some problem for installing XML_2.6-0.tar . I am working in widows and R version is R-2.9.1 >*install.packages("XML")* After selecting a CRAN mirror ** *Error :-* Warning: unable to access index for repository http://cran.pt.r-project.org/bin/windows/contrib/2.9 Warning: unab

[R] ggplot2 graphing multiple lines of data

2009-09-14 Thread John Kane
Some day I may figure out how ggplot2 works. I am trying to plot 5 columns of data on a graph (similar to a simple matplot) === library(ggplot2) bmi <- structure(list(pct = 2:21, P10 = c(14.6, 14.5, 14.2, 13.9, 13.7, 13.7,

[R] 64-bit OSX binary for 2.9.2

2009-09-14 Thread ivo welch
dear R wizards: I am looking for a binary package distribution of R 2.9.2 for OSX . Looking at http://r.research.att.com/ , there seems to be only a binary for 2.9.0 . is the 2.9.2 version binary package available somewhere? (at this point, would it make sense to elevate the 64-bit version to

Re: [R] How to refer to the last a few rows?

2009-09-14 Thread baptiste auguie
Hi, tail(x,2) or x[seq(nrow(x)-1, nrow(x)), ] HTH, baptiste 2009/9/14 Peng Yu > Hi, > > x=matrix(1:60,nr=6) > > I can refer the last 2 rows by > x[5:6,] > > If I don't know the total number of rows is 6, is there a way to refer > the last 2 rows? > > Regards, > Peng > > _

Re: [R] ggplot2 graphing multiple lines of data

2009-09-14 Thread John Kane
Thanks to both of you. I knew it was something stupid. I just didn't realise it was that stupid. --- On Mon, 9/14/09, baptiste auguie wrote: > From: baptiste auguie > Subject: Re: [R] ggplot2 graphing multiple lines of data > To: "R R-help" > Received: Monday, September 14, 2009, 11:34 AM

Re: [R] ggplot2 graphing multiple lines of data

2009-09-14 Thread baptiste auguie
alternatively, use aes_string, p <- ggplot(bmm, aes_string(x="age", y="bm", colour="pp", group="pp")) p <- p + geom_line() p HTH, baptiste 2009/9/14 smu > hey, > > On Mon, Sep 14, 2009 at 07:51:42AM -0700, John Kane wrote: > > p <- ggplot(bmm, aes(x="age", y="bm", colour="pp", group="pp"))

Re: [R] how to recode with an if-type statement

2009-09-14 Thread Don MacQueen
I suppose there are a couple of ways... if (numbers==1) { distot <- } else if (numbers ==2) { distot <- } else if (numbers==3) { distot <- } else distot <- NA (letting you fill in the right hand side within each block) There's also distot <- switch(numbers, w9zd9_1, (w9zd9_1 + w9zd

Re: [R] local sequence function

2009-09-14 Thread Don MacQueen
Try this: v <- c(NA,NA,TRUE,TRUE,NA,TRUE,NA,TRUE,TRUE,TRUE) ick <-rle(v) foo <- unlist(apply(matrix(ick$lengths),1,seq)) foo[is.na(v)] <- NA foo [1] NA NA 1 2 NA 1 NA 1 2 3 -Don At 5:20 PM +0200 9/14/09, smu wrote: hey, I can not find a function for the following problem, hopefu

Re: [R] local sequence function

2009-09-14 Thread Martin Maechler
> "s" == smu > on Mon, 14 Sep 2009 17:20:27 +0200 writes: s> hey, I can not find a function for the following problem, s> hopefully you can help me. s> I have a vactor like this one s> v = c(NA,NA,TRUE,TRUE,NA,TRUE,NA,TRUE,TRUE,TRUE) s> and I would like to the

[R] How to refer to the last a few rows?

2009-09-14 Thread Peng Yu
Hi, x=matrix(1:60,nr=6) I can refer the last 2 rows by x[5:6,] If I don't know the total number of rows is 6, is there a way to refer the last 2 rows? Regards, Peng __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

Re: [R] Teaching material for children...

2009-09-14 Thread Liviu Andronic
Hello On Mon, Sep 14, 2009 at 2:17 PM, Vince Fulco wrote: > Wondering if anyone is aware of resources appropriate for home > schooled pre-teen/teen relatives? > There is http://r-tutor.com/, but it is for college students/beginners in stats. It would make sense to repost the question on r-sig-tea

Re: [R] ggplot2 graphing multiple lines of data

2009-09-14 Thread smu
hey, On Mon, Sep 14, 2009 at 07:51:42AM -0700, John Kane wrote: > p <- ggplot(bmm, aes(x="age", y="bm", colour="pp", group="pp")) > p <- p + geom_line() remove the quotes and it will work: ggplot(bmm, aes(x=age, y=bm, colour=pp, group=pp))+geom_line() regards, Stefan ___

Re: [R] Teaching material for children...

2009-09-14 Thread Vince Fulco
Dear R colleagues-- Apologies for belabouring, but if it wasn't obvious already, I was speaking specifically to R-Project resources for young adults. As I was querying the R-help list, thought that was crystal clear but I've received an offer or two of assistance of a more generic nature. Best, V

[R] local sequence function

2009-09-14 Thread smu
hey, I can not find a function for the following problem, hopefully you can help me. I have a vactor like this one v = c(NA,NA,TRUE,TRUE,NA,TRUE,NA,TRUE,TRUE,TRUE) and I would like to the TRUE values by the their "local sequence number". This means, the result should look thike this: c(NA,NA,

[R] Which "apply" function to use?

2009-09-14 Thread Masca, N.
Dear All, I have a problem which *should* be pretty straightforward to resolve - but I can't work out how! I have a list of 3 coefficient estimates for 4 different datasets: Coefs<-list(c(1,0.6,0.5),c(0.98,0.65,0.4),c(1.05,0.55,0.45),c(0.99,0.50,0.47)) All I want to do is take the sum (or mean

[R] (no subject)

2009-09-14 Thread asie soheili
I want to comput prime component of a graph. please guide mi. thanks alot [[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-proje

[R] Eliminate cases in a subset of a dataframe

2009-09-14 Thread Hollix
Hi folks, I created a subset of a dataframe (i.e., selected only men): subdata <- subset(data,data$gender==1) After a residual diagnostic of a regression analysis, I detected three outliers: linmod <- lm(y ~ x, data=subdata) plot(linmod) Say, the cases 11,22, and 33 were outliers. Here comes

[R] how to recode with an if-type statement

2009-09-14 Thread Casey Klofstad
I'm sure this is easy, but I'm having a hard time figuring out how to recode some data in R. I have a variable "numpeers" which is valued 1, 2, or 3. I also have three other variables called "w9zd9_1," "w9zd9_2," and "w9zd9_3." I want to use these variables to create a new item called "distot." S

Re: [R] Teaching material for children...

2009-09-14 Thread John Kane
http://jumpmath.org/program Looks good but no personal experience of it. --- On Mon, 9/14/09, Vince Fulco wrote: > From: Vince Fulco > Subject: [R] Teaching material for children... > To: r-help@r-project.org > Received: Monday, September 14, 2009, 9:17 AM > Wondering if anyone is aware of > r

[R] problems with reshape

2009-09-14 Thread Luca Braglia
Hello * I would like to reshape wide the following dataset: > rl <- read.dta("intermedi/rapporti_lavoro.dta") > [c("id_rl","prog","sil_pi","sil_cf","sil_dat_avv")] > dim(rl) [1] 12964 5 > object.size(rl) 1194728 bytes > head(rl) id_rl prog sil_pi sil_cf sil_dat_avv 1 638

Re: [R] Location of Packages?

2009-09-14 Thread Steve Lianoglou
Hi, On Sep 14, 2009, at 12:03 PM, ivo welch wrote: Sorry, one more: on OSX, I deleted my old 2.9.2 R.app, and installed the 64 bit version of 2.9.0. I then did an "install.packages("car")" under my new 2.9.0. It seems to have worked, but alas, I still get an error that package 'car' was

Re: [R] How do I ensure that the minimum value is always displayed on a y-axis in a plot?

2009-09-14 Thread John Kane
Try this: Assuming your vector is x: ylimits<-c(min(x)- .05,max(x)+ .05) plot(x,type="l",yaxt="n",ann=FALSE,ylim=ylimits) By the way, if you are going to supply much data, it is better practice to use dput() . Try dput(x) to see what I mean. --- On Mon, 9/14/09, Jorgy

[R] SSVS

2009-09-14 Thread cindy Guo
Hi, ALL, Is there any R/bioconductor package to do SSVS (stochastic search variable selection) for glm? Thanks, Cindy [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

Re: [R] summary of rpart-Object in tktext window?

2009-09-14 Thread Anne Skoeries
Thanks! That's it! Perfect! -- Anne Skoeries Olgastr. 54 74072 Heilbronn Phone: +49 (0)7131 - 390 33 33 Mobil: +49 (0)176 - 212 37 770 Mail: h...@anne-skoeries.de Am 14.09.2009 um 15:50 schrieb Henrique Dallazuanna: tkinsert(tex, "end", paste(capture.output(summary(fit)), collapse = "\n"))

[R] Luis Miguel Delgado Gomez/BBK está ausente d e la oficina.

2009-09-14 Thread Luis Miguel Delgado Gomez
Estaré ausente de la oficina desde el 14/09/2009 y no volveré hasta el 24/09/2009. Responderé a su mensaje cuando regrese. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] linear regression, exclude a datum

2009-09-14 Thread Steve Lianoglou
Hi, On Sep 14, 2009, at 9:47 AM, e-letter wrote: Readers, I have been reading the r book (Crawley) and tried to use the influence measures function for linear regression, as described. I have one datum that I wish to show in the graph but exclude from the regression and ab line. x y 0

Re: [R] mclustBIC version 3.3.1

2009-09-14 Thread madmax1425
Thanks! I just sent him an email. If anyone noticed any behavior change with this function version 3.3.1 please report any finding. Thanks in advance, Max Uwe Ligges-3 wrote: > > > > madmax1425 wrote: >> Hi there, >> I started getting a new error with the latest mclust package version >> 3.

Re: [R] acf gives correlations > 1

2009-09-14 Thread Steve Jones
I misunderstood what the help page was saying - I thought that the missing values were what constituted the invalid function. Clearly I was mistaken. Looks like I'll have to compute the acf myself. Shame, but such is life. Thanks for the input, everyone! Steve. Berwin A Turlach wrote: > G'day S

Re: [R] summary of rpart-Object in tktext window?

2009-09-14 Thread Henrique Dallazuanna
Try this: tkinsert(tex, "end", paste(capture.output(summary(fit)), collapse = "\n")) On Mon, Sep 14, 2009 at 10:43 AM, Anne Skoeries wrote: > Hi, > > is it possible to put a summary of an rpart-Object into a tktext-window? > > Here is what I'm trying to do: > > fit <- rpart(Kyphosis ~ Age + Numb

[R] linear regression, exclude a datum

2009-09-14 Thread e-letter
Readers, I have been reading the r book (Crawley) and tried to use the influence measures function for linear regression, as described. I have one datum that I wish to show in the graph but exclude from the regression and ab line. x y 0 5 10 9 20 10 30 19 40 4 Wit

[R] summary of rpart-Object in tktext window?

2009-09-14 Thread Anne Skoeries
Hi, is it possible to put a summary of an rpart-Object into a tktext-window? Here is what I'm trying to do: fit <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis) tt <- tktoplevel() tex <- tktext(tt) tkpack(tex) tkinsert(tex, "end", summary(fit)) But since the summary of an object is a l

[R] How do I ensure that the minimum value is always displayed on a y-axis in a plot?

2009-09-14 Thread Jorgy Porgee
Good day all, I'm trying to plot a figure and ensure that the minimum and maximum values are always displayed. However, the code below does not display the minimum value, no matter what I try. Could someone please help? Thanking you in advance, George. Code below for reproduction (apologies if

[R] Error: C stack usage is too close to the limit

2009-09-14 Thread Luis Ridao Cruz
R-help, I 'm trying to optimize a model to data using log-likelihoods but I encounter the following error message: > l= c(49.4, 57.7,64.8,70.9,78.7,86.6,88.3,91.6,99,115) > t=3:12 > fn <- function(params, l=l, t=t) { Linf <- params[1] k <- params[2]

[R] Teaching material for children...

2009-09-14 Thread Vince Fulco
Wondering if anyone is aware of resources appropriate for home schooled pre-teen/teen relatives? Before anyone suggests, a lengthy google search was unsuccessful. TIA, V. -- Vince Fulco, CFA, CAIA 612.424.5477 (universal) vful...@gmail.com A posse ad esse non valet consequentia “the possibi

[R] Announce: lme4 web application

2009-09-14 Thread Jeroen Ooms
inspired by useR! 2009, yeroon.net is a new project developing statistical web applications to make popular R packages easier available. A first version of the lme4 web interface is available at http://yeroon.net/lme4/ http://yeroon.net/lme4/ . It implements most lme4 features and some more. A s

Re: [R] Degrees of freedom etc- Fisher's

2009-09-14 Thread David Winsemius
On Sep 14, 2009, at 6:02 AM, Breach, Katherine wrote: Hi When I run a Chi squared test in R I am automatically given the chi squared value and the degrees of freedom. How do I find these values when i've used Fisher's exact test? The function fisher.test uses hypergeometric distributio

Re: [R] How to set default plotting colors by treatment?

2009-09-14 Thread David Winsemius
On Sep 14, 2009, at 8:00 AM, Paul Hiemstra wrote: I offer my sincere apologies for not reading the e-mail carefully, your example is indeed reproducible. When you stop using the 'with' function, this is I think what you would like: myplot2 = function(formula, data, ...) { plot(formula, d

[R] Rstem package not available anymore?!?

2009-09-14 Thread Sascha Wolfer
Dear List, I tried installing the Rstem package from omegahat.org using my old command install.packages("Rstem", repos = "http://www.omegahat.org/R";, type = "source") but it seems omegahat.org is down. Any word on when it will be on again (if ever)? --- Sascha A. Wolfer, M.A. Centre

Re: [R] acf gives correlations > 1

2009-09-14 Thread Duncan Murdoch
On 14/09/2009 7:44 AM, Steve Jones wrote: Apologies for the missing data. It can be downloaded from here (22Kb): http://www.squaregoldfish.co.uk/sekrett/series.csv The dataset is 97% missing values. I suspect what you're seeing is what the man page describes as follows: "If the na.action fu

[R] Analysis of a highly pseudoreplicate mixed-effects experiment

2009-09-14 Thread Matthias Gralle
Hello everybody, I have been trying for some weeks to state the correct design of my experiment as a GLM formula, and have not been able to find something appropriate in Pinheiro & Bates, so I am posting it here and hope somebody can help me. In each experimental condition, described by 1) g

[R] Degrees of freedom etc- Fisher's

2009-09-14 Thread Breach, Katherine
Hi When I run a Chi squared test in R I am automatically given the chi squared value and the degrees of freedom. How do I find these values when i've used Fisher's exact test? Cheers, Katie [[alternative HTML version deleted]] __ R-help@r-p

Re: [R] Exporting Numerous Graphs

2009-09-14 Thread Henrique Dallazuanna
Try this: library(RDCOMClient) w <- COMCreate('Word.Application') w[["Visible"]] <- TRUE w[["DisplayAlerts"]] <- FALSE doc <- w$Documents()$Add(Template="Normal", NewTemplate=FALSE, DocumentType=0) fooPasteGraphs <- function(index, ...){ win.metafile() plot(rnorm(100)) dev.off()

Re: [R] acf gives correlations > 1

2009-09-14 Thread Berwin A Turlach
G'day Steve, On Mon, 14 Sep 2009 13:44:56 +0200 Steve Jones wrote: > Apologies for the missing data. It can be downloaded from here (22Kb): > http://www.squaregoldfish.co.uk/sekrett/series.csv Well, the Details section of acf's help page states: By default, no missing values are allowed.

Re: [R] How to set default plotting colors by treatment?

2009-09-14 Thread Paul Hiemstra
I offer my sincere apologies for not reading the e-mail carefully, your example is indeed reproducible. When you stop using the 'with' function, this is I think what you would like: myplot2 = function(formula, data, ...) { plot(formula, data = data, ..., pch = 19, col = c("blue","red")[data

Re: [R] Sorting

2009-09-14 Thread Gavin Simpson
On Sun, 2009-09-13 at 14:46 +0200, Erich Neuwirth wrote: > months<-c("jan","feb","mar","apr","may","jun", > "jul","aug","sep","oct","nov","dec") > > sortorder<-order(as.numeric(date2[,2]),match(date2[,1],months)) To save some key strokes, the above can be done via: sortorder <- orde

Re: [R] How to set default plotting colors by treatment?

2009-09-14 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
>> col=c("blue","red")mydfr$[treatment] > > Yes, but I would like to use the function for lots of other dataframes > as well, so embedding 'mydfr' in the function is not the ideal > solution... In that case I'd try something like: myplot <- function(..., tmnt) { plot(..., pch=19,

Re: [R] acf gives correlations > 1

2009-09-14 Thread Steve Jones
Apologies for the missing data. It can be downloaded from here (22Kb): http://www.squaregoldfish.co.uk/sekrett/series.csv Steve. Duncan Murdoch wrote: > On 14/09/2009 6:40 AM, Steve Jones wrote: >> Hi list, >> >> I've been producing autocorrelation functions of time series using the >> acf functi

Re: [R] How to set default plotting colors by treatment?

2009-09-14 Thread Remko Duursma
The example is reproducible! Did you see the first post? remko - Remko Duursma Post-Doctoral Fellow Centre for Plants and the Environment University of Western Sydney Hawkesbury Campus Richmond NSW 2753 Dept of Biological Science Macquarie Unive

Re: [R] How to set default plotting colors by treatment?

2009-09-14 Thread Paul Hiemstra
Remko Duursma wrote: col=c("blue","red")mydfr$[treatment] Yes, but I would like to use the function for lots of other dataframes as well, so embedding 'mydfr' in the function is not the ideal solution... The problem is that the info in 'treatment' is non-constant, and you need to eithe

Re: [R] setting plotting device

2009-09-14 Thread Paul Hiemstra
utkarshsinghal wrote: Hi All, I have recently *re*-installed R-2.9.1 in my Linux machine. Hi, Did you use the package manager of you linux distro, or did you compile from source. cheers, Paul Since then, I am unable to plot using the usual interactive device. > plot(1:10) This plots in

Re: [R] acf gives correlations > 1

2009-09-14 Thread Duncan Murdoch
On 14/09/2009 6:40 AM, Steve Jones wrote: Hi list, I've been producing autocorrelation functions of time series using the acf function, and have found a series or two for which correlations of > 1 are given, which I think shouldn't happen. Attached is the time series I'm using, and below is the

Re: [R] Exporting Numerous Graphs

2009-09-14 Thread jim holtman
You can wite them out as single files (png('file-%02d.png',...)) and then import them to Word. On Mon, Sep 14, 2009 at 1:55 AM, Chris Li wrote: > > Hi all, > > I have got 27 graphs to export (not a lot...I know!). How can I fit all of > them into a single file like PNG without adjusting the size

Re: [R] How to set default plotting colors by treatment?

2009-09-14 Thread Remko Duursma
> col=c("blue","red")mydfr$[treatment] Yes, but I would like to use the function for lots of other dataframes as well, so embedding 'mydfr' in the function is not the ideal solution... remko - Remko Duursma Post-Doctoral Fellow Centre for Plants

[R] acf gives correlations > 1

2009-09-14 Thread Steve Jones
Hi list, I've been producing autocorrelation functions of time series using the acf function, and have found a series or two for which correlations of > 1 are given, which I think shouldn't happen. Attached is the time series I'm using, and below is the R code (version 2.9.1) that I'm entering:

Re: [R] Data in Array

2009-09-14 Thread FMH
Thank you - Original Message From: jim holtman To: FMH Cc: Schalk Heunis ; r-help@r-project.org Sent: Tuesday, September 8, 2009 3:45:09 PM Subject: Re: [R] Data in Array Not sure what you mean by 'store', but you can use a list: > a <- matrix(1, nrow = 5, ncol = 1) > b <- matrix(2,

Re: [R] Color index in image function

2009-09-14 Thread FMH
Thank you From: Henrique Dallazuanna Cc: r-help@r-project.org Sent: Sunday, September 6, 2009 4:30:14 PM Subject: Re: [R] Color index in image function Try this to see which colors the codes are: Color <- function(color){     z <- matrix(1:length(color), nco

Re: [R] Derivative of nonparametric curve

2009-09-14 Thread FMH
Thank you - Original Message From: spencerg To: "Liaw, Andy" Cc: Rolf Turner ; FMH ; r-help@r-project.org Sent: Wednesday, September 9, 2009 3:08:43 PM Subject: Re: [R] Derivative of nonparametric curve     This may be overkill for your application, but you might be interested in t

Re: [R] How to set default plotting colors by treatment?

2009-09-14 Thread baptiste auguie
Hi, Using ggplot2, you could do something like this, library(ggplot2) myplot <- function(x, y, data, geom="point"){ ggplot(data=data, map=aes_string(x=x, y=y, colour = "treatment") ) + layer(geom=geom) + scale_colour_manual(values=c("red", "blue")) } d = data.frame(Xmeas=rnorm(10), Ymeas=rn

Re: [R] Exporting Numerous Graphs

2009-09-14 Thread baptiste auguie
Hi, It's probably easiest with the pdf (or postscript) device, pdf("all.pdf") for(ii in 1:27) plot(rnorm(10), main=paste("plot", ii)) dev.off() Bitmap-based devices can generate sequential filenames (Rplot1.png, Rplot2.png, ...) that you could combine in a single document using external tools

[R] merging two rpart objects

2009-09-14 Thread utkarshsinghal
Hi All, I am using "rpart" function to model my data: library(rpart) set.seed(1) x1 = sample(c("a","b"),100,T) x2 = runif(100) y = ifelse((x1=="a" & x2<=0.5)|(x1=="b" & x2>0.5), 0, 1) data = data.frame(x1,x2,y) fit = rpart(y~x1+x2) plot(fit); text(fit, use.n=TRUE) Now I want to use variable "x1

[R] Exporting Numerous Graphs

2009-09-14 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
> I have got 27 graphs to export (not a lot...I know!). How can I fit all of > them into a single file like PNG without adjusting the size of the graphs? > What's in my mind is like pasting graphs into Word, in which I can just > scroll down to view the graphs. Pretty sure PNG can only cope with s

Re: [R] How to set default plotting colors by treatment?

2009-09-14 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
> > # I tried defining a function like this > myplot <- function(...)plot(..., pch=19, col=c("blue","red")[treatment]) > > # So i can call it like this: > with(mydfr, myplot(Xmeas, Ymeas)) > > # but: > Error in plot.xy(xy, type, ...) : object 'treatment' not found > basically that is something like

Re: [R] RPostgreSQL package and libpq.dll file

2009-09-14 Thread Lore M
It still doesn't work. Now, R is asking me for the SSLEAY32.dll. If I download it from the internet, and then put it in the file \R-2.8.1\library\RPostgreSQL\libs, now they ask me for the VSINIT.dll file ! it's like an infinite loop... I've tried to intall again the RPostgreSQL library but not

[R] setting plotting device

2009-09-14 Thread utkarshsinghal
Hi All, I have recently *re*-installed R-2.9.1 in my Linux machine. Since then, I am unable to plot using the usual interactive device. > plot(1:10) This plots in a pdf file "Rplots.pdf" in my working directory. > sessionInfo() R version 2.9.1 (2009-06-26) i686-pc-linux-gnu locale: LC_CTYPE=e

<    1   2   3   >