From df4afe4f44abfe0c520aaad0aec821981724d45c Mon Sep 17 00:00:00 2001 From: symbolixau Date: Sun, 29 Apr 2018 19:02:16 +1000 Subject: [PATCH] CRAN ready --- DESCRIPTION | 8 +- NEWS.md | 2 +- R/scratch.R | 92 ----------------------- README.md | 4 +- cran-comments.md | 8 +- tests/testthat/test-google_map_layer_sf.R | 6 +- 6 files changed, 12 insertions(+), 108 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b3963bb4..7ce91135 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,15 +1,15 @@ Package: googleway Type: Package Title: Accesses Google Maps APIs to Retrieve Data and Plot Maps -Version: 2.5.00006 -Date: 2018-02-01 +Version: 2.6 +Date: 2018-04-29 Authors@R: c( person("David", "Cooley", ,"dcooley@symbolix.com.au", role = c("aut", "cre")), person("Paulo", "Barcelos", role = "ctb", comment = "Author of c++ decode_pl"), person("Rstudio", role = "ctb", comment = "Functions written for the Leaflet pacakge") ) -Description: Provides a mechanism to plot a Google Map from R and overlay - it with shapes and markers. Also provides access to Google Maps APIs, +Description: Provides a mechanism to plot a 'Google Map' from 'R' and overlay + it with shapes and markers. Also provides access to 'Google Maps' APIs, including places, directions, roads, distances, geocoding, elevation and timezone. License: GPL-3 diff --git a/NEWS.md b/NEWS.md index e5d6fa06..5a15e013 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -## Version 2.5.0 (development) +## Version 2.6.0 # `clear_bounds()` function to clear the map bounds object * `add_ ()` functions gain `focus_layer` argument to re-centre the map on the layer being plotted diff --git a/R/scratch.R b/R/scratch.R index 1be6b9f3..e69de29b 100644 --- a/R/scratch.R +++ b/R/scratch.R @@ -1,92 +0,0 @@ - - -## TODO: -## TESTS -## - polylines - works with and without ID, for polyline and lat/lon columns -## - polygons - ditto - - -## two maps with the same layer_id ? - - -# library(shiny) -# library(shinydashboard) -# library(googleway) -# -# ui <- dashboardPage( -# -# dashboardHeader(), -# dashboardSidebar(), -# dashboardBody( -# box(width = 6, -# google_mapOutput(outputId = "map") -# ), -# box(width = 6, -# google_mapOutput(outputId = "pano") -# ) -# ) -# ) -# -# server <- function(input, output) { -# set_key(read.dcf("~/Documents/.googleAPI", fields = "GOOGLE_MAP_KEY")) -# -# output$map <- renderGoogle_map({ -# google_map(location = c(-37.817386, 144.967463), -# zoom = 14, -# split_view = "pano", -# split_view_options = list(heading = 275, pitch = 20) -# ) -# }) -# } -# -# shinyApp(ui, server) - - -# -# flinders <- "dhyeFezxsZnDwAP~@ZfCL|AQDc@eEMu@KDp@jFALMBu@_GKDx@~FMBaAyFKF~@xFMDC?cAwFEBdAxFQDeAuFIB`ArFSD" -# markers <- data.frame( -# lat = c(-37.81821,-37.8181,-37.81801,-37.81793,-37.81808,-37.81816,-37.81825,-37.81837,-37.81850,-37.81838,-37.81829,-37.81819,-37.81837,-37.81846,-37.81852,-37.81863,-37.81875,-37.81865,-37.81858,-37.81852), -# lon = c( 144.9656, 144.966, 144.9664, 144.9667, 144.9668, 144.9664, 144.9661, 144.9657, 144.9657, 144.9662, 144.9665, 144.9669, 144.9669, 144.9666, 144.9663, 144.9658, 144.9658, 144.9663, 144.9666, 144.9670) -# ) -# -# ## simulate data every 6/10/60 seconds within the polygons / close to markers? -# m <- as.matrix(googlePolylines::decode(flinders)[[1]]) -# m <- rbind(m, m[1,]) -# m <- m[,c(2,1)] -# sf_flinders <- sf::st_polygon(x = list(m)) -# -# library(shiny) -# library(shinydashboard) -# library(googleway) -# -# ui <- dashboardPage( -# dashboardHeader(), -# dashboardSidebar(), -# dashboardBody( -# google_mapOutput(outputId = "map", height = "800px"), -# actionButton(inputId = "circles", label = "add circles") -# ) -# ) -# -# server <- function(input, output) { -# -# set_key(read.dcf("~/Documents/.googleAPI", fields = "GOOGLE_MAP_KEY")) -# autoInvalidate <- reactiveTimer(10000) -# -# output$map <- renderGoogle_map({ -# google_map() -# }) -# -# observe({ -# autoInvalidate() -# pts <- sf::st_sf(geometry = sf::st_sample(sf_flinders, 500)) -# google_map_update(map_id = "map") %>% -# clear_circles() %>% -# add_circles(pts, radius = 1, stroke_weight = 0, update_map_view = F) -# }) -# } -# shinyApp(ui, server) - - - - diff --git a/README.md b/README.md index 235bceb4..061d260e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Provides a mechanism to access various [Google Maps APIs](https://developers.goo ![Google Maps](./vignettes/img/polygon_legend.png) -## v2.4.0 +## v2.6 see [News](https://github.com/SymbolixAU/googleway/blob/master/NEWS.md) for a full list of changes and additions @@ -29,7 +29,7 @@ For specific examples, see the blog posts for See the [**vignette**](https://github.com/SymbolixAU/googleway/blob/master/vignettes/googleway-vignette.Rmd) for instructions and examples. -## v2.5.0 (development) +## v2.7.0 (development) diff --git a/cran-comments.md b/cran-comments.md index 2667056f..196a642a 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,15 +1,13 @@ ## Release summary -* Updates v2.2.0 to v2.4.0 -* Support for `sf` objects -* Colours & legends -* Added extra Google Map API calls +* Updates v2.4.0 to v2.6.0 +# Removed all source / C++ code ## Test Environments -* local OS X 10.13.2 (Sierra) install, R 3.4.0 +* local OS X 15.6.0 (High Sierra) install, R 3.4.4 * ubuntu 12.04.5 (on travis-ci), R 3.3.0 * win-builder (devel and release) diff --git a/tests/testthat/test-google_map_layer_sf.R b/tests/testthat/test-google_map_layer_sf.R index 76299a88..d616dfd6 100644 --- a/tests/testthat/test-google_map_layer_sf.R +++ b/tests/testthat/test-google_map_layer_sf.R @@ -5,8 +5,7 @@ test_that("sf objects encoded", { testthat::skip_on_cran() testthat::skip_on_travis() - - library(sf) + testthat::skip_if_not_installed(pkg = "sf") df <- data.frame(myId = c(1,1,1,1,1,1,1,1,2,2,2,2), lineId = c(1,1,1,1,2,2,2,2,1,1,1,2), @@ -48,8 +47,8 @@ test_that("correct sf rows are returned", { testthat::skip_on_cran() testthat::skip_on_travis() + testthat::skip_if_not_installed(pkg = "sf") - library(sf) df <- data.frame(myId = c(1,1,1,1,1,1,1,1,2,2,2,2), lineId = c(1,1,1,1,2,2,2,2,1,1,1,2), lon = c(-80.190, -66.118, -64.757, -80.190, -70.579, -67.514, -66.668, -70.579, -70, -49, -51, -70), @@ -75,7 +74,6 @@ test_that("correct sf rows are returned", { sf::st_sf(geometry = multipoint) ) - expect_true(nrow(googleway:::normaliseSfData(sf, "POLYGON")) == 2) expect_true(nrow(googleway:::normaliseSfData(sf, "LINE")) == 2) expect_true(nrow(googleway:::normaliseSfData(sf, "POINT")) == 2)