CopernicusMarine
Subset and download marine data from the EU Copernicus Marine Service Information to import data on the physical and biogeochemical state of the oceans without the need for external software.
https://github.com/pepijn-devries/copernicusmarine
Category: Hydrosphere
Sub Category: Ocean and Hydrology Data Access
Keywords
data spatial
Last synced: about 23 hours ago
JSON representation
Repository metadata
Subset and download marine data from EU Copernicus Marine Service Information. Import data on the oceans physical and biogeochemical state from Copernicus into R without the need of external software.
- Host: GitHub
- URL: https://github.com/pepijn-devries/copernicusmarine
- Owner: pepijn-devries
- License: gpl-3.0
- Created: 2023-01-15T00:57:40.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-10-13T06:45:53.000Z (20 days ago)
- Last Synced: 2025-10-22T06:35:18.602Z (11 days ago)
- Topics: data, spatial
- Language: R
- Homepage: https://pepijn-devries.github.io/CopernicusMarine/
- Size: 19.1 MB
- Stars: 30
- Watchers: 2
- Forks: 5
- Open Issues: 1
- Releases: 5
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
README.Rmd
---
output: github_document
---
```{r settings, echo = FALSE, message = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
library(CopernicusMarine)
```
# CopernicusMarine
[](https://github.com/pepijn-devries/CopernicusMarine/actions/workflows/R-CMD-check.yaml)

[](https://CRAN.R-project.org/package=CopernicusMarine)
[](https://cran.r-project.org/web/checks/check_results_CopernicusMarine.html)
[](https://pepijn-devries.r-universe.dev/CopernicusMarine)
[](https://app.codecov.io/gh/pepijn-devries/CopernicusMarine?branch=master)
## Overview
[Copernicus Marine Service Information](https://marine.copernicus.eu/about) is a programme subsidised by the
European Commission. Its mission is to provide free authoritative information on the oceans physical and
biogeochemical state. The `CopernicusMarine` R package is developed apart from this programme and facilitates
retrieval of information from . With the package you can:
* List available marine data for Copernicus and provide meta-information.
* Download and use the data directly in R.
## Why use `CopernicusMarine`
Copernicus Marine offers access to their data services through a
[Python application interface](https://pypi.org/project/copernicusmarine/).
For R users this requires complex installation procedures and is difficult to maintain in
a stable R package. The `CopernicusMarine` R package has
a much simpler installation procedure (see below) and does not depend on
third party software, other than packages available from [CRAN](https://cran.r-project.org/).
## Installation
Install CRAN release:
```{r install1, eval=FALSE}
install.packages("CopernicusMarine")
```
Install latest developmental version from R-Universe:
```{r install2, eval=FALSE}
install.packages("CopernicusMarine", repos = c('https://pepijn-devries.r-universe.dev', 'https://cloud.r-project.org'))
```
## Usage
The package provides an interface between R and the Copernicus Marine services. Note that for some of these
services you need an account and have to comply with
[specific terms](https://marine.copernicus.eu/user-corner/service-commitments-and-licence). The usage section
briefly shows three different ways of obtaining data from Copernicus:
* [Downloading a subset](#sec-subset)
* [Downloading a full dataset](#sec-full)
* [Using the WMTS server](#sec-wtms)
Please check the manual for complete documentation of the package.
Downloading a subset
The example below demonstrates how to subset a specific layer for a specific product. The subset is constrained by
the `region`, `timerange` and `verticalrange` arguments. The subset is downloaded to memory
represented as a [`stars`](https://r-spatial.github.io/stars/) object.
```{r download-subset, eval=TRUE, fig.alt="Example plots of downloaded subsets"}
my_data <-
cms_download_subset(
product = "GLOBAL_ANALYSISFORECAST_PHY_001_024",
layer = "cmems_mod_glo_phy-cur_anfc_0.083deg_P1D-m",
variable = c("uo", "vo"),
region = c(-1, 50, 10, 55),
timerange = c("2025-01-01", "2025-01-02"),
verticalrange = c(0, -2),
progress = FALSE
)
plot(my_data["vo"], col = hcl.colors(100), axes = TRUE)
```
You can also use the request code from the Copernicus Marine Service website
to download a subset. For more details see `vignette("translate")`
Downloading a complete Copernicus marine product
If you don't want to subset the data and want the complete set, you can download
complete native files, if these are available for your product.
You can list available files with (restricted to first 10 results with `max=10`):
```{r native1}
native_files <-
cms_list_native_files(
"GLOBAL_ANALYSISFORECAST_PHY_001_024",
"cmems_mod_glo_phy-cur_anfc_0.083deg_P1D-m",
max = 10)
native_files
```
Downloading a specific (or multiple file) can be done with:
```{r native2, eval=FALSE}
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"
)
```
The file, whose file name matches the pattern, will be stored in the specified destination folder.
By default the progress is printed as files can be very large and may take some time to download.
Copernicus Web Map Tile Services (WMTS)
Web Map Tile Services (WMTS) allow to quickly plot pre-rendered images onto a map. This may not be useful when
you need the data for analyses but is handy for quick visualisations, inspection or presentation of data.
In R it is very easy to add WMTS layers to an interactive map using [leaflet](https://rstudio.github.io/leaflet/).
This page is rendered statically and resulting in a non-interactive map.
```{r leaflet, eval=TRUE, message=FALSE, warning=FALSE, fig.alt="Static example image of a leaflet map"}
leaflet::leaflet() |>
leaflet::setView(lng = 3, lat = 54, zoom = 4) |>
leaflet::addProviderTiles("Esri.WorldImagery") |>
addCmsWMTSTiles(
product = "GLOBAL_ANALYSISFORECAST_PHY_001_024",
layer = "cmems_mod_glo_phy-thetao_anfc_0.083deg_P1D-m",
variable = "thetao"
)
```
### Citing the data you use
A Copernicus account comes with several terms of use. One of these is that you
[properly cite](https://help.marine.copernicus.eu/en/articles/4444611-how-to-cite-copernicus-marine-products-and-services)
the data you use in publications. In fact, we also have credit the data used in this documentation, which can be easily
done with the following code:
```{r cite, eval=TRUE}
cms_cite_product("GLOBAL_ANALYSISFORECAST_PHY_001_024")$doi
```
## More of Copernicus
More R packages for exploring other Copernicus data services:
* [CopernicusClimate](https://github.com/pepijn-devries/CopernicusClimate)
Dedicated to climate change datasets
## Resources
```{r, eval=TRUE, echo=FALSE}
cop_det <- cms_product_details("GLOBAL_ANALYSISFORECAST_PHY_001_024")
```
* [E.U. Copernicus Marine Service Information](https://data.marine.copernicus.eu)
* `r sprintf("[%s - %s (%s); DOI:%s](https://doi.org/%s)", cop_det$title, cop_det$id, cop_det$properties$creationDate, cop_det[["sci:doi"]], cop_det[["sci:doi"]])`
## Code of Conduct
Please note that the CopernicusMarine project is released with a [Contributor Code of Conduct](https://pepijn-devries.github.io/CopernicusMarine/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
Owner metadata
- Name:
- Login: pepijn-devries
- Email:
- Kind: user
- Description:
- Website:
- Location:
- Twitter: pepijn_devries
- Company:
- Icon url: https://avatars.githubusercontent.com/u/13707449?u=f66d5b7fe8ed105c9bbe946f944af08f789a2133&v=4
- Repositories: 3
- Last ynced at: 2023-03-11T09:35:28.620Z
- Profile URL: https://github.com/pepijn-devries
GitHub Events
Total
- Issues event: 10
- Watch event: 4
- Delete event: 3
- Issue comment event: 48
- Push event: 106
- Pull request event: 53
- Fork event: 1
- Create event: 2
Last Year
- Issues event: 10
- Watch event: 4
- Delete event: 3
- Issue comment event: 48
- Push event: 106
- Pull request event: 53
- Fork event: 1
- Create event: 2
Committers metadata
Last synced: 5 days ago
Total Commits: 84
Total Committers: 3
Avg Commits per committer: 28.0
Development Distribution Score (DDS): 0.345
Commits in past year: 59
Committers in past year: 2
Avg Commits per committer in past year: 29.5
Development Distribution Score (DDS) in past year: 0.085
| Name | Commits | |
|---|---|---|
| pepijn-devries | p****2@g****m | 55 |
| Vries | p****s@w****l | 28 |
| Riccardo Soldan | 4****2 | 1 |
Committer domains:
- wur.nl: 1
Issue and Pull Request metadata
Last synced: 4 days ago
Total issues: 31
Total pull requests: 83
Average time to close issues: 3 months
Average time to close pull requests: 4 days
Total issue authors: 16
Total pull request authors: 2
Average comments per issue: 3.32
Average comments per pull request: 0.33
Merged pull request: 69
Bot issues: 0
Bot pull requests: 0
Past year issues: 8
Past year pull requests: 56
Past year average time to close issues: 4 days
Past year average time to close pull requests: 3 days
Past year issue authors: 4
Past year pull request authors: 1
Past year average comments per issue: 2.38
Past year average comments per pull request: 0.43
Past year merged pull request: 43
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- pepijn-devries (12)
- DevrekerD (2)
- dancrear (2)
- MauroMardones (2)
- raymondben (2)
- ValentinTeillard (1)
- teuzindahuz (1)
- RSO9192 (1)
- sermomon (1)
- Ge0rges (1)
- ericward-noaa (1)
- shahar710 (1)
- elifrag (1)
- LuisLauM (1)
- pvanlaake (1)
Top Pull Request Authors
- pepijn-devries (81)
- RSO9192 (2)
Top Issue Labels
- enhancement (5)
- duplicate (2)
- bug (1)
Top Pull Request Labels
Package metadata
- Total packages: 3
-
Total downloads:
- cran: 758 last-month
- Total dependent packages: 1 (may contain duplicates)
- Total dependent repositories: 0 (may contain duplicates)
- Total versions: 22
- Total maintainers: 1
proxy.golang.org: github.com/pepijn-devries/copernicusmarine
- Homepage:
- Documentation: https://pkg.go.dev/github.com/pepijn-devries/copernicusmarine#section-documentation
- Licenses: gpl-3.0
- Latest release: v0.2.0 (published almost 2 years ago)
- Last Synced: 2025-10-29T16:34:00.581Z (4 days ago)
- Versions: 5
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
proxy.golang.org: github.com/pepijn-devries/CopernicusMarine
- Homepage:
- Documentation: https://pkg.go.dev/github.com/pepijn-devries/CopernicusMarine#section-documentation
- Licenses: gpl-3.0
- Latest release: v0.2.0 (published almost 2 years ago)
- Last Synced: 2025-10-29T16:34:10.744Z (4 days ago)
- Versions: 5
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
cran.r-project.org: CopernicusMarine
Search Download and Handle Data from Copernicus Marine Service Information
- Homepage: https://github.com/pepijn-devries/CopernicusMarine
- Documentation: http://cran.r-project.org/web/packages/CopernicusMarine/CopernicusMarine.pdf
- Licenses: GPL (≥ 3)
- Latest release: 0.3.2 (published 22 days ago)
- Last Synced: 2025-10-29T16:34:03.165Z (4 days ago)
- Versions: 12
- Dependent Packages: 1
- Dependent Repositories: 0
- Downloads: 758 Last month
-
Rankings:
- Forks count: 21.888%
- Stargazers count: 22.49%
- Average: 27.776%
- Downloads: 29.252%
- Dependent packages count: 29.797%
- Dependent repos count: 35.455%
- Maintainers (1)
Dependencies
- R >= 3.5.0 depends
- crayon * imports
- dplyr * imports
- httr * imports
- jsonlite * imports
- leaflet * imports
- purrr * imports
- readr * imports
- rvest * imports
- sf * imports
- stringr * imports
- utils * imports
- xml2 * imports
- lifecycle * suggests
- stars * suggests
- testthat >= 3.0.0 suggests
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
Score: 11.165917926433632