Note: The code examples below are not evaluated (
eval = FALSE
) to comply with CRAN policies.
They require internet access, user credentials for Copernicus Marine Service,
and external Python dependencies, which are not permitted to run automatically in CRAN checks.
knitr::opts_chunk$set( collapse = TRUE, comment = "#>", eval = FALSE )
This vignette shows how to set up and use copernicusR to access Copernicus Marine data.
Before using this package, ensure that: 1. You have Python 3.7 or higher installed on your system. 2. You have a free Copernicus Marine account and valid credentials. 3. The copernicusmarine Python package is installed (handled via setup_copernicus()).
library(copernicusR) # Check if everything is ready copernicus_is_ready() # Set up using your credentials (replace with your actual values) setup_copernicus(username = "<your_username>", password = "<your_password>")
# Download sea surface temperature file <- copernicus_download( dataset_id = "cmems_mod_glo_phy_anfc_0.083deg_P1D-m", variables = "thetao", start_date = "2024-01-01", end_date = "2024-01-01", bbox = c(-10, 0, 35, 45), # Mediterranean subset output_file = file.path(tempdir(), "test_download.nc") )
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.