in python to parse all the variables that have a name ending for example with "_df" I would use something similar to what I found here. How to do a similar thing in R? Namely, I have several variables ending with _df and I have to do some actions to these. Thanks
Asked
Active
Viewed 34 times
0
-
1take a look at `ends_with` from dplyr or use `grep(".*_df$", your_files_names)` to locate files. This a general answer since your question is to broad. Provide a minimal example and we can help you better. – Jilber Urbina Dec 06 '22 at 15:28
-
Sounds like you want `mget(ls(pattern = "_df$"))` It would be better to keep such related values in a list in the first place in R rather than separate variables in the global environment. – MrFlick Dec 06 '22 at 15:30