R
The oceanum-R package provides read-only access to the Oceanum Datamesh from R.
Requirements
Section titled “Requirements”- R version 4.5.1 or later
Installation
Section titled “Installation”Install from GitHub:
# Install devtools if neededinstall.packages("devtools")
# Install oceanum-Rdevtools::install_github("oceanum-io/oceanum-R")Authentication
Section titled “Authentication”Set your Datamesh token as an environment variable:
Sys.setenv(DATAMESH_TOKEN = "your-token-here")Quick Start
Section titled “Quick Start”Connect to the Datamesh
Section titled “Connect to the Datamesh”library(oceanum)
# Initialize connectorconnector <- Connector$new()
# Browse the catalogcatalog <- connector$get_catalog()print(catalog)
# Search for datasetsresults <- connector$get_catalog("wave")Load Data
Section titled “Load Data”# Load a datasourcedata <- connector$load_datasource("datasource-id")
# Execute a query with filtersquery_input <- list( datasource = "datasource-id", limit = 1000)result <- connector$query(query_input)Features
Section titled “Features”- 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
Limitations
Section titled “Limitations”Compared to the Python library, the R version:
- Read-only access (no write operations)
- Synchronous operations only
- Limited format support
Documentation
Section titled “Documentation”The API mirrors the Python library. For detailed guidance, refer to the Python documentation.
Source Code
Section titled “Source Code”GitHub: github.com/oceanum-io/oceanum-R