Displaying 1 result from an estimated 1 matches for "somevectoroffactor".
Did you mean:
somevectoroffactors
2008 May 11
1
Creating data.frames dynamically
...c("a", "b", "c")
d <- data.frame(dates=Dates, a=vector(mode="numeric", length=length(Dates),
b=vector(mode="numeric", length=length(Dates), c=vector(mode="numeric",
length=length(Dates))
Then I copy the processed data into d
for(i in SomeVectorOfFactors){
for(N in Names){
d[[N]][i] <- FunctionCallOfSomeSort(i)
}
}
I want to create the data.frame, d, in the same style I access it.
d <- data.frame(dates=Dates, [[Names]]=vectors(.....))
Then it is much simpler to add new columns.
Worik...