| data_add | R Documentation |
Registers an existing data file with the Framework data catalog. This allows
you to track files that were created outside of Framework (e.g., downloaded
from external sources, copied from other projects) and use them with
data_read() using dot notation.
data_add(
file_path,
name = NULL,
type = NULL,
delimiter = "comma",
locked = TRUE,
update_config = TRUE
)
file_path |
Path to the existing file (must exist) |
name |
Optional dot notation name for the data catalog (e.g., |
type |
Optional type override. Auto-detected from file extension if NULL. |
delimiter |
Delimiter for CSV files ("comma", "tab", "semicolon", "space") |
locked |
Whether the file should be locked (hash-verified on read) |
update_config |
If TRUE (default), also updates the YAML config with the data spec |
Invisibly returns the data spec that was created
if (FALSE) {
# Add a downloaded CSV file to the catalog
data_add("inputs/raw/survey_results.csv", name = "inputs.raw.survey_results")
# Now you can read it with dot notation
data_read("inputs.raw.survey_results")
# Add with auto-generated name
data_add("inputs/intermediate/cleaned_data.rds")
# Name will be derived as "inputs.intermediate.cleaned_data"
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.