I have a list of dataframes, whose columns have names.
If I want to change the names of the dataframes within the list (rather than the names of the parent list), I
You can use setNames...
lapply( y , setNames , nm = c('Op', 'Hi', 'Lo', 'Clo') )
#[[1]]
# Op Hi Lo Clo
#2007-01-02 50.03978 50.11778 49.95041 50.11778
#2007-01-03 50.23050 50.42188 50.23050 50.39767
#2007-01-04 50.42096 50.42096 50.26414 50.33236
# ... ... ... ... ...
Quoting directly from the help page:
This is a convenience function that sets the names on an object and returns the object. It is most useful at the end of a function definition where one is creating the object to be returned and would prefer not to store it under a name just so the names can be assigned.