Download raw files as provided to Copernicus Marine
Source:R/cms_download_native.R
cms_download_native.Rd
Full marine data sets can be downloaded using the functions
documented here. Use
cms_list_native_files()
to list available files, and
cms_download_native()
to download specific files. Files are usually organised per product,
layer, year, month and day.
Usage
cms_download_native(
destination,
product,
layer,
pattern,
prefix,
progress = TRUE,
...
)
cms_list_native_files(product, layer, pattern, prefix, ...)
Arguments
- destination
Path where to store the downloaded file(s).
- product
An identifier (type
character
) of the desired Copernicus marine product. Can be obtained withcms_products_list
.- layer
The name of a desired layer within a product (type
character
). Can be obtained withcms_product_details
.- pattern
A regular expression (regex) pattern. Only paths that match the pattern will be returned. It can be used to select specific files. For instance if
pattern = "2022/06/"
, only files for the year 2022 and the month June will be listed (assuming that the file path is structured as such, see examples)- prefix
A
character
string. A prefix to be added to the search path of the files. Only the matching file (info) is downloaded (generally faster then usingpattern
)- progress
A
logical
value. WhenTRUE
a progress bar is shown.- ...
Ignored
Examples
if (interactive()) {
cms_list_native_files(
product = "GLOBAL_ANALYSISFORECAST_PHY_001_024",
layer = "cmems_mod_glo_phy_anfc_0.083deg_PT1H-m",
prefix = "2022/06/"
)
## Use 'pattern' to download a file for a specific day:
cms_download_native(
destination = tempdir(),
product = "GLOBAL_ANALYSISFORECAST_PHY_001_024",
layer = "cmems_mod_glo_phy_anfc_0.083deg_PT1H-m",
prefix = "2022/06/",
pattern = "m_20220630"
)
}