Re: [R] Lattice: combine the same strip?

2009-09-29 Thread Deepayan Sarkar
On Sat, Sep 19, 2009 at 3:36 PM, di jianing wrote: > Hello R helpers, > > I am producing a figure with dual strips, i.e., x~y | S1 + S2, where S1 and > S2 are two strips. For example, in figure 2.1 at > http://lmdvr.r-forge.r-project.org/figures/figures.html. > > In this case, I would like to comb

Re: [R] Probability of data values form DENSITY function

2009-09-29 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
Lina, check ?density (and do so carefully). R uses a kernel estimate, by default "Gaussian" if I remember correctly. Values in a certain grid can be found from the code I sent earlier. I didn't check, but these are most likely just linearly interpolated by plot.density, and as the grid is suff

Re: [R] reducing space between charts in lattice graphics

2009-09-29 Thread Deepayan Sarkar
On Sat, Sep 19, 2009 at 9:42 AM, Larry White wrote: > Hi, > > I'm trying to create a lattice plot with three xyplots in one vertical > column. I would like to reduce the vertical space between the charts.  My > code is below. There seems to be a "between" parameter for lattice.options, > but I can

Re: [R] Help with sub functions

2009-09-29 Thread Prof Brian Ripley
On Tue, 29 Sep 2009, edche...@gmail.com wrote: I have chances to work with both linux based and win based R codes. And as you all know in linux, the file directories use "/" and win uses "\\". Is there a function like sub or gsub that could substitute those slashes automatically? See ?char

Re: [R] changing number of axis

2009-09-29 Thread Deepayan Sarkar
On Tue, Sep 29, 2009 at 11:09 PM, Dan Kortschak wrote: > Hi Deepayan, > > Thanks for that, I had a think (a few hour too late) and came to the > same conclusion. I had wanted to have vertical bars for each of the data > points, I have gone to a straight xyplot and this shows other intersting > inf

Re: [R] lattice: How to display no box but only a y-axis on the left + Thicker lines

2009-09-29 Thread Deepayan Sarkar
On Fri, Sep 18, 2009 at 6:06 AM, baptiste auguie wrote: > No box is easy, > > bwplot(y~x, data=data.frame(y=rnorm(10),x=sample(letters[1:3],10,repl=T)), > par.settings=list(axis.line=list(col=NA))) > > but that seems to remove all axis lines and ticks as well. You may > have to define a custom pan

Re: [R] JRI - get S4 objects from R and assign them again

2009-09-29 Thread Romain Francois
Hi, You should use this mailing list instead http://mailman.rz.uni-augsburg.de/mailman/listinfo/stats-rosuda-devel. ... where I just posted something that might help you. Romain On 09/28/2009 02:57 PM, ajoec...@gmx.de wrote: Hello, I am writing a Java frontend for a selfwritten R program us

Re: [R] Arial for pdf() on a Mac

2009-09-29 Thread Prof Brian Ripley
On Tue, 29 Sep 2009, Steve Bellan wrote: Hi, I'd like to use Arial for the font in the PDF's and TIFF's I produce in R As ever, it is helpful to explain why you want to do something. First, because there may be better solutions to the larger problem, and secondly because the answer may invo

Re: [R] changing number of axis

2009-09-29 Thread Dan Kortschak
Hi Deepayan, Thanks for that, I had a think (a few hour too late) and came to the same conclusion. I had wanted to have vertical bars for each of the data points, I have gone to a straight xyplot and this shows other intersting information - maybe I want to be able to do both point and bar plots (

Re: [R] changing number of axis

2009-09-29 Thread Deepayan Sarkar
On Wed, Sep 16, 2009 at 2:02 PM, Dan Kortschak wrote: > Hi, I trying to produce a bar chart describing hits to specific bins by > chromosome for a large data set (I am asking here because > experimentation with options is precluded due to this - generating the > figure takes about an hour): > > ba

[R] Arial for pdf() on a Mac

2009-09-29 Thread Steve Bellan
Hi, I'd like to use Arial for the font in the PDF's and TIFF's I produce in R on my Mac (running 10.5.5). I've found the following archived help file on how to do it in Linux (http://tolstoy.newcastle.edu.au/R/e4/help/08/08/19847.html ) but don't understand how to do this on my system. Are

Re: [R] Re gression line w/ residuals - tuning the plot

2009-09-29 Thread Ulrike Groemping
Hello Primoz, with traditional graphics, you may want to use par (?par), options like mar, mai, oma etc. may be interesting for you. And for the relation between y-axis and x-axis, the option asp to function plot (?plot.default) will help. Regards, Ulrike Primoz PETERLIN-2 wrote: > > Hello e

Re: [R] Polynomial Fitting

2009-09-29 Thread chris carleton
Thanks a ton Rolf, I was using the coefficients as given from summary(fit), which have been rounded. When I used coef(fit) as you've done, the poly function is the same now in Octave and returned the R predicted values as expected. Your time is appreciated, C > CC: r-help@r-project.org > Fro

[R] Is there a R function that can do similar things like 'pdist' in Matlab?

2009-09-29 Thread RT Ye
Hi, I want to compute the pairwise correlation for about 10,000 genes. In Matlab there is a function called 'pdsit' that can do this very efficiently. I am wondering is there a similar function in R? Thanks, RT Ye. __ R-help@r-project.org mailing list

[R] Help with sub functions

2009-09-29 Thread edchen51
I have chances to work with both linux based and win based R codes. And as you all know in linux, the file directories use "/" and win uses "\\". Is there a function like sub or gsub that could substitute those slashes automatically? Thanks! Edward Chen Email: tke...@msn.com Cell Phone: 510-37

[R] FW: time series and ACF

2009-09-29 Thread Kon Knafelman
Hey guys, im sort of a beginner with R, but here's what i need to do. i need to perform a time series analysis on a set of financial data that i've been given. im trying to look at the ACF and PACF and fit it to a particular model (i think its the ARIMA model because i've read that financi

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

2009-09-29 Thread Martin Morgan
Peng Yu wrote: > On Tue, Sep 29, 2009 at 3:47 PM, Tobias Verbeke > 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 o

Re: [R] R package for visualizing/analyzing accelerometry data?

2009-09-29 Thread David Winsemius
rgl should let you draw segments (maybe even arrows) in pseudo 3D between sequential locations. I wonder if you could trick persp into doing it as well? scatterplot3d would be another avenue to explore. On Sep 29, 2009, at 10:39 PM, Jen Maresh wrote: Hello All - Any recommendations or su

Re: [R] Deleting a column in a dataframe by name

2009-09-29 Thread Jason Rupert
What about using NULL? > x<-runif(12) > y<-runif(12) > z<-runif(12) > mydf<-data.frame(cbind(x,y,z)) > names(mydf) [1] "x" "y" "z" > mydf$x<-NULL > names(mydf) [1] "y" "z" --- On Tue, 9/29/09, Rolf Turner wrote: > From: Rolf Turner > Subject: Re: [R] Deleting a column in a dataframe by name

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 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 you set when comp

[R] R package for visualizing/analyzing accelerometry data?

2009-09-29 Thread Jen Maresh
Hello All - Any recommendations or suggestions for neat ways to visualize data taken from a 3-axis accelerometer? My study species is aquatic, so I would be interested in movement in the 3 dimensions in addition to being able to incorporate the time series as well. Is there a package in R that mig

[R] 3D bar graphs/density plots

2009-09-29 Thread jimdare
Dear R Users, Does anyone know of a package that would enable me to create figures like the ones below? Regards, James http://www.nabble.com/file/p25673513/Picture1.jpg http://www.nabble.com/file/p25673513/Picture2.jpg -- View this message in context: http://www.nabble.com/3D-bar-graphs-de

Re: [R] connecting points on a graph

2009-09-29 Thread Jolene Sutton
Wow! Yes, that is perfect! Thanks!! On Wed, Sep 30, 2009 at 1:17 PM, jim holtman wrote: > Is this close to what you want: > > x <- read.table(textConnection("locus min max > K9/10* 70 72 > Pcc40 80 81 > 2F9 84 100 > 4E8/Pca12 96 108 > Pau6 99 103 > Pau20 100 113 > Pau9 103 129 > Pocc1* 104 128 >

Re: [R] connecting points on a graph

2009-09-29 Thread jim holtman
Is this close to what you want: x <- read.table(textConnection("locus min max K9/10* 70 72 Pcc40 80 81 2F9 84 100 4E8/Pca12 96 108 Pau6 99 103 Pau20 100 113 Pau9 103 129 Pocc1* 104 128 Pau7 105 111"), header=TRUE, as.is=TRUE) closeAllConnections() x$row <- seq(nrow(x)) plot(0, type='n', ylim=c(0,m

[R] connecting points on a graph

2009-09-29 Thread Jolene Sutton
Hi, I am trying to connect points on a graph that originate from *different columns of data*. For each sample I have minimum and maximum data points and I would like to draw a line connecting these in order to visualize the spread, as well as where each sample is in relation to the x-axis. So far

Re: [R] Interesting function in a function problem....

2009-09-29 Thread Jorge Ivan Velez
Hi chipmaney, Here is a suggestion: with(data, tapply(value, group, function(x) sd(x)/sqrt( length(x) ) ) ) * sqrt(fc$fc) BTW, take a look at require(fortunes) fortune('dog') HTH, Jorge On Tue, Sep 29, 2009 at 6:29 PM, chipmaney <> wrote: > > #I have these data. Basically, I want to run a ta

Re: [R] Data source for American college football rankings?

2009-09-29 Thread Bill Pikounis
Hi Doug, An interesting site I stumbled on long ago related to your intial question of data download is at http://www.mratings.com/cf/compare.htm which also contains a CSV file version at http://www.mratings.com/cf/compare.csv of *64* different ranking systems. Other pages within the site disc

[R] Interesting function in a function problem....

2009-09-29 Thread chipmaney
#I have these data. Basically, I want to run a tapply to calculate the mean and st. err. by factor. #The problem is, I want to add a finite correction to the variance prior to calculating the standard error. #Now I know I could just do this in 3/4 steps by calculating the var, applying the correct

Re: [R] Another Loop

2009-09-29 Thread David Winsemius
On Sep 29, 2009, at 5:53 PM, Antonio Paredes wrote: Hello everyone, Can somebody give a hint on how to go about speeding the following loop: You could try a loop-less approach: system.time( targets <- dat$ycon[i]==0 | dat$ytrt[i]==0 dat$ycon[targets]<-dat$ycon[targets]+0.5 da

[R] Another Loop

2009-09-29 Thread Antonio Paredes
Hello everyone, Can somebody give a hint on how to go about speeding the following loop: system.time( for(i in 1:nrow(dat)){ if(dat$ycon[i]==0 || dat$ytrt[i]==0) dat$ycon[i]<-dat$ycon[i]+0.5 dat$ytrt[i]<-dat$ytrt[i]+0.5 dat$cony[i]<-dat$cony[i]+0.5 dat$trty[i]<-dat$trty[i]+0.5 }

Re: [R] Deleting a column in a dataframe by name

2009-09-29 Thread Rolf Turner
On 30/09/2009, at 10:25 AM, Duncan Murdoch wrote: On 29/09/2009 4:54 PM, Rolf Turner wrote: On 30/09/2009, at 9:32 AM, milton ruser wrote: x=runif(12) y=runif(12) w=runif(12) mydf<-data.frame(cbind(x,y,w)) head(mydf) mydf<-subset(mydf, select=c(-x,-w)) head(mydf) But this doesn'

Re: [R] Deleting a column in a dataframe by name

2009-09-29 Thread Duncan Murdoch
On 29/09/2009 4:54 PM, Rolf Turner wrote: On 30/09/2009, at 9:32 AM, milton ruser wrote: x=runif(12) y=runif(12) w=runif(12) mydf<-data.frame(cbind(x,y,w)) head(mydf) mydf<-subset(mydf, select=c(-x,-w)) head(mydf) But this doesn't work if NAME1 and NAME2 are ***names***, as

Re: [R] Using linear formula inside MLE

2009-09-29 Thread Peter Dalgaard
Stephen Collins wrote: Say I have a formula Y ~ 1 + X, where X is a categorical variable. A previous thread showed how to evaluate this model using the mle package from "stats4" (see below). But, the user had to create the data matrix, X, including the column of one's for the regression const

Re: [R] Deleting a column in a dataframe by name

2009-09-29 Thread milton ruser
Peace on your heart... it is still Tuesday, and Friday is away... :-) On Tue, Sep 29, 2009 at 4:54 PM, Rolf Turner wrote: > > On 30/09/2009, at 9:32 AM, milton ruser wrote: > > x=runif(12) >> y=runif(12) >> w=runif(12) >> >> mydf<-data.frame(cbind(x,y,w)) >> head(mydf) >> >> mydf<-subset(mydf,

Re: [R] creating Surv object from character vector

2009-09-29 Thread Erik Iverson
> > as.Surv <- function(x) { > Surv(as.integer(sub("\\+", "", x)), >as.integer(ifelse(regexpr("\\+", x) > -1, 0, 1))) > } > > > identical(srv, as.Surv(srv.char)) > [1] TRUE > But Do NOT use "as.integer" with real data, which may contain fractions of course. I was too eager to get i

Re: [R] Equivalent for Matematica function Which...

2009-09-29 Thread Henrique Dallazuanna
Try this; cut(x, breaks = c(0, 10, 20, 100), labels = c(0.3, .5, 1)) On Tue, Sep 29, 2009 at 3:11 PM, Jarek Jasiewicz wrote: > Dear All! > > I'm looking for equivalent of Matematica function "Which" which works as > follows: > > z = Which[x<10,0.3, 10<=x<20,0.5, 20<=x<100,1] > > where x is a vec

Re: [R] how to visualize gini coefficient in each node in RF?

2009-09-29 Thread Chrysanthi A.
Thanks for the reply! However, what is the code that is used in order to calculate it.. Is it included in the "randomForest" R function.. Because I am trying to find the code corresponding to the estimation of the gini coefficient but I am a bit confused. Could you please help me, by indicating me

Re: [R] Deleting a column in a dataframe by name

2009-09-29 Thread Rolf Turner
On 30/09/2009, at 9:32 AM, milton ruser wrote: x=runif(12) y=runif(12) w=runif(12) mydf<-data.frame(cbind(x,y,w)) head(mydf) mydf<-subset(mydf, select=c(-x,-w)) head(mydf) But this doesn't work if NAME1 and NAME2 are ***names***, as the terminology would apply. And that is

Re: [R] Equivalent for Matematica function Which...

2009-09-29 Thread Jorge Ivan Velez
Hi Jarek, Take a look at ?which, ?ifelse and ?recode (car package). HTH, Jorge On Tue, Sep 29, 2009 at 2:11 PM, Jarek Jasiewicz <> wrote: > Dear All! > > I'm looking for equivalent of Matematica function "Which" which works as > follows: > > z = Which[x<10,0.3, 10<=x<20,0.5, 20<=x<100,1] > > wh

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

2009-09-29 Thread Tobias Verbeke
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 you set when compiling. Did you try to type a letter (say 'l') and press the TAB key

Re: [R] PCA or CA

2009-09-29 Thread Mark Difford
Hi Paul, >> I have a data set for which PCA based between group analysis (BGA) gives >> significant results but CA-BGA does not. >> I am having difficulty finding a reliable method for deciding which >> ordination >> technique is most appropriate. Reliability really comes down to you thinking

Re: [R] Deleting a column in a dataframe by name

2009-09-29 Thread milton ruser
x=runif(12) y=runif(12) w=runif(12) mydf<-data.frame(cbind(x,y,w)) head(mydf) mydf<-subset(mydf, select=c(-x,-w)) head(mydf) On Tue, Sep 29, 2009 at 4:27 PM, Rolf Turner wrote: > > On 30/09/2009, at 9:15 AM, milton ruser wrote: > > May be this: >> >> FRAME <- FRAME[-c(NAME1, NAME2)] >> or >>

Re: [R] Equivalent for Matematica function Which...

2009-09-29 Thread Erik Iverson
Hello, > I'm looking for equivalent of Matematica function "Which" which works as > follows: > > z = Which[x<10,0.3, 10<=x<20,0.5, 20<=x<100,1] > > where x is a vector Unless someone happens to be a Mathematica user (very possible), I don't know how we would answer the question. You give an

Re: [R] Deleting a column in a dataframe by name

2009-09-29 Thread Rolf Turner
On 30/09/2009, at 9:15 AM, milton ruser wrote: May be this: FRAME <- FRAME[-c(NAME1, NAME2)] or FRAME<- subset(FRAME, select=(-NAME1, -NAME2)) This is ridiculous advice. Try things out before you suggest them. cheers, Rolf Turner

Re: [R] Deleting a column in a dataframe by name

2009-09-29 Thread milton ruser
May be this: FRAME <- FRAME[-c(NAME1, NAME2)] or FRAME<- subset(FRAME, select=(-NAME1, -NAME2)) bests milton On Tue, Sep 29, 2009 at 4:12 PM, Dennis Fisher wrote: > Colleagues, > > Hopefully a simple problem: I want to delete a column with a known name > from a dataframe. I could write: > >

Re: [R] Deleting a column in a dataframe by name

2009-09-29 Thread Henrique Dallazuanna
Try this: FRAME$NAMETODELETE <- NULL On Tue, Sep 29, 2009 at 5:12 PM, Dennis Fisher wrote: > Colleagues, > > Hopefully a simple problem: I want to delete a column with a known name from > a dataframe.  I could write: > >        FRAME   <- FRAME[, names(FRAME) != NAMETODELETE] > or >        FRAME

[R] Deleting a column in a dataframe by name

2009-09-29 Thread Dennis Fisher
Colleagues, Hopefully a simple problem: I want to delete a column with a known name from a dataframe. I could write: FRAME <- FRAME[, names(FRAME) != NAMETODELETE] or FRAME <- FRAME[, !names(FRAME) %in% c(NAME1, NAME2, ETC)] Is there some simpler means to accomplish this

Re: [R] fft with NA values

2009-09-29 Thread Rolf Turner
On 29/09/2009, at 10:54 PM, Steve Jones wrote: Hi List, I'm trying to perform some spectral analysis on a time series, but I've got a few data points missing, so they have NA values. Unfortunately, the fft function doesn't seem to like this, and gives a completely empty result. Other th

Re: [R] creating Surv object from character vector

2009-09-29 Thread David Winsemius
On Sep 29, 2009, at 3:08 PM, Erik Iverson wrote: Hello, I have srv <- Surv(sample(1:10), sample(0:1, 10, replace = TRUE)) srv [1] 1 10 2+ 8 6+ 7+ 3 5+ 4+ 9+ srv.char <- as.character(srv) srv.char [1] " 1 " "10 " " 2+" " 8 " " 6+" " 7+" " 3 " " 5+" " 4+" " 9+" Is there an inver

Re: [R] creating Surv object from character vector

2009-09-29 Thread Erik Iverson
> > identical(srv, ???(srv.char)) to return TRUE, where ??? is some unknown > function. I don't think it exists, but maybe I'm wrong. I suppose it > would be easy enough to roll my own... > FYI, This works in my simple case for right-censored data... it takes as input a vector like c("1", "2+

Re: [R] Polynomial Fitting

2009-09-29 Thread Rolf Turner
On 30/09/2009, at 5:34 AM, chris carleton wrote: Thanks for the response. I'm sorry I didn't provide the code or data example earlier. I was using the polynomial fitting technique of this form; test <- lm(x[,34] ~ I(x[,1]) + I(x[,1]^2) + I(x[,1]^3)) for the original fitting operation. I

Re: [R] error while plotting

2009-09-29 Thread Nair, Murlidharan T
-Original Message- From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] Sent: Tuesday, September 29, 2009 4:52 AM To: Nair, Murlidharan T Cc: r-help@r-project.org Subject: Re: [R] error while plotting Nair, Murlidharan T wrote: > > -Original Message- > From: Uwe Ligges [

Re: [R] Equivalent for Matematica function Which...

2009-09-29 Thread Jarek Jasiewicz
William Dunlap pisze: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jarek Jasiewicz Sent: Tuesday, September 29, 2009 11:36 AM To: Erik Iverson Cc: R-help@r-project.org Subject: Re: [R] Equivalent for Matematica function Which

[R] creating Surv object from character vector

2009-09-29 Thread Erik Iverson
Hello, I have srv <- Surv(sample(1:10), sample(0:1, 10, replace = TRUE)) srv [1] 1 10 2+ 8 6+ 7+ 3 5+ 4+ 9+ srv.char <- as.character(srv) srv.char [1] " 1 " "10 " " 2+" " 8 " " 6+" " 7+" " 3 " " 5+" " 4+" " 9+" Is there an inverse to as.character(srv). That is, I would like

Re: [R] how to visualize gini coefficient in each node in RF?

2009-09-29 Thread Liaw, Andy
No. The forest object is too large as is. I didn't think it's worth the extra memory to store them. They were never kept even in the Fortran/C code. Andy From: Chrysanthi A. > Sent: Monday, September 28, 2009 5:20 PM > To: r-help@r-project.org > Subject: [R] how to visualize gini coefficient

Re: [R] Equivalent for Matematica function Which...

2009-09-29 Thread David Winsemius
On Sep 29, 2009, at 2:36 PM, Jarek Jasiewicz wrote: well function arguments are in square brackets. z is result (new vector). I show Matematica syntax, but cannot explain what I expect. Sorry The example is wrong because it can be replaced by R cut function. The arguments are: condition,ac

Re: [R] Equivalent for Matematica function Which...

2009-09-29 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Jarek Jasiewicz > Sent: Tuesday, September 29, 2009 11:36 AM > To: Erik Iverson > Cc: R-help@r-project.org > Subject: Re: [R] Equivalent for Matematica function Which... > > wel

Re: [R] Probability of data values form DENSITY function

2009-09-29 Thread Rolf Turner
On 30/09/2009, at 3:45 AM, Lina Rusyte wrote: Hello, Could someone help me please and to tell how to get the probability from empirical DENSITY (not parametric) for each data value (R function). For example, for normal distribution there is such a function like: “dnorm(q, mean = 0, sd =

Re: [R] Polynomial Fitting

2009-09-29 Thread chris carleton
Thanks for the response. I'm sorry I didn't provide the code or data example earlier. I was using the polynomial fitting technique of this form; test <- lm(x[,34] ~ I(x[,1]) + I(x[,1]^2) + I(x[,1]^3)) for the original fitting operation. I also tried to use; lm(y ~ poly(x,3,raw=TRUE)) with the

[R] PCA or CA

2009-09-29 Thread Paul Dennis
Dear all I have a data set for which PCA based between group analysis (BGA) gives significant results but CA-BGA does not. I am having difficulty finding a reliable method for deciding which ordination technique is most appropriate. I have been told to do a 1 table CA and if the 1st axis is>

Re: [R] Equivalent for Matematica function Which...

2009-09-29 Thread Jarek Jasiewicz
well function arguments are in square brackets. z is result (new vector). I show Matematica syntax, but cannot explain what I expect. Sorry The example is wrong because it can be replaced by R cut function. The arguments are: condition,action and can be replaced by ste of ifelse formulas:

[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 https://stat.ethz.ch/mailman/li

Re: [R] rbind for a list

2009-09-29 Thread Carlos Hernandez
On Tue, Sep 29, 2009 at 8:05 PM, David Winsemius wrote: > > On Sep 29, 2009, at 1:43 PM, Carlos Hernandez wrote: > > Dear All, >> I´m using the following code: >> >> all1<-gg2[[1]][[1]]; for(i in 1:48){ all1 <- rbind(all1,gg2[[i]][[1]]) } >> > > Looks to me that you would be getting a duplicate c

Re: [R] start scripts directly in the console on windows machines

2009-09-29 Thread David Winsemius
On Sep 29, 2009, at 1:49 PM, Martin Batholdy wrote: hi, on the mac you have the opportunity to start a script directly instead of opening it in the script editor. So when I doubleclick on an .R - file the code is executed immediately. I haven't found such an option in the preferences of

Re: [R] Macro variable substitution

2009-09-29 Thread Erik Iverson
One option, see ?assign and write a wrapper around it, using the "pos" argument. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of David Young > Sent: Tuesday, September 29, 2009 10:58 AM > To: r-help@r-project.org > Subject:

Re: [R] Equivalent for Matematica function Which...

2009-09-29 Thread Jarek Jasiewicz
well thanks, when I post the mail I thought I got too simple example which may be really replaced by "cut", but I thought about little more: let say: z = Which[x<10,x/3, 10<=x<20,0.5, 20<=x<100,x^2/(x-1)] where there are both values and formula sorry for mismatch and thanks for quick answer Ja

Re: [R] Macro variable substitution

2009-09-29 Thread baptiste auguie
Hi, I guess you want ?assign See also this page for a working example, http://wiki.r-project.org/rwiki/doku.php?id=guides:assigning-variable-names HTH, baptiste 2009/9/29 David Young : > Hello All, > > I'm a new R user and have a question about what in SAS would be called > macro variable sub

[R] Macro variable substitution

2009-09-29 Thread David Young
Hello All, I'm a new R user and have a question about what in SAS would be called macro variable substitution. Below is some R code that doesn't work, but I think it will illustrate what I'd like to do. readfunc<-function(x) { x <<- read.table(paste(x,".csv",sep=""), header=TRUE,sep=",") } rea

[R] Equivalent for Matematica function Which...

2009-09-29 Thread Jarek Jasiewicz
Dear All! I'm looking for equivalent of Matematica function "Which" which works as follows: z = Which[x<10,0.3, 10<=x<20,0.5, 20<=x<100,1] where x is a vector I can replace it with custom function with set of ifelse but I'm looking for simpler and faster (much faster) solution best wishes

Re: [R] rbind for a list

2009-09-29 Thread David Winsemius
On Sep 29, 2009, at 1:43 PM, Carlos Hernandez wrote: Dear All, I´m using the following code: all1<-gg2[[1]][[1]]; for(i in 1:48){ all1 <- rbind(all1,gg2[[i]] [[1]]) } Looks to me that you would be getting a duplicate copy of the first matrix, but aside from that what problems are you expe

Re: [R] xyplot help - colors and break in plot

2009-09-29 Thread Tim Clark
Felix, Thanks, that did the trick! Lattice is a lot less intuitive than basic plotting! Also, another person suggested using gap.plot from the plotrix package to put a break in the graph. I am surprised Lattice doesn't have something similar since it seems like a common problem when you have

[R] how to draw a slope (using abline) with a specific starting point?

2009-09-29 Thread A.B.
plot(y~x, type='p', col=3, xlim=c(50,1000), ylim=c(0,80), xlab='', ylab='', data=example) abline(a=11, b=0.04, col = 2) -- Thanks, A.B. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis

Re: [R] rbind for a list

2009-09-29 Thread Carlos Hernandez
Thank you for your quick reply! It works perfectly! On Tue, Sep 29, 2009 at 7:51 PM, Henrique Dallazuanna wrote: > Try this; > > do.call(rbind, sapply(gg2, '[', 1)) > > On Tue, Sep 29, 2009 at 2:43 PM, Carlos Hernandez > wrote: > > Dear All, > > I´m using the following code: > > > > all1<-gg2[[1

Re: [R] Data source for American college football rankings?

2009-09-29 Thread Douglas Bates
On Tue, Sep 29, 2009 at 7:56 AM, Douglas Bates wrote: > An interesting, and topical, example of multivariate data for > classroom illustrations are the American college football rankings. > Starting at the end of October (or "week 8", the 8th week of the > football season) a set of rankings called

Re: [R] vectors levels are carried through to subsets...

2009-09-29 Thread Barry Rowlingson
On Tue, Sep 29, 2009 at 6:47 PM, chipmaney wrote: > > I have a dataset.  Initially, it has 25 levels for a certain factor, > Description. > > However, I then subset it, because I am only interested in 2 of the 25 > factors.  When I subset it, I get the following. The vector lists only the > two fa

[R] rbind for a list

2009-09-29 Thread Carlos Hernandez
Dear All, I´m using the following code: all1<-gg2[[1]][[1]]; for(i in 1:48){ all1 <- rbind(all1,gg2[[i]][[1]]) } to create a new matrix that contains all the matrices in a list called gg2. gg2 is a list that looks like >> gg2 [[1]] [[1]][[1]] [[2]] [[2]][[1]] . . . [[48]] [[48]][[1]] Is the

Re: [R] rbind for a list

2009-09-29 Thread Henrique Dallazuanna
Try this; do.call(rbind, sapply(gg2, '[', 1)) On Tue, Sep 29, 2009 at 2:43 PM, Carlos Hernandez wrote: > Dear All, > I´m using the following code: > > all1<-gg2[[1]][[1]]; for(i in 1:48){ all1 <- rbind(all1,gg2[[i]][[1]]) } > > to create a new matrix that contains all the matrices in a list call

[R] start scripts directly in the console on windows machines

2009-09-29 Thread Martin Batholdy
hi, on the mac you have the opportunity to start a script directly instead of opening it in the script editor. So when I doubleclick on an .R - file the code is executed immediately. I haven't found such an option in the preferences of the R program for windows. Is there also a way to do s

[R] vectors levels are carried through to subsets...

2009-09-29 Thread chipmaney
I have a dataset. Initially, it has 25 levels for a certain factor, Description. However, I then subset it, because I am only interested in 2 of the 25 factors. When I subset it, I get the following. The vector lists only the two factors, yet there remain 25 levels: > Quadrats.df$Description

Re: [R] help with lda function from MASS package

2009-09-29 Thread David Winsemius
If you want to see how Venables and Ripley get their lda distances, then this is a quick path to the (uncommented) source: 1) > methods(lda) [1] lda.data.frame* lda.default*lda.formula*lda.matrix* 2) since you call involved a formula I looked first at: > getAnywhere(lda.formula) A singl

Re: [R] Summary

2009-09-29 Thread Henrique Dallazuanna
A alternative in cases where is there NA's shoul be: sapply(sapply(df, summary), '[', 1:7) On Tue, Sep 29, 2009 at 2:28 PM, William Dunlap wrote: >> -Original Message- >> From: r-help-boun...@r-project.org >> [mailto:r-help-boun...@r-project.org] On Behalf Of Henrique >> Dallazuanna >> S

Re: [R] Summary

2009-09-29 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: Tuesday, September 29, 2009 9:57 AM > To: Ashta > Cc: R help > Subject: Re: [R] Summary > > Try this: > > sapply(xc, summary) This fails if ther

Re: [R] Summary

2009-09-29 Thread Henrique Dallazuanna
Try this: sapply(xc, summary) On Tue, Sep 29, 2009 at 12:42 PM, Ashta wrote: > My data is called  xc and has more than 15 variables. > > > When I used summary(xc)   it gave me the detail description of each > variable. > > > > Summary(xc) > > > >              Y1                x1                

Re: [R] preformatted and '#' in manual pages

2009-09-29 Thread Duncan Murdoch
On 9/29/2009 11:57 AM, Gábor Csárdi wrote: On Tue, Sep 29, 2009 at 5:36 PM, Duncan Murdoch wrote: Gábor Csárdi wrote: Dear All, I have the following in a .Rd file: ... human readable (not binary) format. The format itself is like the following: \preformatted{ \# vertex1

Re: [R] help with lda function from MASS package

2009-09-29 Thread Pete Shepard
Thanks David, Yes, I am talking about the MASS package.Thank you for pointing out that these scale the same. My question is, how do I get from the V1 data: V1 1 164.4283 2 166.2492 3 170.5232 4 156.5622 5 127.7540 6 136.7704 7 136.3436 to the other set of data: + 1 -2.3769280 + 2 -2.704

Re: [R] plot error -- figure margins too large

2009-09-29 Thread Ping-Hsun Hsieh
Thanks, Uwe. You code does what I would like to have! Best, Mike -Original Message- From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] Sent: Tuesday, September 29, 2009 1:36 AM To: Ping-Hsun Hsieh Cc: r-help@r-project.org Subject: Re: [R] plot error -- figure margins too large

Re: [R] loop problem

2009-09-29 Thread David Winsemius
That code is way more than a _minimal_ example, and its not _reproducible_ either, so just a comment: Have you considered creating a vector rather than separate "event" variables? R_ev[1:16] <- R_event > (rx[1] + 300*(0:15)& R_event <= (rx[1] + 300*(1:16) ?cut # would also appear to b

Re: [R] ggplot2 box plot notches

2009-09-29 Thread stvienna wiener
Dear Thierry, Thank you very much for the fast reply. Is there a way not to plot outliers in the ggplot2 boxplots? In a way that the scale of the y-axis is rendered as if there was no outlier? (not just the the ouliers removed with the same scale of the y-axsis...) [ example for a boxplot: qpl

Re: [R] How can I avoid a for-loop through sapply or lapply ?

2009-09-29 Thread jim holtman
How about this: > x <- c("sadfdsaf 24353245", 'wqerwqer 6577', 'xzcv 6587') > sub("^([^[:space:]]+)[[:space:]].*", "\\1", x) [1] "sadfdsaf" "wqerwqer" "xzcv" > On Tue, Sep 29, 2009 at 12:03 PM, wrote: > Through converting a miRNAs file from FASTA to character  format I get a > vector which lo

Re: [R] How can I avoid a for-loop through sapply or lapply ?

2009-09-29 Thread Ted Harding
On 29-Sep-09 16:03:31, mau...@alice.it wrote: > Through converting a miRNAs file from FASTA to character format I get > a vector which looks like the following: > >> nml > [1] "hsa-let-7a MIMAT062 Homo sapiens let-7a" > [2] "hsa-let-7b MIMAT063 Homo sapiens let-7b"

Re: [R] axis scale issues....

2009-09-29 Thread jim holtman
Not sure exactly what you want, but does using 'ylim' do what you want: plot(1:5, sample(100:200,5), type='b', ylim=c(0,450)) On Tue, Sep 29, 2009 at 12:08 PM, chipmaney wrote: > > I have read all the help on axis scales, which seems to be much harder to > deal with than it should be, given how

Re: [R] How can I avoid a for-loop through sapply or lapply ?

2009-09-29 Thread Charles C. Berry
On Tue, 29 Sep 2009, mau...@alice.it wrote: Through converting a miRNAs file from FASTA to character format I get a vector which looks like the following: nml [1] "hsa-let-7a MIMAT062 Homo sapiens let-7a" [2] "hsa-let-7b MIMAT063 Homo sapiens let-7b" [3] "hsa-let-7c MIMAT064

Re: [R] How can I avoid a for-loop through sapply or lapply ?

2009-09-29 Thread Steve Lianoglou
Hi, On Sep 29, 2009, at 12:03 PM, wrote: Through converting a miRNAs file from FASTA to character format I get a vector which looks like the following: nml [1] "hsa-let-7a MIMAT062 Homo sapiens let-7a" [2] "hsa-let-7b MIMAT063 Homo sapiens let-7b" [3] "hsa-let-7c MIMAT064

[R] axis scale issues....

2009-09-29 Thread chipmaney
I have read all the help on axis scales, which seems to be much harder to deal with than it should be, given how common the need to alter axes. Anywayyeah, suppress the axis using yaxt then call and define the new scale using axis(). The problem is, this doesn't change the actual axis, only

Re: [R] A programming question - is what I want to do possible in R?

2009-09-29 Thread Martin Morgan
jim holtman wrote: Add a dummy argument to the function: randomSamples<-lapply(1:2000,function(dummy){ + meta_comp[sample(nrow(meta_comp),nTimes),]}) Or df = data.frame(x=1:10, y=10:1) replicate(10, df[sample(nrow(df), 5),], simplify=FALSE) Martin On Mon, Sep 28, 2009 at 9:39 PM, ewaters

[R] How can I avoid a for-loop through sapply or lapply ?

2009-09-29 Thread mauede
Through converting a miRNAs file from FASTA to character format I get a vector which looks like the following: > nml [1] "hsa-let-7a MIMAT062 Homo sapiens let-7a" [2] "hsa-let-7b MIMAT063 Homo sapiens let-7b" [3] "hsa-let-7c MIMAT064 Homo sapiens let-7c"

Re: [R] preformatted and '#' in manual pages

2009-09-29 Thread Gábor Csárdi
On Tue, Sep 29, 2009 at 5:36 PM, Duncan Murdoch wrote: > Gábor Csárdi wrote: >> >> Dear All, >> >> I have the following in a .Rd file: >> ... >>      human readable (not binary) format. The format itself is like >>      the following: >>      \preformatted{ >>        \# vertex1name >>        verte

Re: [R] Comparing vectors from lists

2009-09-29 Thread jim holtman
something like this should work (not exactly sure what you mean by 'compare') result <- lapply(List1, function(.lst1){ lapply(List2, function(.lst2, .lst1){ all(.lst2 %in% .lst1) }, .lst1 = .lst1) }) On Tue, Sep 29, 2009 at 10:34 AM, Christina Rodemeyer wrote: > Hi guys, > > I

[R] loop problem

2009-09-29 Thread crenial30
I have the following code which I wanted to convert using for loop previous code: R_ev1 <- R_event[R_event > (rx[1] + 300*0)& R_event <= (rx[1] + 300*1)] R_ev2 <- R_event[R_event > (rx[1] + 300*1)& R_event <= (rx[1] + 300*2)] R_ev3 <- R_event[R_event > (rx[1] + 300*2)& R_event <= (rx[1] + 300*3)]

[R] Summary

2009-09-29 Thread Ashta
My data is called xc and has more than 15 variables. When I used summary(xc) it gave me the detail description of each variable. Summary(xc) Y1x1 x2 x3 .. Min. :0. Min. : 1.000 Min. : 1.000 Min. : 1.000 1st Qu

  1   2   >