I, stupidly, have been creating loads of new data_frames in an R project trying to solve a particular problem without making proper commits. Having gone through all practical names and most of the Greek alphabet, I now have an environment full of data_frame objects with names like 'bob','might.work','almostthere'. I'd like to use a looping function - lapply or otherwise - to return some indicators that will tell me something about each dataframe object in the environment. I can then clean up/delete based on the returns.
So is it possible to use lapply to access all data_frames in an R project environment? Something like this?
lapply(environment, function (x){
if(is.dataframe(x)){
dplyr::glimpse(x)
}
}
Thanks.
The
eapply()function easily iterates over objects in an environment