Is there a way to list objects based on their classes ? For example, list only the dataframe objects in the workspace.
Here is a way with sapply and class to retrieve the names of the objects in the environment that are data.frames:
ls()[sapply(ls(), function(i) class(get(i))) == "data.frame"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With