Skip to content

Commit

Permalink
Fixes errors with proj.latlo
Browse files Browse the repository at this point in the history
  • Loading branch information
eliocamp committed Aug 30, 2024
1 parent b1f2c2e commit 3bbff9f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions R/geom_contour_fill.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#' - A numeric value for constant imputation
#' - A function that takes a vector and returns a numeric (e.g. `mean`)
# #' @param xwrap,ywrap vector of length two used to wrap the circular dimension.
#' @param proj.latlon Logical indicating if the projection step should project
#' from a cartographic projection to a lon/lat grid or the other way around.
#'
#' @section Aesthetics:
#' \code{geom_contour_fill} understands the following aesthetics (required aesthetics are in bold):
Expand Down Expand Up @@ -67,6 +69,7 @@ geom_contour_fill <- function(mapping = NULL, data = NULL,
bins = NULL,
binwidth = NULL,
proj = NULL,
proj.latlon = TRUE,
clip = NULL,
kriging = FALSE,
global.breaks = TRUE,
Expand All @@ -90,6 +93,7 @@ geom_contour_fill <- function(mapping = NULL, data = NULL,
na.fill = na.fill,
kriging = kriging,
proj = proj,
proj.latlon = proj.latlon,
clip = clip,
global.breaks = global.breaks,
...
Expand Down
2 changes: 1 addition & 1 deletion R/stat_contour2.r
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ isoband_z_matrix <- function(data) {
stopf("Projection requires the proj4 package. Install it with 'install.packages(\"proj4\")'.")
}
cl <- lapply(cl, function(x) {
x[c("x", "y")] <- proj4::project(list(x$x, x$y), proj, inverse = TRUE)
x[c("x", "y")] <- proj4::project(list(x$x, x$y), proj, inverse = proj.latlon)
return(x)
})
}
Expand Down
7 changes: 4 additions & 3 deletions man/geom_contour_fill.Rd

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

0 comments on commit 3bbff9f

Please sign in to comment.