Skip to content

Commit

Permalink
Fix an error in dist2land(binary = TRUE)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikkoVihtakari committed Oct 18, 2023
1 parent 040bcc5 commit 183e39a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 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: 2.1.3
Date: 2023-09-19
Version: 2.1.5
Date: 2023-10-18
Authors@R: c(person("Mikko", "Vihtakari", email = "mikko.vihtakari@hi.no",
role = c("aut", "cre"),
comment = c(affiliation = "Institute of Marine Research",
Expand Down
4 changes: 2 additions & 2 deletions R/dist2land.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#' @export

## Test parameters
# lon = NULL; lat = NULL; shapefile = NULL; proj.in = 4326; bind = TRUE; dist.col = "ldist"; binary = FALSE; geodesic.distances = FALSE; verbose = TRUE; cores = getCores()
# lon = NULL; lat = NULL; shapefile = "DecimalDegree"; proj.in = 4326; bind = TRUE; dist.col = "ldist"; binary = FALSE; verbose = TRUE

dist2land <- function(data, lon = NULL, lat = NULL, shapefile = "DecimalDegree", proj.in = 4326, bind = TRUE, dist.col = "ldist", binary = FALSE, verbose = TRUE) {

Expand Down Expand Up @@ -132,7 +132,7 @@ dist2land <- function(data, lon = NULL, lat = NULL, shapefile = "DecimalDegree",

if(verbose) message("Calculating binary positions...")

tmp <- is.na(as.integer(suppressMessages(sf::st_intersects(x, land))))
tmp <- sapply(suppressMessages(sf::st_intersects(x, land)), function(k) length(k) == 0)
if(verbose) message("Returning binary positions: TRUE in the ocean, FALSE on land.")

} else { ## Distance
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# ggOceanMaps

**Plot data on oceanographic maps using ggplot2. R package version
2.1.1**
2.1.3**

<!-- badges: start -->

Expand All @@ -15,7 +15,7 @@

**Breaking news (pun intended): ggOceanMaps goes
[sf](https://r-spatial.github.io/sf/)!** Most of ggOceanMaps code has
been rewritten. There are plenty of new features in 2.0 (see
been rewritten. There are plenty of new features in v2 (see
[this](https://mikkovihtakari.github.io/ggOceanMaps/articles/new-features.html)),
but likely also many new bugs. Please [report them
here](https://github.com/MikkoVihtakari/ggOceanMaps/issues).
Expand Down Expand Up @@ -192,7 +192,7 @@ citation("ggOceanMaps")
#> To cite package 'ggOceanMaps' in publications use:
#>
#> Vihtakari M (2023). _ggOceanMaps: Plot Data on Oceanographic Maps
#> using 'ggplot2'_. R package version 2.1.1,
#> using 'ggplot2'_. R package version 2.1.3,
#> <https://mikkovihtakari.github.io/ggOceanMaps/>.
#>
#> A BibTeX entry for LaTeX users is
Expand All @@ -201,7 +201,7 @@ citation("ggOceanMaps")
#> title = {ggOceanMaps: Plot Data on Oceanographic Maps using 'ggplot2'},
#> author = {Mikko Vihtakari},
#> year = {2023},
#> note = {R package version 2.1.1},
#> note = {R package version 2.1.3},
#> url = {https://mikkovihtakari.github.io/ggOceanMaps/},
#> }
```
Expand Down

0 comments on commit 183e39a

Please sign in to comment.