0

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

2
  • 1
    take 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. Dec 6, 2022 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 6, 2022 at 15:30

0

Browse other questions tagged or ask your own question.