Skip to content

Commit

Permalink
Back on CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
MikkoVihtakari committed Jan 10, 2022
1 parent bc28b1b commit aab1318
Show file tree
Hide file tree
Showing 30 changed files with 1,247 additions and 1,911 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
^LICENSE$
^NEWS\.md$
^ggOceanMapsData
^vignettes$
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: ggOceanMaps
Type: Package
Title: Plot Data on Oceanographic Maps using 'ggplot2'
Version: 1.2.5
Date: 2022-01-05
Version: 1.2.7
Date: 2022-01-10
Authors@R: c(person("Mikko", "Vihtakari", email = "mikko.vihtakari@hi.no",
role = c("aut", "cre"),
comment = c(affiliation = "Institute of Marine Research",
Expand Down Expand Up @@ -32,4 +32,3 @@ Additional_repositories: https://mikkovihtakari.github.io/drat
License: GPL-3
Encoding: UTF-8
RoxygenNote: 7.1.2
VignetteBuilder: knitr
2 changes: 1 addition & 1 deletion R/basemap.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ basemap <- function(x = NULL, limits = NULL, data = NULL, shapefiles = NULL, bat
if(!is.null(x)) {
if(any(class(x) %in% c("integer", "numeric")) & is.null(limits)) {
limits <- x
} else if(any(class(x) %in% c("data.table", "sf", "SpatialPolygonsDataFrame", "SpatialPolygons")) & is.null(limits) & is.null(data)) {
} else if(any(class(x) %in% c("data.frame", "data.table", "sf", "sfc", "SpatialPolygonsDataFrame", "SpatialPolygons")) & is.null(limits) & is.null(data)) {
data <- x
}
}
Expand Down
4 changes: 2 additions & 2 deletions R/transform_coord.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ transform_coord <- function(x = NULL, lon = NULL, lat = NULL, new.names = "auto"

if(na == "ignore" & nrow(z) > 0) {
y <- rbind(y, z)
rownames(y) <- y$id
suppressWarnings(rownames(y) <- y$id)
y <- y[order(y$id), !colnames(y) %in% "id"]
} else {
y <- y[, !colnames(y) %in% "id"]
Expand Down Expand Up @@ -236,7 +236,7 @@ transform_coord <- function(x = NULL, lon = NULL, lat = NULL, new.names = "auto"
}

if(exists("oldrownames")) {
rownames(out) <- oldrownames
suppressWarnings(rownames(out) <- oldrownames)
out <- out
} else {
out <- out
Expand Down
22 changes: 8 additions & 14 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ knitr::opts_chunk$set(
<!-- badges: start -->
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4554714.svg)](https://doi.org/10.5281/zenodo.4554714)
[![R-CMD-check](https://github.com/MikkoVihtakari/ggOceanMaps/workflows/R-CMD-check/badge.svg)](https://github.com/MikkoVihtakari/ggOceanMaps/actions)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ggOceanMaps)](https://cran.r-project.org/package=ggOceanMaps)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ggOceanMaps)](https://CRAN.R-project.org/package=ggOceanMaps)
<!-- badges: end -->

<!-- [![R-CMD-check](https://github.com/MikkoVihtakari/ggOceanMaps/workflows/R-CMD-check/badge.svg)](https://github.com/MikkoVihtakari/ggOceanMaps/actions/workflows/R-CMD-check.yaml) -->

**Important information:** ggOceanMaps is **withdrawn from CRAN indefinitely** due to submission issues. Install the package from source through GitHub (see the Installation section). The package works as long as the GIS packages of R are linked with PROJ >= 6 and GDAL >= 3 (write `rgdal::rgdal_extSoftVersion()` to test).

## 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).
Expand All @@ -41,7 +39,13 @@ The ggOceanMaps package has been developed by the [Institute of Marine Research]

## Installation

The package is available as a [GitHub version](https://github.com/MikkoVihtakari/ggOceanMaps), which is updated whenever the author works with the package.
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 CRAN version:

```{r eval = FALSE}
install.packages("ggOceanMaps")
```

Due to the package size limitations, ggOceanMaps requires the [ggOceanMapsData](https://github.com/MikkoVihtakari/ggOceanMapsData) package which stores shapefiles used in low-resolution maps.

Expand All @@ -52,16 +56,6 @@ devtools::install_github("MikkoVihtakari/ggOceanMapsData") # required by ggOcean
devtools::install_github("MikkoVihtakari/ggOceanMaps")
```

<!-- a [CRAN version](https://CRAN.R-project.org/package=ggOceanMaps) one day, and as. Use the GitHub version if you can. The ggOceanMapsData package is not available on CRAN but can be installed from a [drat](https://CRAN.R-project.org/package=drat) [repository on GitHub](https://github.com/MikkoVihtakari/drat). To install both packages, write: -->

```{r eval = FALSE, include = FALSE}
install.packages(c("ggOceanMapsData", "ggOceanMaps"),
repos = c("https://cloud.r-project.org",
"https://mikkovihtakari.github.io/drat"
)
)
```

## Usage

**ggOceanMaps** extends on [**ggplot2**](http://ggplot2.tidyverse.org/reference/). The package uses spatial shapefiles, [GIS packages for R](https://cran.r-project.org/web/views/Spatial.html) to manipulate, and the [**ggspatial**](https://cran.r-project.org/web/packages/ggspatial/index.html) package to help to plot these shapefiles. The shapefile plotting is conducted internally in the `basemap` function and 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)
Expand Down
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@
# ggOceanMaps

**Plot data on oceanographic maps using ggplot2. R package version
1.2.3**
1.2.6**

<!-- badges: start -->

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4554714.svg)](https://doi.org/10.5281/zenodo.4554714)
[![R-CMD-check](https://github.com/MikkoVihtakari/ggOceanMaps/workflows/R-CMD-check/badge.svg)](https://github.com/MikkoVihtakari/ggOceanMaps/actions)
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/ggOceanMaps)](https://cran.r-project.org/package=ggOceanMaps)
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/ggOceanMaps)](https://CRAN.R-project.org/package=ggOceanMaps)
<!-- badges: end -->

<!-- [![R-CMD-check](https://github.com/MikkoVihtakari/ggOceanMaps/workflows/R-CMD-check/badge.svg)](https://github.com/MikkoVihtakari/ggOceanMaps/actions/workflows/R-CMD-check.yaml) -->

**Important information:** ggOceanMaps is **withdrawn from CRAN
indefinitely** due to submission issues. Install the package from source
through GitHub (see the Installation section). The package works as long
as the GIS packages of R are linked with PROJ &gt;= 6 and GDAL &gt;= 3
(write `rgdal::rgdal_extSoftVersion()` to test).

## Overview

The ggOceanMaps package for [R](https://www.r-project.org/) allows
Expand All @@ -40,9 +34,16 @@ welcomed. See [*Contributions*](#contributions) for further details.

## Installation

The package is available as a [GitHub
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 whenever the author works with the package.
updated more frequently than the CRAN version.

Installation of the CRAN version:

``` r
install.packages("ggOceanMaps")
```

Due to the package size limitations, ggOceanMaps requires the
[ggOceanMapsData](https://github.com/MikkoVihtakari/ggOceanMapsData)
Expand All @@ -57,8 +58,6 @@ devtools::install_github("MikkoVihtakari/ggOceanMapsData") # required by ggOcean
devtools::install_github("MikkoVihtakari/ggOceanMaps")
```

<!-- a [CRAN version](https://CRAN.R-project.org/package=ggOceanMaps) one day, and as. Use the GitHub version if you can. The ggOceanMapsData package is not available on CRAN but can be installed from a [drat](https://CRAN.R-project.org/package=drat) [repository on GitHub](https://github.com/MikkoVihtakari/drat). To install both packages, write: -->

## Usage

**ggOceanMaps** extends on
Expand Down Expand Up @@ -185,17 +184,17 @@ citation("ggOceanMaps")
#> To cite package 'ggOceanMaps' in publications use:
#>
#> Mikko Vihtakari (2022). ggOceanMaps: Plot Data on Oceanographic Maps
#> using 'ggplot2'. R package version 1.2.3.
#> https://mikkovihtakari.github.io/ggOceanMaps/
#> using 'ggplot2'. R package version 1.2.6.
#> https://CRAN.R-project.org/package=ggOceanMaps
#>
#> A BibTeX entry for LaTeX users is
#>
#> @Manual{,
#> title = {ggOceanMaps: Plot Data on Oceanographic Maps using 'ggplot2'},
#> author = {Mikko Vihtakari},
#> year = {2022},
#> note = {R package version 1.2.3},
#> url = {https://mikkovihtakari.github.io/ggOceanMaps/},
#> note = {R package version 1.2.6},
#> url = {https://CRAN.R-project.org/package=ggOceanMaps},
#> }
```

Expand Down
119 changes: 37 additions & 82 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit aab1318

Please sign in to comment.