I want to redefine propperly elements of a multidimensional matrix using assign
on R.
I tried this
lat = 3
lon = 3
laidx = 1:3
loidx = 1:3
OtherDF is a 3x3 multidimensional matrix, and each element is a large data frame
for (i in 1:12){
assign(paste("STAT",i,sep=""),array(list(NA), dim=c(length(lat),length(lon))))
for (lo in loidx){
for (la in laidx){
assign(paste("STAT",i,"[",la,",",lo,"]",sep=""), as.data.frame(do.call(rbind,otherDF[la,lo])))
# otherDF[la,lo] are data frames
}
}
}
First I created 12 empty matrix STATS1,STATS2 ,...,STATS12 (I need 12, one for each month)
Then I tried to fill them with elements of an other dataframe, but instead of filling it create a lot of new variables like this `STAT10[[1,1]]``
Some help please