I have an interesting problem:
I need to batchprocess a few files. I do that in a for-loop, where some operations are performed. Later on I want to write the outcome into an existing shapefile which I do like so:
myShapeFile@data <- data.frame(myShapeFile@data, dynamicColumnName = VALUE)
The dynamicColumnName gets created dynamically – depending what statistic is performed and so on. Meaning: The name is stored in the variable.
So dynamicColumnName could be “2245″, in the next iteration of the loop or “0000″ or “3334″ and so on.
However, the function above does not accept the “characters/integers” stored in the variable. Each column gets named dynamicColumnName.
Any ideas how to not let this happen?