Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Rgooglemaps a Suggests dependency #349

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Depends:
R (>= 3.1.0),
ggplot2 (>= 2.2.0)
Imports:
RgoogleMaps,
png,
plyr,
jpeg,
Expand All @@ -35,6 +34,7 @@ Imports:
cli
Suggests:
MASS,
RgoogleMaps,
hexbin,
testthat
License: GPL-2
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export(theme_nothing)
export(trek)
export(write_geocode_cache)
import(ggplot2)
importFrom(RgoogleMaps,XY2LatLon)
importFrom(bitops,bitAnd)
importFrom(bitops,bitOr)
importFrom(bitops,bitShiftL)
Expand Down
7 changes: 5 additions & 2 deletions R/get_googlemap.R
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ get_googlemap <- function(
)
}

if (!requireNamespace("RgoogleMaps", quietly = TRUE)) {
cli::cli_abort("RgoogleMaps is required for XY2LatLon().")
}

## read in map and format, add meta data
############################################################
Expand All @@ -407,12 +410,12 @@ get_googlemap <- function(
# map spatial info
if(is.character(center)) center <- as.numeric(geocode(center, source = "google"))

ll <- XY2LatLon(
ll <- RgoogleMaps::XY2LatLon(
list(lat = center[2], lon = center[1], zoom = zoom),
-size[1]/2 + 0.5,
-size[2]/2 - 0.5
)
ur <- XY2LatLon(
ur <- RgoogleMaps::XY2LatLon(
list(lat = center[2], lon = center[1], zoom = zoom),
size[1]/2 + 0.5,
size[2]/2 - 0.5
Expand Down
1 change: 0 additions & 1 deletion R/ggmap-package.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#' @import ggplot2
#' @docType package
#' @name ggmap
#' @importFrom RgoogleMaps XY2LatLon
#' @importFrom png readPNG
#' @importFrom jpeg readJPEG
#' @importFrom plyr arrange compact ddply desc dlply is.discrete is.formula join
Expand Down