View source: R/get_filenames.R
get_filenames | R Documentation |
This function was deprecated as generate_filenames is superior.
get_filenames(
file_path = getwd(),
file_date = Sys.Date(),
start_date = NULL,
end_date = NULL,
by = "6h",
lags = NULL,
parameter = NULL,
det_model = NULL,
eps_model = NULL,
sub_model = NULL,
lead_time = seq(0, 48, 3),
members = NA_character_,
file_template = "fctable_eps",
filenames_only = TRUE,
...
)
file_path |
The static path to the data. |
file_date |
A single date - may be YYYYMMDD, YYYYMMDDHH, YYYYMMDDHHmm.
If it is not specified and |
start_date |
If specified it is assumed a range of dates will be
requested and |
end_date |
The end of a date range. Same format as for |
by |
The frequency of the date range. Should be a string of a number followed by a letter, where the letter gives the units - may be d for days, h for hours or m for minutes. |
lags |
For reading files from a lagged forecast with members run at
different times, the lag times are set here. The times are expressed as a
character vector, with a number followed by a letter giving the units. The
avialable units are d, h, m, s for days, hours, minutes and seconds. If
{MBRx} is in the template, it must be the same length as |
parameter |
If {parameter} exists in the the template this must be specified. |
det_model |
If {det_model} exists in the the template this must be specified. |
eps_model |
If {eps_model} exists in the the template this must be specified. |
sub_model |
If {sub_model} exists in the the template this must be specified. |
lead_time |
The lead times to be included in the file names if {LDTx} is in the template. Given as a vector of numbers. |
members |
The members to be included in the file names of {MBRx} is in the template |
file_template |
The file type to generate the template for. Can be any of the build in templates from show_file_templates. If anything else is passed, it is returned unmodified. In this case substitutions can be used. Available substitutions are YYYY for year, {MM} for 2 digit month with leading zero, {M} for month with no leading zero, and similarly {DD} or {D} for day, {HH} or {H} for hour, {mm} or {m} for minute. Also {LDTx} for lead time and {MBRx} for ensemble member where x is the length of the string including leading zeros - can be omitted or 2, 3 or 4. Note that the full path to the file will always be file_path/template. |
filenames_only |
Logical. Set to TRUE to return a vector of unique file names. Set to FALSE to return a detailed data frame. |
... |
Not used |
If filenames_only is TRUE, a vector of unique file names. If filenames_only is FALSE, a tibble with columns eps_model, sub_model, fcdate, file_name, lead_time and member.
get_filenames("/my/path", eps_model = "my_eps", parameter = "T2m")
get_filenames("/my/path", start_date = 20170101, end_date = 20170131, by
= "1d", eps_model = "my_eps", parameter = "T2m", file_template =
"harmonie_grib")
get_filenames("/my/path", start_date = 20170101, end_date = 20170131, by
= "1d", eps_model = "my_eps", parameter = "T2m", members = seq(0, 2),
file_template = "harmoneps_grib_fp")
get_filenames("/my/path", file_date = 20170101, parameter = "T2m",
members = seq(0, 2), file_template = "harmoneps_grib_fp")
get_filenames("/my/path", start_date = 20170101, end_date = 20170105, by
= "6h", eps_model = "my_eps", parameter = "T2m", members = seq(0,3),
lead_time = seq(0, 24, 6), file_template =
"{eps_model}/{YYYY}{MM}{DD}{HH}_mbr{MBR2}+{LDT}h")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.