Skip to content

Commit

Permalink
Merge pull request #33 from worldbank/fix_nse_issue
Browse files Browse the repository at this point in the history
fix non standard evaluation issue in datafun()
  • Loading branch information
tonyfujs authored Nov 15, 2018
2 parents 56699d2 + bba65aa commit 207dbd7
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
8 changes: 5 additions & 3 deletions wbggeo/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ Description: More about what it does (maybe more than one line)
License: MIT
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.0.1
Imports: ggplot2,
RoxygenNote: 6.1.1
Imports:
ggplot2,
dplyr,
wbgcharts
wbgcharts,
rlang
Suggests: wbgmaps,
knitr,
rmarkdown
Expand Down
4 changes: 2 additions & 2 deletions wbggeo/R/geo.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ geom_bubble_map <- function(mapping = NULL, data = NULL, ..., centroids, sort_si
mapping <- modifyList(mapping, aes(x = long, y = lat))
if(is.function(data)) stop("Don't currently support data as function")
datafun <- function(d) {
d <- d %>% left_join(centroids, by = setNames("id", as.character(mapping$map_id)))
d <- d %>% left_join(centroids, by = setNames("id", rlang::quo_text(mapping$map_id)))
if (sort_size && !is.null(mapping$size)) {
d <- d %>% arrange_(paste0("-",as.character(mapping$size)))
d <- d %>% arrange_(paste0("-", rlang::quo_text(mapping$size)))
}
}
#geom_point(mapping, data = if (is.null(data)) datafun else datafun(data), ...)
Expand Down
2 changes: 1 addition & 1 deletion wbggeo/man/wbggeo-package.Rd

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

4 changes: 2 additions & 2 deletions wbggeo/vignettes/maps-gallery.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ library(wbggeo)
```

```{r, dpi=72, fig.width=9, fig.height=7, warning=FALSE, message=FALSE}
print(wbggeo_demo_atlas_5g_choropleth(), style_atlas(11))
print(wbggeo_demo_atlas_6h_bubble(), style_atlas(11))
# print(wbggeo_demo_atlas_5g_choropleth(), style_atlas(11))
# print(wbggeo_demo_atlas_6h_bubble(), style_atlas(11))
```
1 change: 1 addition & 0 deletions wbggeo/wbggeo.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ StripTrailingWhitespace: Yes
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
13 changes: 13 additions & 0 deletions wbgviz.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

0 comments on commit 207dbd7

Please sign in to comment.