I want to read large arrays from .mat files into dynamically named ff files in R.
I tried the following:
for(i in 1:numFiles){
varName = paste0("ffInter",i) # name of the new ff variable
temp = readMat(Files[i]) #reads the array from .mat file
assign(varName, ff(vmode = "short", dim = dim(temp)) #preallocate new ff variable
assign(varName, temp) #assign the values to the ff variable
}
Problem: After the first "assign" everything is fine. But after the second "assign" the type of the variable "varName" changes to an ordinary array. With static variables you would do the assignment of values like this:
staticVarName[,] = temp
But how can I translate this to an dynamic statement? How can I take care of the "[,]", which are needed according to the ff package documentation?
Cheers and thanks in advance, tholor