file_sizes | R Documentation |
file_sizes
takes the final date for which SMR data are
included in the current publication and the filepath to the location of the
HSMR Excel tables. It returns a character
vector containing the size
of each table.
file_sizes(end_date, filepath = here::here("data", "output"))
end_date |
The cut-off date for data to be included in the current HSMR
publication, supplied with |
filepath |
A |
There are three HSMR Excel tables: tables 1, 2 and 3. If fewer or more Excel tables which follow the same naming conventions as tables 1, 2 and 3 are found in the filepath, the function will return an error.
File sizes are returned in kilobytes (KB) or megabytes (MB). A kilobyte is taken to be 1,024 bytes, and a megabyte to be 1,024 kilobytes.
A character
vector.
The code which creates this function uses regular expressions. For more information on using regular expressions, see this Jumping Rivers blog post and this vignette from the stringr package.
extract_end_date <- lubridate::dmy(31032019)
file_sizes(end_date = extract_end_date)
file_sizes(end_date = extract_end_date, filepath = getwd())[1]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.