diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c011a5e..79bf8d3 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -45,3 +45,4 @@ If you’ve found a bug, please file an issue that illustrates the bug with a mi Please note that the quadkeyr project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project you agree to abide by its terms. + diff --git a/R/grid_to_polygon.R b/R/grid_to_polygon.R index 147ffdf..b9c3d5a 100644 --- a/R/grid_to_polygon.R +++ b/R/grid_to_polygon.R @@ -131,6 +131,7 @@ grid_to_polygon <- function(data) { #' QuadKeys appears as NAs as there are only kept to extend the grid. #' Their value is not necessary. #' +#' @keywords internal #' @export #' #' @examples diff --git a/R/read_and_format_files.R b/R/read_and_format_files.R index 747f8b1..756ade9 100644 --- a/R/read_and_format_files.R +++ b/R/read_and_format_files.R @@ -21,23 +21,32 @@ #' #' @examples #' -#' read_fb_mobility_files( +#' files <- read_fb_mobility_files( #' path_to_csvs = paste0(system.file("extdata", -#' package = "quadkeyr"), "/"), -#' colnames = c( -#' "lat", "lon", -#' "quadkey", "date_time", -#' "n_crisis", "percent_change" +#' package = "quadkeyr"), "/"), +#' colnames = c( # The columns not listed here will be omitted +#' "lat", +#' "lon", +#' "quadkey", +#' "date_time", +#' "n_crisis", +#' "percent_change", +#' "day", +#' "hour" #' ), #' coltypes = list( -#' lat = "d", -#' lon = "d", -#' quadkey = "d", -#' date_time = "T", -#' n_crisis = "c", -#' percent_change = "c" +#' lat = 'd', +#' lon = 'd', +#' quadkey = 'c', +#' date_time = 'T', +#' n_crisis = 'c', +#' percent_change = 'c', +#' day = 'D', +#' hour = 'i' #' ) #' ) +#' +#' head(files) #' read_fb_mobility_files <- function(path_to_csvs, colnames, @@ -61,12 +70,18 @@ read_fb_mobility_files <- function(path_to_csvs, # There could be empty files, let's remove them fnames <- fnames[file.info(fnames)$size != 0] - - data <- purrr::map_dfr(fnames, - readr::read_csv, - col_select = dplyr::all_of(colnames), # tidyselect - col_names = TRUE, # header - col_types = coltypes + + data <- purrr::map_dfr( + .x = fnames, + .f = function(files) { + readr::read_csv( + files, + # Let's select the columns given by the user. + col_select = dplyr::all_of(colnames), + col_names = TRUE, # header + col_types = coltypes + ) + } ) diff --git a/README.Rmd b/README.Rmd index 38f896d..e1254ce 100644 --- a/README.Rmd +++ b/README.Rmd @@ -56,9 +56,9 @@ knitr::include_graphics("man/figures/quadkeys.jpg") The goal of `quadkeyr` is to: -1. [**Convert a QuadKey to a simple features data.frame (and more)**](https://fernandez-lab-wsu.github.io/quadkeyr/articles/quadkey_to_sf_conversion.html) +1. [**Convert a QuadKey to a Simple Features data.frame (and more)**](https://fernandez-lab-wsu.github.io/quadkeyr/articles/quadkey_to_sf_conversion.html) `quadkeyr` provides functions to convert a QuadKey to -a `sf POINT data.frame` or `sf POLYGON data.frame`. +a `sf` POINT data.frame or `sf` POLYGON data.frame. Additionally, all the R functions described in the [official documentation](https://learn.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system) to convert QuadKeys to and from tiles, pixels and geographic coordinates @@ -72,7 +72,7 @@ knitr::include_graphics("man/figures/workflow_quadkey.png") Complete a grid of QuadKeys within a specified area and zoom level, and create a `stars` raster. You can also directly convert QuadKeys in a data.frame column -into an `sf POLYGON data.frame`. +into an `sf` POLYGON data.frame. ```{r w2, echo = FALSE, out.width= "90%", fig.align='center'} knitr::include_graphics("man/figures/workflow_raster.png") @@ -85,7 +85,7 @@ by day and hour reported. knitr::include_graphics("man/figures/workflow_facebook.png") ``` -4. [**Offer an App for visualizing QuadKeys on a map.**](https://fernandez-lab-wsu.github.io/quadkeyr/articles/quadkey_visualization_app.html) +4. [**Offer an App for visualizing QuadKeys on a map**](https://fernandez-lab-wsu.github.io/quadkeyr/articles/quadkey_visualization_app.html) Introduce a QuadKey visualization application enabling users to validate function outcomes. @@ -100,9 +100,16 @@ remotes::install_github("Fernandez-Lab-WSU/quadkeyr") ## Code of Conduct -Please note that the `quadkeyr` project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. +Please, note that the `quadkeyr` project is released with a +[Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). +By contributing to this project, you agree to abide by its terms. -### References +## Contribute + +If you'd like to contribute to this project, please follow the +[contributing guidelines](https://github.com/Fernandez-Lab-WSU/quadkeyr/blob/main/.github/CONTRIBUTING.md) + +## Links of interest - [Bing Maps Tile Systems - Microsoft](https://learn.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system) - [R - `slippymath`: Slippy Map Tile Tools](https://cran.r-project.org/web/packages/slippymath/index.html) - [Python - `pyquadkey2`](https://docs.muetsch.io/pyquadkey2/) diff --git a/README.md b/README.md index 959bbd3..d3eb529 100644 --- a/README.md +++ b/README.md @@ -53,11 +53,11 @@ Bing Maps Tile System webpage. The goal of `quadkeyr` is to: -1. [**Convert a QuadKey to a simple features data.frame (and +1. [**Convert a QuadKey to a Simple Features data.frame (and more)**](https://fernandez-lab-wsu.github.io/quadkeyr/articles/quadkey_to_sf_conversion.html) - `quadkeyr` provides functions to convert a QuadKey to a - `sf POINT data.frame` or `sf POLYGON data.frame`. Additionally, all - the R functions described in the [official + `quadkeyr` provides functions to convert a QuadKey to a `sf` POINT + data.frame or `sf` POLYGON data.frame. Additionally, all the R + functions described in the [official documentation](https://learn.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system) to convert QuadKeys to and from tiles, pixels and geographic coordinates are available. @@ -68,7 +68,7 @@ The goal of `quadkeyr` is to: Data**](https://fernandez-lab-wsu.github.io/quadkeyr/articles/quadkey_identified_data_to_raster.html) Complete a grid of QuadKeys within a specified area and zoom level, and create a `stars` raster. You can also directly convert QuadKeys - in a data.frame column into an `sf POLYGON data.frame`. + in a data.frame column into an `sf` POLYGON data.frame. 3. [**Convert Facebook Mobility QuadKey-identified Datasets into Raster @@ -79,7 +79,7 @@ hour reported. 4. [**Offer an App for visualizing QuadKeys on a - map.**](https://fernandez-lab-wsu.github.io/quadkeyr/articles/quadkey_visualization_app.html) + map**](https://fernandez-lab-wsu.github.io/quadkeyr/articles/quadkey_visualization_app.html) Introduce a QuadKey visualization application enabling users to validate function outcomes. @@ -95,12 +95,18 @@ remotes::install_github("Fernandez-Lab-WSU/quadkeyr") ## Code of Conduct -Please note that the `quadkeyr` project is released with a [Contributor +Please, note that the `quadkeyr` project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. -### References +## Contribute + +If you’d like to contribute to this project, please follow the +[contributing +guidelines](https://github.com/Fernandez-Lab-WSU/quadkeyr/blob/main/.github/CONTRIBUTING.md) + +## Links of interest - [Bing Maps Tile Systems - Microsoft](https://learn.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system) diff --git a/docs/authors.html b/docs/authors.html index 7a16c79..cd09347 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -66,15 +66,15 @@

Citation

Source: DESCRIPTION

D'Andrea F (2024). -quadkeyr: Tools for converting QuadKeys used in Microsoft's Bing Maps Tile System into raster images. -<https://fernandez-lab-wsu.github.io/quadkeyr/>, <https://github.com/Fernandez-Lab-WSU/quadkeyr>. +quadkeyr: Tools for converting QuadKey-identified datasets (Microsoft's Bing Maps Tile System) into raster images. +https://fernandez-lab-wsu.github.io/quadkeyr/, https://github.com/Fernandez-Lab-WSU/quadkeyr.

@Manual{,
-  title = {quadkeyr: Tools for converting QuadKeys used in Microsoft's Bing Maps Tile System into raster images},
+  title = {quadkeyr: Tools for converting QuadKey-identified datasets (Microsoft's Bing Maps Tile System) into raster images},
   author = {Florencia D'Andrea},
   year = {2024},
-  note = {, },
-}
+ note = {https://fernandez-lab-wsu.github.io/quadkeyr/, https://github.com/Fernandez-Lab-WSU/quadkeyr}, +} diff --git a/docs/index.html b/docs/index.html index b64ecba..9028c11 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,8 +5,8 @@ - -Tools for converting QuadKeys used in Microsoft's Bing Maps Tile System into raster images • quadkeyr + +Tools for converting QuadKey-identified datasets (Microsoft's Bing Maps Tile System) into raster images • quadkeyr @@ -17,8 +17,8 @@ - - + +