Re: [R] Recoding multiple TRUE/FALSE columns into a single list of TRUE columns

2011-12-25 Thread David Epstein
Jim, Wow, that does it! I think I can use strsplit and unlist to convert the string of row names into a R list. thank you! -david __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http:

Re: [R] need help with a time series plotting problem

2011-12-25 Thread Rui Barradas
vibhava wrote > > Dear R Users, > I am a beginner in R programming and need some help > with a simple plotting problem that i am having. My dataset consist of > three columns: first one has data_id, second is the date and third is the > actual data itself corresponding to eac

Re: [R] if statement problem

2011-12-25 Thread Rui Barradas
Hello again. I don't understand what didn't work. First, it seems better to use 'nrow', the result is the same stopifnot(length(x[,1]) == nrow(x)) Then your multiple OR condition. #if((x[i,1] || x[i,2] || x[i,3] || x[i,4]) < 5) x <- matrix(1:24, ncol=4) for(i in 1:nrow(x)) if(any(x

Re: [R] Recoding multiple TRUE/FALSE columns into a single list of TRUE columns

2011-12-25 Thread jim holtman
Try this: > x <- read.table(text = " P1 P2 P3 P4 + 1 0011 + 2 0111 + 3 1000 + 4 0000 + 5 1111 ", header = TRUE) > labs <- apply(x, 1, function(.row){ + indx <- which(.row == 1) + if (length(indx) > 0) return(pas

Re: [R] linear interpolation of time series

2011-12-25 Thread R. Michael Weylandt
Agreed with David - if you don't even know how many points there are between your observations, you can't do any meaningful interpolation. Perhaps something like out <- seq(min(x), max(x), length.out = 20) But that has it's own presumptions. Perhaps talk a little about your data and how the

[R] Recoding multiple TRUE/FALSE columns into a single list of TRUE columns

2011-12-25 Thread David Epstein
Hi everyone, I need to recode multiple columns in a dataframe into a single column in a variety of different ways. Often the values will be TRUE/FALSE and I want a list of the columns that are true as in the Result column below: P1 P2 P3 P4 Result 1 0011P3,P4 2

Re: [R] Error message "No regressors provided" in auto.arima

2011-12-25 Thread Michael
Here is the code: Y=mydata X=cbind(1:length(dY)) results=auto.arima(dY, xreg=dX) Of course I could first do a linear regression external to auto.arima, and then combine the forecasts from both of the linear regression part and the residual arima part... But it would be great if the "au

[R] Error message "No regressors provided" in auto.arima

2011-12-25 Thread Michael
Happy holidays! Could you please help with the error message "No regressors provided" when using "auto.arima"? What could have happened? Thanks a lot! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz

Re: [R] linear interpolation of time series

2011-12-25 Thread David Winsemius
On Dec 25, 2011, at 4:12 PM, Alemtsehai Abate wrote: Dear Michael, Thanks for your prompt response. na.approx in zoo does fine if we have some time metric. But in my case, we don't know the time points which the data values correspond to. The given values in x and y are irregularly observed

Re: [R] overlaid filled contour plots: solved

2011-12-25 Thread Michael Friendly
MerryXmas() to R-help! No one answered this query, but I found an easy solution that others may find useful, using a wrapper for contour() that calls contourLines() and then replots the contours using polygon(). It could use a little tuning (easier way to specify fill.alpha) to make it a gener

Re: [R] linear interpolation of time series

2011-12-25 Thread Alemtsehai Abate
Dear Michael, Thanks for your prompt response. na.approx in zoo does fine if we have some time metric. But in my case, we don't know the time points which the data values correspond to. The given values in x and y are irregularly observed values at unequal distances in time. My objective is just to

Re: [R] On Corrections for Chi-Sq Goodness of Fit Test

2011-12-25 Thread Michael Fuller
Hi Rolf, Thank you for clarifying. After reading the help page over more carefully, I realize that I misunderstood what chisq.test. was doing. I thought it was using simulation whenever the expected frequencies were given using the "p" argument, whereas it used the asymptotic chi-squared distrib

Re: [R] Custom XML Readers

2011-12-25 Thread Duncan Temple Lang
In addition to the general tools of the XML package, I also had code that read documents with a similar structure to the ones Andy illustrated. I put them and simple examples of using them at the bottom of http://www.omegahat.org/RSXML/ page. D. On 12/23/11 5:50 PM, Ben Tupper wrote: > Hi

Re: [R] if statement problem

2011-12-25 Thread Uwe Ligges
On 24.12.2011 12:03, reena wrote: It didn't work. :( What did not work??? Please do not misuse the R-help mailing list! Its posting guide clearly asks you to cite the thread and specify reproducible examples that make other able to help. Best, Uwe Ligges -- View this message in cont