Skip to content

Commit

Permalink
update to pass cmd check
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jul 13, 2016
1 parent 1b6a6a4 commit 2365d7a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
^data-raw$
^rosm\.cache$
^README_files$
^README\.rmd$
1 change: 1 addition & 0 deletions R/fortify-SpatialPolygons.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fortify_pg_fixfeature <- function(df) {


fortify_SpatialPolygons <- function(x, ...) {
id <- NULL; rm(id); . <- NULL; rm(.)
df <- ggplot2::fortify(x, ...)
dplyr::do(dplyr::group_by(df, id), fortify_pg_fixfeature(.))
}
6 changes: 3 additions & 3 deletions R/spggplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ geom_spatial <- function(data=NULL, mapping = NULL, show.legend = TRUE, inherit.
fromprojection=NULL, toprojection=NULL, ...) {
rgdal::CRSargs(CRS("+init=epsg:3857")) #hack to load rgdal namespace
long <- NULL; rm(long); lat <- NULL; rm(lat) # hack for use of aes()
group <- NULL; rm(group); x <-NULL; rm(x); y <-NULL; rm(y) # hack for use of aes()
group <- NULL; rm(group); x <-NULL; rm(x); y <-NULL; rm(y); id <- NULL; rm(id) # hack for use of aes()

if(is.null(fromprojection) && !is.null(fromepsg)) {
fromprojection <- sp::CRS(paste0("+init=epsg:", fromepsg))
Expand All @@ -144,7 +144,7 @@ geom_spatial <- function(data=NULL, mapping = NULL, show.legend = TRUE, inherit.
data.fort <- suppressMessages(fortify_SpatialPolygons(data))
data <- suppressWarnings(merge(data.fort, data@data, by.x="id", by.y=".id"))
if(is.null(mapping)) {
mapping <- aes()
mapping <- ggplot2::aes()
}
pathmapping <- c(ggplot2::aes(x=long, y=lat, group=group), mapping)
mapping <- c(ggplot2::aes(x=long, y=lat, group=id),
Expand Down Expand Up @@ -195,7 +195,7 @@ geom_spatial <- function(data=NULL, mapping = NULL, show.legend = TRUE, inherit.
mapping_path <- mapping
pathparams <- params[names(params)!="fill"]
params <- params[!(names(params) %in% c("colour", "col", "color"))]
pathmapping <- c(aes(group=group), mapping)
pathmapping <- c(ggplot2::aes(group=group), mapping)
class(pathmapping) <- "uneval"
if(any(names(pathparams) %in% c("col", "color", "colour", "lty", "linetype", "size")) ||
any(names(pathmapping) %in% c("col", "color", "colour", "lty", "linetype", "size"))) {
Expand Down

0 comments on commit 2365d7a

Please sign in to comment.