Re: [R] Extending data frame with longer columns

2010-02-17 Thread Gabor Grothendieck
If your data frame only has numeric entries you could represent it as a multivariate ts time series in which case this works: > xx <- ts(cbind(a = 1:2, b = 3:4, c = 5:6)); xx Time Series: Start = 1 End = 2 Frequency = 1 a b c 1 1 3 5 2 2 4 6 > cbind(a = ts(1:4), b = xx[, "b"], c = xx[, "c"]) Tim

Re: [R] Extending data frame with longer columns

2010-02-17 Thread David Winsemius
On Feb 17, 2010, at 4:00 AM, Ralf B wrote: Hi, I am a beginner in R and have only read a few chapters in the R book, Which "R book"? I was not able to find a solution for this simple problem. I have an empty data frame: a=data.frame(name="test") No, you have a dataframe with one column

Re: [R] Extending data frame with longer columns

2010-02-17 Thread Paul Hiemstra
Ralf B wrote: Hi, I am a beginner in R and have only read a few chapters in the R book, I was not able to find a solution for this simple problem. I have an empty data frame: a=data.frame(name="test") which I would like to extend in a for-loop (with data extracted from a database). Ideally I