Skip to content

R

The oceanum-R package provides read-only access to the Oceanum Datamesh from R.

  • R version 4.5.1 or later

Install from GitHub:

# Install devtools if needed
install.packages("devtools")
# Install oceanum-R
devtools::install_github("oceanum-io/oceanum-R")

Set your Datamesh token as an environment variable:

Sys.setenv(DATAMESH_TOKEN = "your-token-here")
library(oceanum)
# Initialize connector
connector <- Connector$new()
# Browse the catalog
catalog <- connector$get_catalog()
print(catalog)
# Search for datasets
results <- connector$get_catalog("wave")
# Load a datasource
data <- connector$load_datasource("datasource-id")
# Execute a query with filters
query_input <- list(
datasource = "datasource-id",
limit = 1000
)
result <- connector$query(query_input)
  • Catalog browsing - Search and discover datasets
  • Data loading - Load datasources as R data frames or NetCDF structures
  • OceanQL queries - Filter by space, time, and variables
  • Query size limits - Automatic error messaging for large queries
  • Session management - Automatic authentication handling

Compared to the Python library, the R version:

  • Read-only access (no write operations)
  • Synchronous operations only
  • Limited format support

The API mirrors the Python library. For detailed guidance, refer to the Python documentation.

GitHub: github.com/oceanum-io/oceanum-R