I have a list called list.data with over 600 dataframes in it. Each data frame has a unique name e.g. 4dMU6_20080605tp.txt and within the name is a date "20080605" that I want to extract and add to a new column in each dataframe.
I have created the new column in each dataframe with the column title "Date" but now need to extract the numbers from multiple dataframe names- any idea how I could do this?
I've tried sapply but presumably it doesn't work as it is searching the dataframes as oppossed to the dataframe names.
sapply(list.data, function(x){as.numeric(x[8])})
Any help would be greatly appreciated!