I have a bunch of different data frames and I want to run the same custom function to each of them. I want the output returned into each of the original data frame names, not in a list.
Let's say I have a bunch of different data frames:
mtcars1, mtcars2, mtcars3.....mtcars20. Each of these will have different factor levels on say the CYL column. I want to run a function that:
- returns the CYL value to a number from a factor - as.numeric(as.character())
- calculates some new column that is a rolling average of mpg.
Now what is the code to do that and apply this function? Again I want the output to all be mtcars1...mtcars20 data frames.
I have tried looking at
lapply(mylist=c(mtars1...mtcars20) function(x) myfunct())
but I am running into trouble.