Do things for all tibbles in environment

171 views Asked by At

I have 110 tibbles in my environement. These tibbles are among other objects, but all tibbles have a common pattern. I know how to list them with ls(pattern = MyPattern). Now i need to do some basic work on each tibble. I have no idea at all how to handle this, as I will in fact work with a list of charcaters, not tibbles. I tried to assign these tibbles in a new env, but wasn't successful when reading them. I got lots of errors.

Anyone with a solution to apply some work to my selected tibbles?

1

There are 1 answers

1
Christoph Wolk On BEST ANSWER

You can use get and mget to access things by name. So this, for example, should work:

lapply(mget(ls(, pattern=MyPattern)), nrow)