I need to fill in a number of columns for multiple data frames (about 70). I write a function to do this, below:
trial<-function(x){
eval(as.symbol(x))[,1]<-1:nrow(x)
}
I then create a collection of 70 strings, each one representing the name of the dataframe.
When I pass a string through this function, it breaks and says that "could not find function "eval<-"". Any suggestions please - I'd be grateful if anybody knows why this is.
Note: Would prefer not to use apply, as I intend to carry out more data manipulations within the trial(x) function.
Thanks A