ys_extend | R Documentation |
Use this function to read and join another spec file to an existing
yspec
object. The additional spec file can contain additional columns
that might be added to the data set on an ad-hoc basis or could include
modeling outputs (e.g. IPRED
).
ys_extend(x, file = ys_extend_file(x), silent = FALSE)
x |
A |
file |
The path to a yaml specification file to load and join to |
silent |
Logical; if |
The extension is accomplished using ys_join()
, so any columns in the
extension spec that already exist in the primary spec are dropped. Use
ys_select()
on the the primary spec to drop columns that might be in the
extension and that you want to retain in the result.
If there are no new columns added by extension, that indicates all columns in the extension spec already exist in primary spec. In this case, a warning will be generated.
extension_file <- system.file("spec", "nm-extension.yml", package = "yspec")
spec <- ys_help$spec()
spec2 <- ys_extend(spec, extension_file)
tail(spec2)
ys_extend(spec)
## Not run:
# In case COL is in both the primary spec and the extension, but you want
# to retain what is in the extension
spec %>% select(-COL) %>% ys_extend("extension.yml")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.