Re: [R] Variable selection from given data

2014-10-30 Thread David Winsemius
Untested and with the presumption that you have the appropriate package loaded: sapply(1:15, function(x) qr(y ~ ., df[-grep(paste0(“x”,i)]) ) > On Oct 30, 2014, at 11:14 PM, Preetam Pal wrote: > > Hi, > > I am doing quantile regression of y on a set of 15 explanatory variables x1, > x2,x

[R] Variable selection from given data

2014-10-30 Thread Preetam Pal
Hi, I am doing quantile regression of y on a set of 15 explanatory variables x1, x2,x15. I want to run 15 regression models where in the i-th model, y would be regressed on all x variables except x-i. Then I would compare the results. At this point, I donot know how to create the 15 data se

Re: [R] Dropping variables from data set

2014-10-30 Thread Jeff Newmiller
Sounds like homework. See the Posting Guide. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#..

[R] Dropping variables from data set

2014-10-30 Thread Preetam Pal
Hi, I have 15 variables x1, x2, , x15 and I want to create 15 data sets where the i-th data set D-i will be contain all variables except the variable, x-i, for i in 1 to 15. It would be great if someone can help me out with this. I have had very little exposure to R or general coding befor

Re: [R] problem with Zenith angle calculation

2014-10-30 Thread Jeff Newmiller
Your example is not reproducible. For example you don't indicate what lat and lon values you are using. Nor do you specify what time zone you are working in. These are all crucial to obtain consistency. I have no experience using the insol package, and had no luck trying it just now, but the ma

[R] problem with Zenith angle calculation

2014-10-30 Thread Alemu Tadesse
Dea R users, In the package insol I was trying to calculate sunzenith angle. I am using two different date formats as shown below and both give me different results. Comapring the results from NOAA website the one below is correct. xx<-JD(ISOdate(2010,10,1,11)) sv=sunvector(xx,lat,lon,tmz) zenith

Re: [R] Variance of multiple non-contiguous time periods?

2014-10-30 Thread Jim Lemon
On Fri, 31 Oct 2014 07:19:01 AM Jim Lemon wrote: > On Wed, 29 Oct 2014 05:12:19 PM CJ Davies wrote: > > I am trying to show that the red line ('yaw') in the upper of the two > > plots here; > > > > http://i.imgur.com/N4Xxb4f.png > > > > varies more within the pink sections ('transition 1') than i

Re: [R] How to speed up list access in R?

2014-10-30 Thread Hadley Wickham
Or do all the subsetting in one pass - [ will use a hashmap. Hadley On Thu, Oct 30, 2014 at 12:05 PM, William Dunlap wrote: > You can try using an environment instead of a list. > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > > On Thu, Oct 30, 2014 at 10:02 AM, Thomas Nyberg wrote: >>

[R] change default installation of R

2014-10-30 Thread Matthew
I have R version 2.15.0 installed in /usr/local/bin, and this is the default; in other words when I type which R this is the path I get. I also have installed R into/usr/local/R-3.1.1/. I used ./configure and then make to install this version. After make, I get the following error messages:

Re: [R] Variance of multiple non-contiguous time periods?

2014-10-30 Thread Jim Lemon
On Wed, 29 Oct 2014 05:12:19 PM CJ Davies wrote: > I am trying to show that the red line ('yaw') in the upper of the two > plots here; > > http://i.imgur.com/N4Xxb4f.png > > varies more within the pink sections ('transition 1') than in the light > blue sections ('real'). > > I tried to use var.t

Re: [R] PCA on stacked raster (multiple bands/ layers) in R

2014-10-30 Thread Gustavo Bediaga
Hi, You have to transform it to a Data Frame. Try: files <- stack(rasterlist) filesdf<-as.data.frame(files) pca <- princomp(formula = ~., data = filesdf, cor = TRUE, na.action=na.exclude) hope it helps Gustavo Em quinta-feira, 30 de outubro de 2014 14h38min56s UTC-2, John Wasige escreveu

Re: [R] How to speed up list access in R?

2014-10-30 Thread Thomas Nyberg
(CCing the list because I definitely think it would be useful to have this in the archives.) Thanks so much! It's clear that I'm going to need to read this email plus references quite a few times before things sink in. I guess I'll have to change my point of view entirely for this language. I

Re: [R] How to speed up list access in R?

2014-10-30 Thread William Dunlap
You can try using an environment instead of a list. Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Oct 30, 2014 at 10:02 AM, Thomas Nyberg wrote: > Thanks to all for the help everyone! For the moment I'll stick with Bill's > solution, but I'll check out the other recommendations as well.

Re: [R] How to speed up list access in R?

2014-10-30 Thread Thomas Nyberg
Thanks to all for the help everyone! For the moment I'll stick with Bill's solution, but I'll check out the other recommendations as well. Regarding the issue of slow looks ups for lists, are there any hash map implementations in R that are faster? I like using fairly simple logic and data str

Re: [R] How can I merge data with differing length?

2014-10-30 Thread Michael Dewey
On 30/10/2014 16:03, Kuma Raj wrote: How can I merge data frame df and "tem" shown below by filling the head of "tem" with missing values? does c(rep(NA, nrow(df) - length(tem)), tem) help? a<- rnorm(1825, 20) b<- rnorm(1825, 30) date<-seq(as.Date("2000/1/1"), by = "day", length.out =

[R] Setting a class / outcome variable for Weka Principal Components Analysis

2014-10-30 Thread Suranga Kasthurirathne
Hi everyone, I've relatively new to R, and i'm trying to use it to perform a Principal Components analysis (PCA) I've done this using WEKA previously, and now i'm trying to do so using R's prcomp and princomp (both options would work for me). One problem i've found is that while WEKA PCA allows u

[R] PCA on stacked raster (multiple bands/ layers) in R

2014-10-30 Thread John Wasige
Hello community, I need help on how I can perform PCA on stacked raster (multiple bands/ layers) in R. Does any body have an idea or script? Thanks John [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz

Re: [R] How to speed up list access in R?

2014-10-30 Thread Ista Zahn
Bill beat me to it, I was just about to post the same thing. The R split version is still slower than python on my system, but the times are now on the same order of magnitude, about a 10th of a second in both cases. You can also speed up the set-up part by sampling all at once instead of repeated

[R] How can I merge data with differing length?

2014-10-30 Thread Kuma Raj
How can I merge data frame df and "tem" shown below by filling the head of "tem" with missing values? a<- rnorm(1825, 20) b<- rnorm(1825, 30) date<-seq(as.Date("2000/1/1"), by = "day", length.out = 1825) df<-data.frame(date,a,b) tem<- rpois(1095, lambda=21) Thanks

Re: [R] How to speed up list access in R?

2014-10-30 Thread William Dunlap
Repeatedly extending vectors takes a lot of time. You can do what you want with d2 <- split(values, factor(numbers, levels=unique(numbers))) If you would like the labels on d2 to be in numeric order then you can simplify that to d3 <- split(values, numbers) Bill Dunlap TIBCO Software wdunlap

Re: [R] How to speed up list access in R?

2014-10-30 Thread Jeff Newmiller
Look at sqldf or data.table packages. Lists are slow for lookup and not particularly efficient with memory. numeric indexing into matrices or data frames is more typical in R, and the above mentioned packages support indexing to speed up lookups. Also, carefully consider whether you can program

Re: [R] How to speed up list access in R?

2014-10-30 Thread Olivier Crouzet
Hi, perhaps pre-generating the list before processing would speed it up significantly. Though it may still be slower than python. e.g. try something like: d = as.list(rep(NA,length(numbers))) rather than: d = list() Olivier. On Thu, 30 Oct 2014 11:17:59 -0400 Thomas Nyberg wrote: > Hello,

Re: [R] Putting R script in a function.

2014-10-30 Thread John Wasige
Hello community, I need help on how I can perform PCA on stacked raster (multiple bands/ layers) in R. Does any body have an idea or script? Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/m

[R] RForcecom VERY SLOW on large data sets

2014-10-30 Thread Ryszard Czermiński
I started using RForcecom package to extract data from SalesForce. It works very well for data sets with ~< 100K records, however for a data set with ~400K records it becomes VERY SLOW and export takes ~14h. For comparison exporting the same table as csv using "report export" in SalesForce takes a

Re: [R] foreach/dopar's processes accumulate RAM

2014-10-30 Thread Jeff Newmiller
Don't know the answer, partly because you have not shown enough of your code. The reason small, reproducible examples are specified in the footer and Posting Guide is to avoid this problem. AFAIK all of the parallel processing libraries in R re-use the child processes, so garbage collection coul

[R] How to speed up list access in R?

2014-10-30 Thread Thomas Nyberg
Hello, I want to do the following: Given a set of (number, value) pairs, I want to create a list l so that l[[toString(number)]] returns the vector of values associated to that number. It is hundreds of times slower than the equivalent that I would write in python. I'm pretty new to R so I be

Re: [R] dotplot with library lattice

2014-10-30 Thread Franklin Mairura
Dear all, This is bargraph.CI (sciplot package) qstn. How do you draw the bargraph while subsetting, rather than doing a series of subsets. there is a subset function within bargraph.CI, how is it implemented? Any advice, Thanks On Thursday, October 30, 2014 1:52 AM, Matthias Weber wrote:

Re: [R] dotplot with library lattice

2014-10-30 Thread Matthias Weber
Hi Jim, the graph looks at the moment nearly perfect. I have one last question. How can I change the scaling of the x-axis. At the moment i see the values at 0,20,40,60,80,100. My wish is, that the x-axis looks like the abline, so the scaling for the x-axis should be at 0,25,50,75,100. Thanks

[R] Oddity using multcompView package

2014-10-30 Thread Patrick Connolly
The multcompView has some useful features but I'm sure this isn't intentional. Excuse the size. This is about the smallest reproducible example I can do: require("multcompView") > mm <- structure(list(TempNom = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,

Re: [R] dotplot with library lattice

2014-10-30 Thread Jim Lemon
On Thu, 30 Oct 2014 09:25:53 AM Matthias Weber wrote: > Hi Jim, > > the graph looks at the moment nearly perfect. I have one last question. > How can I change the scaling of the x-axis. At the moment i see the values > at 0,20,40,60,80,100. > > My wish is, that the x-axis looks like the abline,