I have a lot of vectors loaded and I want to select them by their name. For example: vector name is a_b
and a_c
, within a function I do sth like
name <- paste0('a','_','b')
. How can I do that in R?
Asked
Active
Viewed 17 times
1

OnLeRo
- 83
- 1
- 6
-
1In theory you can do that with `get()` but that's not really something that is recommended. How did all these variables get created in the first place? If you have a bunch of related variables with information in their names, its much easier to work with then as a named list of values in R. So it's probably worth taking a step back to look how you got into this problem in the first place. – MrFlick Jun 20 '19 at 18:24
-
This helped a lot, thanks! – OnLeRo Jun 20 '19 at 21:15