Filtering a list of data frames by date

  Kiến thức lập trình

I am fairly new to R and have a list of data frames which I only want to include data from 2013/14 onwards.

I have assigned df1, df2, df3, df4 to a list named FYdflist. I have assigned 2013/14 as ‘b’. All of the data frames have the year column named as ‘FinancialYear’. Where am I going wrong with the following code or is there a better way?

FYdflist <- lapply(FYdflist, function(x) {filter(x[‘FinancialYear’] >= ‘b’)})

I suspect its something to do with that lapply doesn’t overwrite the original df in the list. How can I do that?

Thanks!

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website Kho Theme wordpress Kho Theme WP Theme WP

LEAVE A COMMENT