ggOceanMaps
Plot oceanographic research data on maps using ggplot2
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
✓DOI references
Found 4 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.0%) to scientific vocabulary
Last synced: 10 months ago
·
JSON representation
Repository
Plot oceanographic research data on maps using ggplot2
Basic Info
Statistics
- Stars: 49
- Watchers: 2
- Forks: 7
- Open Issues: 5
- Releases: 7
Created about 6 years ago
· Last pushed about 1 year ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
message = FALSE,
warning = FALSE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
# ggOceanMaps
**Plot data on oceanographic maps using ggplot2. R package version `r packageVersion("ggOceanMaps")`**
[](https://doi.org/10.5281/zenodo.4554714)
[](https://github.com/MikkoVihtakari/ggOceanMaps/actions)
[](https://CRAN.R-project.org/package=ggOceanMaps)
## Overview
The ggOceanMaps package for [R](https://www.r-project.org/) allows plotting data on bathymetric maps using [ggplot2](https://ggplot2.tidyverse.org/reference). The package is designed for ocean sciences and greatly simplifies bathymetric map plotting anywhere around the globe. ggOceanMaps uses openly available geographic data. Citing the particular data sources is advised by the CC-BY licenses whenever maps from the package are published (see the [*Citations and data sources*](#citations-and-data-sources) section).
The ggOceanMaps package has been developed by the [Institute of Marine Research](https://www.hi.no/en). Note that the package comes with absolutely no warranty and that maps generated by the package are meant for plotting scientific data only. The maps are coarse generalizations of third-party data and therefore inaccurate. Any [bug reports and code fixes](https://github.com/MikkoVihtakari/ggOceanMaps/issues) are warmly welcomed. See [*Contributions*](#contributions) for further details.
## Installation
The package is available on [CRAN](https://CRAN.R-project.org/package=ggOceanMaps) and as a [GitHub version](https://github.com/MikkoVihtakari/ggOceanMaps), which is updated more frequently than the CRAN version.
Installation of the GitHub version:
```{r eval = FALSE}
remotes::install_github("MikkoVihtakari/ggOceanMaps")
```
Installation of the CRAN version:
```{r eval = FALSE}
install.packages("ggOceanMaps")
```
Note that >2.0 versions of ggOceanMaps do not require the ggOceanMapsData package any longer. Detailed map data are downloaded when needed from the [ggOceanMapsLargeData](#data-path) repository.
## Usage
**ggOceanMaps** extends on [**ggplot2**](http://ggplot2.tidyverse.org/reference/). The package uses spatial ([**sf**](https://r-spatial.github.io/sf/)) shape- (e.g. vector) and ([**stars**](https://r-spatial.github.io/stars/)) raster files, [geospatial packages for R](https://cran.r-project.org/web/views/Spatial.html) to manipulate, and ggplot2 to plot these data. The vector and raster plotting is conducted internally in the `basemap` function, which uses [ggplot's sf object plotting capabilities](https://ggplot2.tidyverse.org/reference/ggsf.html). Maps are plotted using the `basemap()` or `qmap()` functions that work almost similarly to [`ggplot()` as a base](https://ggplot2.tidyverse.org/reference/index.html) for adding further layers to the plot using the `+` operator. The maps generated this way already contain multiple ggplot layers. Consequently, the [`data` argument](https://ggplot2.tidyverse.org/reference/ggplot.html) needs to be explicitly specified inside `geom_*` functions when adding `ggplot2` layers. Depending on the location of the map, the underlying coordinates may be projected. Decimal degree coordinates need to be transformed to the projected coordinates using the `transform_coord`, [ggspatial](https://paleolimbot.github.io/ggspatial/), or [`geom_sf` functions.](https://ggplot2.tidyverse.org/reference/ggsf.html)
```{r}
library(ggOceanMaps)
dt <- data.frame(lon = c(-30, -30, 30, 30), lat = c(50, 80, 80, 50))
basemap(data = dt, bathymetry = TRUE) +
geom_polygon(data = transform_coord(dt), aes(x = lon, y = lat),
color = "red", fill = NA)
```
See the [ggOceanMaps website](https://mikkovihtakari.github.io/ggOceanMaps/index.html), [function reference](https://mikkovihtakari.github.io/ggOceanMaps/reference/index.html), and the [user manual](https://mikkovihtakari.github.io/ggOceanMaps/articles/ggOceanMaps.html) for how to use and modify the maps plotted by the package. You may also find [these slides about the package](https://aen-r-workshop.github.io/4-ggOceanMaps/ggOceanMaps_workshop.html#1) useful.
## Data path
While ggOceanMaps allows plotting any custom-made shapefiles, the package contains a shortcut to plot higher resolution maps for [certain areas needed by the author](https://mikkovihtakari.github.io/ggOceanMaps/articles/premade-maps.html) without the need of generating the shapefiles manually. These high-resolution shapefiles are downloaded from the [ggOceanMapsLargeData](https://github.com/MikkoVihtakari/ggOceanMapsLargeData) repository. As a default, the shapefiles are downloaded into a temporary directory meaning that the user would need to download the large shapefiles every time they restart R. This limitation is set by [CRAN policies](https://cran.r-project.org/web/packages/policies.html). You can define a custom folder for high-resolution shapefiles on your computer by modifying your .Rprofile file (e.g. `usethis::edit_r_profile()`). Add the following lines to the file:
```{r eval = FALSE}
.ggOceanMapsenv <- new.env()
.ggOceanMapsenv$datapath <- 'YourCustomPath'
```
It is smart to use a directory R has writing access to. For example `"~/ggOceanMapsLargeData"` would work for most operating systems.
You will need to set up the data path to your .Rprofile file only once and ggOceanMaps will find the path even though you updated your R or packages. ggOceanMaps will inform you about your data path when you load the package.
## Citations and data sources
The data used by the package are not the property of the Institute of Marine Research nor the author of the package. It is, therefore, important that you cite the data sources used in a map you generate with the package. The spatial data used by this package have been acquired from the following sources:
- **ggOceanMapsData land polygons.** [Natural Earth Data](https://www.naturalearthdata.com/downloads/10m-physical-vectors/) 1:10m Physical Vectors with the Land and Minor Island datasets combined. Distributed under the [CC Public Domain license](https://creativecommons.org/publicdomain/) ([terms of use](https://www.naturalearthdata.com/about/terms-of-use/)).
- **ggOceanMapsData glacier polygons.** [Natural Earth Data](https://www.naturalearthdata.com/downloads/10m-physical-vectors/) 1:10m Physical Vectors with the Glaciated Areas and Antarctic Ice Shelves datasets combined. Distributed under the [CC Public Domain license](https://creativecommons.org/publicdomain/) ([terms of use](https://www.naturalearthdata.com/about/terms-of-use/)).
- **ggOceanMapsData bathymetry.** [NOAA National Centers for Environmental Information. 2022: ETOPO 2022 15 Arc-Second Global Relief Model. NOAA National Centers for Environmental Information. DOI: 10.25921/fd45-gt74](https://www.ncei.noaa.gov/products/etopo-global-relief-model). Distributed under the [U.S. Government Work license](https://www.usa.gov/government-works).
- **Detailed shapefiles of Svalbard and the Norwegian coast in [ggOceanMapsLargeData](https://github.com/MikkoVihtakari/ggOceanMapsLargeData)** are from [Geonorge.no](https://www.geonorge.no/). Distributed under the [CC BY 4.0 license](https://creativecommons.org/licenses/by/4.0/).
- **Detailed land polygons of Europe.** [European Environment Agency](https://www.eea.europa.eu/en/datahub/datahubitem-view/af40333f-9e94-4926-a4f0-0a787f1d2b8f). The coastline is a hybrid product obtained from satellite imagery from two projects: EUHYDRO (Pan-European hydrographic and drainage database) and GSHHG (A Global Self-consistent, Hierarchical, High-resolution Geography Database), as well as some manual amendments to meet requirements from EU Nature Directives, Water Framework Directive and Marine Strategy Framework. Distributed under the [CC BY 4.0 license](https://creativecommons.org/licenses/by/4.0/) ([terms of use](https://www.eea.europa.eu/en/legal-notice))
Further, please cite the package whenever maps generated by the package are published. For up-to-date citation information, please use:
```{r}
citation("ggOceanMaps")
```
## Getting help
If your problem does not involve bugs in ggOceanMaps, the quickest way of getting help can be posting your problem to [Stack Overflow](https://stackoverflow.com/search?q=ggoceanmaps). Alternatively, you are welcome to use the [issues section](https://github.com/MikkoVihtakari/ggOceanMaps/issues) on GitHub. Please remember to include a reproducible example that illustrates your problem and to add links to potential cross-posts.
## Contributions
Any contributions to the package are more than welcome. Please contact the package maintainer Mikko Vihtakari () to discuss your ideas on improving the package. Bug reports and corrections should be submitted directly to [the GitHub site](https://github.com/MikkoVihtakari/ggOceanMaps/issues). Please include a [minimal reproducible example](https://en.wikipedia.org/wiki/Minimal_working_example). Considerable contributions to the package development will be credited with authorship.
Owner
- Name: Mikko Vihtakari
- Login: MikkoVihtakari
- Kind: user
- Location: Tromsø, Norway
- Company: Institute of Marine Research
- Website: https://stackoverflow.com/users/1082004/mikko
- Repositories: 4
- Profile: https://github.com/MikkoVihtakari
Marine ecologist. Statistical challenges and visual presentation of complex data are among my favorite professional interests.
GitHub Events
Total
- Issues event: 3
- Watch event: 4
- Delete event: 1
- Issue comment event: 6
- Push event: 2
- Create event: 1
Last Year
- Issues event: 3
- Watch event: 4
- Delete event: 1
- Issue comment event: 6
- Push event: 2
- Create event: 1
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| MikkoVihtakari | m****i@h****o | 120 |
| Vihtakari | a****7@H****o | 9 |
| Yves Reecht | Y****t@h****o | 2 |
| Mikko Vihtakari | m****i@g****m | 1 |
| SESjo | j****a@i****m | 1 |
| Vihtakari | a****7@h****o | 1 |
Committer Domains (Top 20 + Academic)
hi.no: 3
hi-11155.hi.no: 1
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 41
- Total pull requests: 4
- Average time to close issues: 2 months
- Average time to close pull requests: about 2 hours
- Total issue authors: 28
- Total pull request authors: 3
- Average comments per issue: 3.8
- Average comments per pull request: 0.75
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 2
- Pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- MikkoVihtakari (10)
- rsbivand (2)
- eaalto (2)
- yiyuanbi (2)
- thomasp85 (1)
- robwschlegel (1)
- tsippel10 (1)
- MiaWege (1)
- difontaine (1)
- NicoSchiff (1)
- arr-student (1)
- flaszlok (1)
- barbarabayer (1)
- mkmor (1)
- TineNilsen (1)
Pull Request Authors
- MikkoVihtakari (2)
- yreecht (1)
- SESjo (1)
Top Labels
Issue Labels
bug (13)
enhancement (3)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 573 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 8
- Total maintainers: 1
cran.r-project.org: ggOceanMaps
Plot Data on Oceanographic Maps using 'ggplot2'
- Homepage: https://mikkovihtakari.github.io/ggOceanMaps/
- Documentation: http://cran.r-project.org/web/packages/ggOceanMaps/ggOceanMaps.pdf
- License: GPL-3
-
Latest release: 2.2.0
published over 2 years ago
Rankings
Stargazers count: 7.8%
Forks count: 8.7%
Downloads: 16.0%
Average: 17.0%
Dependent repos count: 23.9%
Dependent packages count: 28.7%
Maintainers (1)
Last synced:
10 months ago
Dependencies
DESCRIPTION
cran
- R >= 3.5.0 depends
- ggplot2 * depends
- ggspatial * depends
- dplyr * imports
- methods * imports
- parallel * imports
- raster * imports
- rgeos * imports
- sf * imports
- smoothr * imports
- sp * imports
- stars * imports
- units * imports
- utils * imports
- cowplot * suggests
- ggOceanMapsData * suggests
- ggnewscale * suggests
- knitr * suggests
- rgdal * suggests
- rmarkdown * suggests
- scales * suggests
.github/workflows/R-CMD-check.yaml
actions
- actions/checkout v2 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite