View source: R/generate_filenames.R
generate_filenames | R Documentation |
This is a more flexible replacement for the get_filenames
function. The main difference is that it allows you to pass any argument that
might exist to be substituted in the file name. These arguments are passed
through ...
generate_filenames(
file_path = getwd(),
file_date = Sys.Date(),
start_date = NULL,
end_date = NULL,
by = "6h",
lags = "0s",
file_template = "fctable",
filenames_only = TRUE,
...
)
file_path |
The parent path to all file names. All file names are
generated to be under the |
file_date |
Forecast date for file names. Can be in YYYYMMDD, YYYYMMDDhh, YYYYMMDDhhmm, or YYYYMMDDhhmmss format. Can be numeric or charcter. If not passed the system time in YYYYMMDD format is used. |
start_date |
Date of the first forecast for file names. Can be in
YYYYMMDD, YYYYMMDDhh, YYYYMMDDhhmm, or YYYYMMDDhhmmss format. Can be
numeric or charcter. If NULL, |
end_date |
Date of the last forecast for file names. Can be in YYYYMMDD,
YYYYMMDDhh, YYYYMMDDhhmm, or YYYYMMDDhhmmss format. Can be numeric or
charcter. Used in conjunction with |
by |
The time between new forecasts. If numeric, it is assumed to be in
hours, but the time units may be given by a letter after the number where d
= days, h = hours, m = minutes and s = seconds. A sequence of forecasts
dates is generated from |
lags |
A named list of members of an ensemble forecast model that are
lagged and the amount by which they are lagged. The list names are the
names of those forecast models, as given in |
file_template |
A template for the file names. For available built in
templates see |
filenames_only |
Logical. If TRUE (the default), a vector of file names will be returned, otherwise if FALSE a data frame will be returned with the metadata that was used to generated the file names included. |
... |
Other arguments for substitutions in |
A character vector or a data frame.
generate_filenames(fcst_model = "my_model", parameter = "T2m")
generate_filenames(
fcst_model = "my_model",
lead_time = seq(0, 12),
file_template = "vfld",
filenames_only = FALSE
)
generate_filenames(
sub_model = "my_model",
lead_time = seq(0, 12),
file_template = "vfld_eps",
members = seq(0, 5)
)
generate_filenames(
start_date = 2020010100,
end_date = 2020013100,
by = "1d",
fcst_model = "my_model",
lead_time = seq(0, 3),
file_path = "/path/to/my/data",
file_template = "{fcst_model}_v{version}_{YYYY}{MM}{DD}{HH}{mm}{ss}_mbr{MBR5}+{LDT3}",
members = seq(0, 1),
version = c(2, 3, 5)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.