Getting Started with copernicusR

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.

This vignette shows how to set up and use copernicusR to access Copernicus Marine data.

Prerequisites

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()).

Basic Setup

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 Example

# 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")
)