Package geogrid. August 19, 2018

Similar documents
Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package spark. July 21, 2017

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package ECctmc. May 1, 2018

Package validara. October 19, 2017

Package fastdummies. January 8, 2018

Package messaging. May 27, 2018

Package geoops. March 19, 2018

Package nngeo. September 29, 2018

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package qualmap. R topics documented: September 12, Type Package

Package rnaturalearth

Package strat. November 23, 2016

Package datasets.load

Package raker. October 10, 2017

Package sankey. R topics documented: October 22, 2017

Package elmnnrcpp. July 21, 2018

Package projector. February 27, 2018

Package cancensus. February 4, 2018

Package postgistools

Package rbgm. May 18, 2018

Package clipr. June 23, 2018

Package repec. August 31, 2018

Package kdtools. April 26, 2018

Package sfdct. August 29, 2017

Package farver. November 20, 2018

Package knitrprogressbar

Package githubinstall

Package semver. January 6, 2017

Package canvasxpress

Package dbx. July 5, 2018

Package sfc. August 29, 2016

Package fst. December 18, 2017

Package gtrendsr. August 4, 2018

Package gtrendsr. October 19, 2017

Package available. November 17, 2017

Package mixsqp. November 14, 2018

Package fastrtext. December 10, 2017

Package velox. R topics documented: December 1, 2017

Package gwfa. November 17, 2016

Package tidytransit. March 4, 2019

Package transformr. December 9, 2018

Package iccbeta. January 28, 2019

Package hyphenatr. August 29, 2016

Package wrswor. R topics documented: February 2, Type Package

Package coga. May 8, 2018

Package tiler. June 9, 2018

Package combiter. December 4, 2017

Package rtext. January 23, 2019

Package fst. June 7, 2018

Package crossword.r. January 19, 2018

Package ibm. August 29, 2016

Package Rsomoclu. January 3, 2019

Package docxtools. July 6, 2018

Package humanize. R topics documented: April 4, Version Title Create Values for Human Consumption

Package autocogs. September 22, Title Automatic Cognostic Summaries Version 0.1.1

Package rnn. R topics documented: June 21, Title Recurrent Neural Network Version 0.8.1

Package rollply. R topics documented: August 29, Title Moving-Window Add-on for 'plyr' Version 0.5.0

Package gfcanalysis. August 29, 2016

Package robotstxt. November 12, 2017

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package Rtsne. April 14, 2017

Package nmslibr. April 14, 2018

Package readobj. November 2, 2017

Package pkgbuild. October 16, 2018

Package fasttextr. May 12, 2017

Package goodpractice

Package ramcmc. May 29, 2018

Package darksky. September 20, 2017

Package glcm. August 29, 2016

Package TVsMiss. April 5, 2018

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package fingertipsr. May 25, Type Package Version Title Fingertips Data for Public Health

Package osrm. November 13, 2017

Package rpostgislt. March 2, 2018

Package triebeard. August 29, 2016

Package data.world. April 5, 2018

Package lexrankr. December 13, 2017

Package calpassapi. August 25, 2018

Package queuecomputer

Package readxl. April 18, 2017

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package AhoCorasickTrie

Package comparedf. February 11, 2019

Package tidyselect. October 11, 2018

Package ompr. November 18, 2017

Package mapedit. R topics documented: March 2, Title Interactive Editing of Spatial Data in R

R topics documented: 2 clone

Package ecoseries. R topics documented: September 27, 2017

Package spelling. December 18, 2017

Package opencage. January 16, 2018

Package waver. January 29, 2018

Package crochet. January 8, 2018

Package mdftracks. February 6, 2017

Package cli. November 5, 2017

Package smoothr. April 4, 2018

Package tibble. August 22, 2017

Package jpmesh. December 4, 2017

Package pinyin. October 17, 2018

Package vinereg. August 10, 2018

Transcription:

Package geogrid August 19, 2018 Title Turn Geospatial Polygons into Regular or Hexagonal Grids Version 0.1.0.1 Turn irregular polygons (such as geographical regions) into regular or hexagonal grids. This package enables the generation of regular (square) and hexagonal grids through the package 'sp' and then assigns the content of the existing polygons to the new grid using the Hungarian algorithm, Kuhn (1955) (<doi:10.1007/978-3-540-68279-0_2>). This prevents the need for manual generation of hexagonal grids or regular grids that are supposed to reflect existing geography. Imports methods, sp, sf, rgeos, Rcpp License MIT + file LICENSE Encoding UTF-8 LazyData true LinkingTo Rcpp, RcppArmadillo Suggests testthat, covr, lintr RoxygenNote 6.0.1 URL https://github.com/jbaileyh/geogrid BugReports https://github.com/jbaileyh/geogrid/issues NeedsCompilation yes Author Joseph Bailey [aut, cre], Ryan Hafen [ctb], Lars Simon Zehnder [ctb] (RcppArmadillo implmentation of Munkres' Assignment Algorithm) Maintainer ORPHANED Repository CRAN Date/Publication 2018-08-19 08:51:30 UTC X-CRAN-Original-Maintainer Joseph Bailey <jbailey@futurecities.catapult.org.uk> X-CRAN-Comment Orphaned and corrected on 2018-08-19 as check problems were not corrected despite reminders. 1

2 assign_polygons R topics documented: assign_polygons....................................... 2 calculate_cell_size..................................... 3 calculate_grid........................................ 4 geogrid........................................... 5 get_shape_details...................................... 5 get_shape_details_internal................................. 6 hungariansafe_cc...................................... 6 hungarian_cc........................................ 7 plot.geogrid......................................... 7 read_polygons........................................ 8 Index 9 assign_polygons Assign the polygons in the original spatial data to their new location. Assigns each polygon in the original file to a new location in the gridded geometry using the Hungarian algorithm. assign_polygons(shape, new_polygons) shape new_polygons A "geogrid" object returned from calculate_grid. Value A SpatialPolygonsDataFrame. Examples ## Not run: input_file <- system.file("extdata", "london_la.json", package = "geogrid") original_shapes <- read_polygons(input_file) # calculate grid new_cells <- calculate_grid(shape = original_shapes, grid_type = "hexagonal", seed = 1) plot(new_cells) #

calculate_cell_size 3 grid_shapes <- assign_polygons(original_shapes, new_cells) par(mfrow=c(1, 2)) sp::plot(original_shapes) sp::plot(grid_shapes) # look at different grids using different seeds par(mfrow=c(2, 3), mar = c(0, 0, 2, 0)) for (i in 1:6) { new_cells <- calculate_grid(shape = original_shapes, grid_type = "hexagonal", seed = i) plot(new_cells, main = paste("seed", i, sep=" ")) } ## End(Not run) calculate_cell_size Calculate size of grid items (deprecated). Given an input multipolgyon spatial data frame this function calculates the required cell size of a regular or hexagonal grid. calculate_cell_size(shape, shape_details = NULL, learning_rate = 0.03, grid_type = c("hexagonal", "regular"), seed = NULL, verbose = FALSE) shape shape_details learning_rate grid_type seed verbose deprecated. The rate at which the gradient descent finds the optimum cellsize to ensure that your gridded points fit within the outer boundary of the input polygons. Either "hexagonal" for a hexagonal grid (default) or "regular" for a regular grid. An optional random seed integer to be used for the grid calculation algorithm. A logical indicating whether messages should be printed as the algorithm iterates.

4 calculate_grid calculate_grid Calculate grid from spatial polygons. Given an input multipolgyon spatial data frame this function calculates a hexagonal or regular grid that strives to preserve the original geography. calculate_grid(shape, learning_rate = 0.03, grid_type = c("hexagonal", "regular"), seed = NULL, verbose = FALSE) shape learning_rate grid_type seed verbose The rate at which the gradient descent finds the optimum cellsize to ensure that your gridded points fit within the outer boundary of the input polygons. Either "hexagonal" for a hexagonal grid (default) or "regular" for a regular grid. An optional random seed integer to be used for the grid calculation algorithm. A logical indicating whether messages should be printed as the algorithm iterates. Examples ## Not run: input_file <- system.file("extdata", "london_la.json", package = "geogrid") original_shapes <- read_polygons(input_file) # calculate grid new_cells <- calculate_grid(shape = original_shapes, grid_type = "hexagonal", seed = 1) plot(new_cells) # grid_shapes <- assign_polygons(original_shapes, new_cells) par(mfrow=c(1, 2)) sp::plot(original_shapes) sp::plot(grid_shapes) # look at different grids using different seeds par(mfrow=c(2, 3), mar = c(0, 0, 2, 0)) for (i in 1:6) { new_cells <- calculate_grid(shape = original_shapes, grid_type = "hexagonal", seed = i) plot(new_cells, main = paste("seed", i, sep=" ")) } ## End(Not run)

geogrid 5 geogrid geogrid Turn irregular polygons (such as geographical regions) into regular grids. Author(s) Joseph Bailey <jbailey@futurecities.catapult.org.uk> Examples ## Not run: input_file <- system.file("extdata", "london_la.json", package = "geogrid") original_shapes <- read_polygons(input_file) # calculate grid new_cells <- calculate_grid(shape = original_shapes, grid_type = "hexagonal", seed = 1) plot(new_cells) # grid_shapes <- assign_polygons(original_shapes, new_cells) par(mfrow=c(1, 2)) sp::plot(original_shapes) sp::plot(grid_shapes) # look at different grids using different seeds par(mfrow=c(2, 3), mar = c(0, 0, 2, 0)) for (i in 1:6) { new_cells <- calculate_grid(shape = original_shapes, grid_type = "hexagonal", seed = i) plot(new_cells, main = paste("seed", i, sep=" ")) } ## End(Not run) get_shape_details Extract details from provided polygons (deprecated). Extract spatial extent, range and other geospatial features from the output of read_polygons. Items are returned as a list for use in calculate_grid. get_shape_details(input_shape)

6 hungariansafe_cc input_shape get_shape_details_internal Extract details from provided polygons. Extract spatial extent, range and other geospatial features from the output of read_polygons. Items are returned as a list for use in calculate_grid. get_shape_details_internal(input_shape) input_shape hungariansafe_cc hungariansafe_cc hungariansafe_cc hungariansafe_cc(cost) cost cost matrix

hungarian_cc 7 hungarian_cc hungarian_cc hungarian_cc hungarian_cc(cost) cost cost matrix plot.geogrid Plot a "geogrid" object Plot a "geogrid" object ## S3 method for class 'geogrid' plot(x, y,...) x An object of class "geogrid" to plot. y ignored... Additional parameters passed to the "sp" package s plot method.

8 read_polygons read_polygons Import spatial data. Simple function to read spatial data into a SpatialPolygonsDataFrame. Based on st_read from package sf. read_polygons(file) file A file path pointing to a shapefile or GeoJSON file, or a character string holding GeoJSON data. See the dsn argument of st_read for more details.

Index assign_polygons, 2 calculate_cell_size, 3 calculate_grid, 2, 4, 5, 6 geogrid, 5 geogrid-package (geogrid), 5 get_shape_details, 5 get_shape_details_internal, 6 hungarian_cc, 7 hungariansafe_cc, 6 plot.geogrid, 7 read_polygons, 8 st_read, 8 9