Re: [R] Creating data.frames dynamically

2008-05-11 Thread Yasir Kaheil
Hi Worik: Is this what you want? > Names <- letters[1:5]; > Dates<- 1:20; > d<- data.frame(dates=Dates, a = vector(mode="numeric", > length=length(Dates))); > for(i in 2:5){d[,paste(sep="",Names[i])]<-with(d,a)}; d dates a b c d e 1 1 0 0 0 0 0 2 2 0 0 0 0 0 3 3 0 0 0 0 0 4

[R] Creating data.frames dynamically

2008-05-10 Thread Worik R
I have time series data in named vectors. They are all the same length for the same dates. The dates are in a separate vector. I want to create a vector of numeric data for every named series, associated with the dates in a data.frame. So if... Names <- c("a", "b", "c") d <- data.frame(dates=