Description Usage Arguments Author(s) See Also
View source: R/set_attributes_by_extract.R
This function makes use of setattr
from the
Matthew Dowle's data.table package to set attributes for
an an entire environment. The function can extract parts
of an object's name and assign it to some attribute. The
extraction uses str_extract
from Hadley
Wickham's stringr package.
1 2 | set_attributes_by_extract(env, label = "group",
extract_pattern = "[A-Z]{2}")
|
env |
an environment that contains all relevant objects |
label |
name of the attribute |
extract_pattern |
regular expression to extract a chunk of the object names |
Matthias Bannert
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.