diff --git a/DESCRIPTION b/DESCRIPTION index 26fb7cd..1a7b807 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,9 +17,9 @@ Authors@R: role = c("rev"), comment = c("Maria Paula Caldas reviewed the package (v. 0.0.0.9000) for rOpenSci, see https://github.com/ropensci/software-review/issues/619")), person(given = "Vincent", - family = "Van Hess", + family = "van Hees", role = c("rev"), - comment = c("Vincent Van Hess reviewed the package (v. 0.0.0.9000) for rOpenSci, see https://github.com/ropensci/software-review/issues/619")), + comment = c("Vincent van Hees reviewed the package (v. 0.0.0.9000) for rOpenSci, see https://github.com/ropensci/software-review/issues/619")), person("CDC's Center for Forecasting and Outbreak Analytics", comment = c("This project was made possible by cooperative agreement CDC-RFA-FT-23-0069 (grant # NU38FT000009-01-00) from the CDC's Center for Forecasting and Outbreak Analytics. Its contents are solely the responsibility of the authors and do not necessarily represent the official views of the Centers for Disease Control and Prevention."), role = c("fnd")), person("MIDAS-NIH COVID-19 urgent grant program", role = c("fnd")), diff --git a/README.Rmd b/README.Rmd index c027086..ca38d44 100644 --- a/README.Rmd +++ b/README.Rmd @@ -45,7 +45,7 @@ mapping applications. ```{r qks, echo = FALSE, out.width= "70%", fig.align='center'} -knitr::include_graphics("vignettes/bing_quadkeys.jpg") +knitr::include_graphics("https://github.com/Fernandez-Lab-WSU/quadkeyr/blob/main/docs/articles/bing_quadkeys.jpg?raw=true") ```

The QuadKey of any tile starts with the QuadKey of its parent tile (the containing tile at the previous level). Image extracted from Microsoft's Bing Maps Tile System webpage.

diff --git a/README.md b/README.md index c626ad7..8741b7e 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ spatial position as a sequence of characters. They provide an efficient method to address and retrieve specific map tiles, facilitating rapid display within mapping applications. - +

The QuadKey of any tile starts with the QuadKey of its parent tile (the containing tile at the previous level). Image extracted from Microsoft’s diff --git a/docs/articles/facebook_mobility_csvs_to_raster_files.html b/docs/articles/facebook_mobility_csvs_to_raster_files.html index 197303d..054ba82 100644 --- a/docs/articles/facebook_mobility_csvs_to_raster_files.html +++ b/docs/articles/facebook_mobility_csvs_to_raster_files.html @@ -83,7 +83,7 @@

Florencia D’Andrea

-

2024-03-13

+

2024-03-14

Source: vignettes/facebook_mobility_csvs_to_raster_files.Rmd
facebook_mobility_csvs_to_raster_files.Rmd
diff --git a/docs/articles/quadkey_identified_data_to_raster.html b/docs/articles/quadkey_identified_data_to_raster.html index a9791c6..7f74001 100644 --- a/docs/articles/quadkey_identified_data_to_raster.html +++ b/docs/articles/quadkey_identified_data_to_raster.html @@ -177,13 +177,11 @@

The function add_regular_polygon_grid() returns three outputs in a list:

The number of columns and rows will be useful information for the raster creation step.

@@ -296,8 +294,20 @@

create_qk_grid() by estimating the bounding box from the QuadKeys provided as an argument. However, if desired, you can manually input these arguments and use the function by itself.

-

For this example, we have selected:
xmin = -59,
xmax = -57,
ymin = -35 and. ymax = -34. Let’s plot them as -points.

+

For this example, we have selected:

+ +

Let’s plot them as points.

The QuadKey grid can have a zoom level between 1 (less detail) to 23 (more detail).

diff --git a/docs/articles/quadkey_to_sf_conversion.html b/docs/articles/quadkey_to_sf_conversion.html index ef9f889..0d37756 100644 --- a/docs/articles/quadkey_to_sf_conversion.html +++ b/docs/articles/quadkey_to_sf_conversion.html @@ -83,7 +83,7 @@

Florencia D’Andrea

-

2024-03-13

+

2024-03-14

Source: vignettes/quadkey_to_sf_conversion.Rmd
quadkey_to_sf_conversion.Rmd
diff --git a/docs/articles/quadkey_visualization_app.html b/docs/articles/quadkey_visualization_app.html index 9f98452..630361f 100644 --- a/docs/articles/quadkey_visualization_app.html +++ b/docs/articles/quadkey_visualization_app.html @@ -83,7 +83,7 @@

Florencia D’Andrea

-

2024-03-13

+

2024-03-14

Source: vignettes/quadkey_visualization_app.Rmd
quadkey_visualization_app.Rmd
diff --git a/docs/authors.html b/docs/authors.html index 06e7b00..60e7c4d 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -68,8 +68,8 @@

Authors


Maria Paula Caldas reviewed the package (v. 0.0.0.9000) for rOpenSci, see https://github.com/ropensci/software-review/issues/619

  • -

    Vincent Van Hess. Reviewer. -
    Vincent Van Hess reviewed the package (v. 0.0.0.9000) for rOpenSci, see https://github.com/ropensci/software-review/issues/619

    +

    Vincent van Hees. Reviewer. +
    Vincent van Hees reviewed the package (v. 0.0.0.9000) for rOpenSci, see https://github.com/ropensci/software-review/issues/619

  • CDC's Center for Forecasting and Outbreak Analytics. Funder. diff --git a/docs/index.html b/docs/index.html index fb4829c..8adb685 100644 --- a/docs/index.html +++ b/docs/index.html @@ -93,7 +93,7 @@

    What are QuadKeys in Tile Maps?

    Tile maps divide the Earth’s surface into a grid of tiles, with each tile corresponding to a specific geographic area at various zoom levels.

    QuadKeys represent a location on a map by encoding its hierarchical spatial position as a sequence of characters. They provide an efficient method to address and retrieve specific map tiles, facilitating rapid display within mapping applications.

    -

    +

    The QuadKey of any tile starts with the QuadKey of its parent tile (the containing tile at the previous level). Image extracted from Microsoft’s Bing Maps Tile System webpage.


    diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 4e730e6..a075953 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -6,5 +6,5 @@ articles: quadkey_identified_data_to_raster: quadkey_identified_data_to_raster.html quadkey_to_sf_conversion: quadkey_to_sf_conversion.html quadkey_visualization_app: quadkey_visualization_app.html -last_built: 2024-03-13T20:32Z +last_built: 2024-03-14T15:09Z diff --git a/docs/search.json b/docs/search.json index b2b6827..c3f0d2a 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement florencia.dandrea@gmail.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to quadkeyr","title":"Contributing to quadkeyr","text":"outlines propose change quadkeyr. detailed info contributing , tidyverse packages, please see development contributing guide.","code":""},{"path":"/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to quadkeyr","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to quadkeyr","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed).","code":""},{"path":"/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to quadkeyr","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"Fernandez-Lab-WSU/quadkeyr\", fork = TRUE). Install development dependencies devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. user-facing changes, add bullet top NEWS.md (.e. just first header). Follow style described https://style.tidyverse.org/news.html.","code":""},{"path":"/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to quadkeyr","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to quadkeyr","text":"Please note quadkeyr project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":[]},{"path":"/articles/facebook_mobility_csvs_to_raster_files.html","id":"reading-and-formatting-multiple-csv-files","dir":"Articles","previous_headings":"1 Basic workflow","what":"Reading and formatting multiple csv Files","title":"Converting Facebook Mobility QuadKey-identified Datasets into Raster Files","text":"files area zoom level, dates hours change. information evident filenames: cityA_2020_04_15_0800.csv. read_fb_mobility_files() prints message days hours missing among provided files. columns day hour created internally. Note: Facebook mobility data used quadkeyr altered doesn’t represent real values. examples vignette demostrate functions work. Please, contact Data Good get datasets.","code":"files <- quadkeyr::read_fb_mobility_files( path_to_csvs = paste0(system.file(\"extdata\", 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 = 'c', date_time = 'T', n_crisis = 'c', percent_change = 'c', day = 'D', hour = 'i' ) ) head(files) #> # A tibble: 6 × 8 #> lat lon quadkey date_time n_crisis percent_change day #> #> 1 -34.6 -58.6 2103213001… 2020-04-15 00:00:00 NA 2.86 2020-04-15 #> 2 -34.5 -58.6 2103213001… 2020-04-15 00:00:00 NA -2.60 2020-04-15 #> 3 -34.6 -58.6 2103213001… 2020-04-15 00:00:00 NA 1.46 2020-04-15 #> 4 -34.5 -58.5 2103213001… 2020-04-15 00:00:00 NA 2.61 2020-04-15 #> 5 -34.5 -58.5 2103213001… 2020-04-15 00:00:00 NA 3.24 2020-04-15 #> 6 -34.5 -58.6 2103213001… 2020-04-15 00:00:00 NA 1.17 2020-04-15 #> # ℹ 1 more variable: hour "},{"path":"/articles/facebook_mobility_csvs_to_raster_files.html","id":"create-a-quadkey-polygon-grid-for-your-area-of-analysis","dir":"Articles","previous_headings":"1 Basic workflow","what":"Create a Quadkey polygon grid for your area of analysis","title":"Converting Facebook Mobility QuadKey-identified Datasets into Raster Files","text":"function generates sf POLYGON data.frame quadkey geometry column. might wondering ’re using function ’ve already created, add_regular_polygon_grid(), adds column QuadKey polygons, creating regular grid, existing data.frame. two reasons ’re using different approach: 1 - read_fb_mobility_files() output contains multiple datasets area almost QuadKeys reported. Using function calculates QuadKey row unnecessarily duplicate calculations. 2 - receive Facebook mobility data, might always get exactly QuadKeys files, even report area. especially important considering may receiving new files future QuadKeys haven’t reported yet. ’s create sf POLYGON data.frame, retaining QuadKey polygons within area analysis, proceed join results. creating regular polygon grid using bounding box provided QuadKeys may work case, can directly create grid full area analysis using create_qk_grid() function. Read previous vignette learn function. Now, can merge grid Facebook mobility data files data.frame. ’ve chosen use dplyr::inner_join() retain polygons reported files. want modify variables intend use, done point. example,apply_weekly_lag() applies 7 day lag n_crisis percent_change creating new variables. apply function files select resulting variable percent_change_7 argument var polygon_to_raster() demonstrating example. Now polygons, let’s create raster files.","code":"regular_grid <- quadkeyr::get_regular_polygon_grid(data = files) head(regular_grid$data) #> Simple feature collection with 6 features and 3 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -58.59009 ymin: -34.59252 xmax: -58.52417 ymax: -34.51108 #> Geodetic CRS: WGS 84 #> # A tibble: 6 × 4 #> # Rowwise: #> quadkey geometry tileX tileY #> #> 1 2103213001233302 ((-58.55713 -34.588, -58.55164 -34.588, -58.5516… 22108 39485 #> 2 2103213001213202 ((-58.5791 -34.51561, -58.57361 -34.51561, -58.5… 22104 39469 #> 3 2103213001233221 ((-58.57361 -34.59252, -58.56812 -34.59252, -58.… 22105 39486 #> 4 2103213001231110 ((-58.54614 -34.52919, -58.54065 -34.52919, -58.… 22110 39472 #> 5 2103213001320003 ((-58.52966 -34.53371, -58.52417 -34.53371, -58.… 22113 39473 #> 6 2103213001230110 ((-58.59009 -34.52919, -58.58459 -34.52919, -58.… 22102 39472 ggplot() + geom_sf(data = regular_grid$data, color = 'red', linewidth = 1.5, fill = NA) + theme_minimal() files_polygons <- files |> dplyr::inner_join(regular_grid$data, by = c(\"quadkey\")) head(files_polygons) #> # A tibble: 6 × 11 #> lat lon quadkey date_time n_crisis percent_change day #> #> 1 -34.6 -58.6 2103213001… 2020-04-15 00:00:00 NA 2.86 2020-04-15 #> 2 -34.5 -58.6 2103213001… 2020-04-15 00:00:00 NA -2.60 2020-04-15 #> 3 -34.6 -58.6 2103213001… 2020-04-15 00:00:00 NA 1.46 2020-04-15 #> 4 -34.5 -58.5 2103213001… 2020-04-15 00:00:00 NA 2.61 2020-04-15 #> 5 -34.5 -58.5 2103213001… 2020-04-15 00:00:00 NA 3.24 2020-04-15 #> 6 -34.5 -58.6 2103213001… 2020-04-15 00:00:00 NA 1.17 2020-04-15 #> # ℹ 4 more variables: hour , geometry , tileX , #> # tileY # Generate the raster files quadkeyr::polygon_to_raster(data = files_polygons, nx = regular_grid$num_cols, ny = regular_grid$num_rows, template = files_polygons, var = 'percent_change', filename = 'cityA', path = paste0( system.file(\"extdata\", package = \"quadkeyr\"), \"/\")) raster <- stars::read_stars(paste0(system.file(\"extdata\", package = \"quadkeyr\"), \"/cityA_2020-04-15_16.tif\")) # More about plotting: # https://r-spatial.github.io/stars/reference/geom_stars.html ggplot() + geom_stars(data = raster) + coord_equal() + theme_void() + scale_fill_viridis_c(na.value = \"transparent\")+ scale_x_discrete(expand=c(0,0))+ scale_y_discrete(expand=c(0,0))"},{"path":"/articles/facebook_mobility_csvs_to_raster_files.html","id":"advanced-use-intermediate-functions","dir":"Articles","previous_headings":"","what":"Advanced use: intermediate functions","title":"Converting Facebook Mobility QuadKey-identified Datasets into Raster Files","text":"function get_regular_polygon_grid() wrapper quadkey_to_latlong(), regular_qk_grid(), grid_to_polygon(). Let’s explore functions operating isolation. work output read_fb_mobility_files(), already used basic workflow: two functions wrapped inside read_fb_mobility_files() may want use individually: wish correct Facebook-provided format , can utilize format_fb_data() function. need retrieve missing combinations days hours temporal sequence files, can employ missing_combinations(). Please, refer examples functions’ documentation understand better work.","code":"head(files) #> # A tibble: 6 × 8 #> lat lon quadkey date_time n_crisis percent_change day #> #> 1 -34.6 -58.6 2103213001… 2020-04-15 00:00:00 NA 2.86 2020-04-15 #> 2 -34.5 -58.6 2103213001… 2020-04-15 00:00:00 NA -2.60 2020-04-15 #> 3 -34.6 -58.6 2103213001… 2020-04-15 00:00:00 NA 1.46 2020-04-15 #> 4 -34.5 -58.5 2103213001… 2020-04-15 00:00:00 NA 2.61 2020-04-15 #> 5 -34.5 -58.5 2103213001… 2020-04-15 00:00:00 NA 3.24 2020-04-15 #> 6 -34.5 -58.6 2103213001… 2020-04-15 00:00:00 NA 1.17 2020-04-15 #> # ℹ 1 more variable: hour "},{"path":"/articles/facebook_mobility_csvs_to_raster_files.html","id":"convert-the-quadkeys-to-latitudelongitude-coordinates","dir":"Articles","previous_headings":"2 Advanced use: intermediate functions","what":"Convert the QuadKeys to latitude/longitude coordinates","title":"Converting Facebook Mobility QuadKey-identified Datasets into Raster Files","text":"Even files correspond location, amount QuadKeys reported vary. start, select files QuadKeys appear least convert sf POINT data.frame using quadkey_to_latlong() Let’s plot QuadKey grid.","code":"quadkey_vector <- unique(files$quadkey) qtll <- quadkey_to_latlong(quadkey_data = quadkey_vector) head(qtll) #> Simple feature collection with 6 features and 1 field #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -58.59009 ymin: -34.59704 xmax: -58.52417 ymax: -34.50203 #> Geodetic CRS: WGS 84 #> quadkey geometry #> 150 2103213001322002 POINT (-58.53516 -34.56538) #> 149 2103213001320010 POINT (-58.52417 -34.52466) #> 148 2103213003011101 POINT (-58.55164 -34.59704) #> 147 2103213001212132 POINT (-58.59009 -34.50203) #> 146 2103213001233232 POINT (-58.56812 -34.59252) #> 145 2103213001213300 POINT (-58.55713 -34.50656)"},{"path":"/articles/facebook_mobility_csvs_to_raster_files.html","id":"complete-the-grid","dir":"Articles","previous_headings":"2 Advanced use: intermediate functions","what":"Complete the grid","title":"Converting Facebook Mobility QuadKey-identified Datasets into Raster Files","text":"QuadKeys inside bounding box missing, can’t consider regular grid. order create raster images, need obtain regular grid. can function regular_qk_grid(). Pay attention output list three elements: data. num_rows ; num_cols. outputs num_cols num_rows refer number columns rows, information use create raster. original 150-point grid now one point per row cell, resulting complete grid 369 points, depicted plot. additional points highlighted orange:","code":"regular_grid <- regular_qk_grid(data = qtll) head(regular_grid) #> $data #> Simple feature collection with 396 features and 1 field #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -58.60107 ymin: -34.59704 xmax: -58.50769 ymax: -34.50203 #> Geodetic CRS: WGS 84 #> First 10 features: #> quadkey geometry #> 246 2103213001302123 POINT (-58.50769 -34.50203) #> 245 2103213001302033 POINT (-58.51868 -34.50203) #> 244 2103213001302032 POINT (-58.52417 -34.50203) #> 243 2103213001302023 POINT (-58.52966 -34.50203) #> 242 2103213001213133 POINT (-58.54065 -34.50203) #> 241 2103213001213123 POINT (-58.55164 -34.50203) #> 240 2103213001213122 POINT (-58.55713 -34.50203) #> 239 2103213001213032 POINT (-58.56812 -34.50203) #> 238 2103213001213023 POINT (-58.57361 -34.50203) #> 237 2103213001213022 POINT (-58.5791 -34.50203) #> #> $num_rows #> [1] 22 #> #> $num_cols #> [1] 18"},{"path":"/articles/facebook_mobility_csvs_to_raster_files.html","id":"create-the-polygons","dir":"Articles","previous_headings":"2 Advanced use: intermediate functions","what":"Create the polygons","title":"Converting Facebook Mobility QuadKey-identified Datasets into Raster Files","text":"Now can transform QuadKeys polygons. complete grid QuadKey polygons, combined information Facebook data files. step, can select variables part analysis also create new variables needed.","code":"polygrid <- quadkeyr::grid_to_polygon(data = regular_grid$data) head(polygrid) #> Simple feature collection with 6 features and 3 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -58.59009 ymin: -34.59252 xmax: -58.52417 ymax: -34.51108 #> Geodetic CRS: WGS 84 #> # A tibble: 6 × 4 #> # Rowwise: #> quadkey geometry tileX tileY #> #> 1 2103213001233302 ((-58.55713 -34.588, -58.55164 -34.588, -58.5516… 22108 39485 #> 2 2103213001213202 ((-58.5791 -34.51561, -58.57361 -34.51561, -58.5… 22104 39469 #> 3 2103213001233221 ((-58.57361 -34.59252, -58.56812 -34.59252, -58.… 22105 39486 #> 4 2103213001231110 ((-58.54614 -34.52919, -58.54065 -34.52919, -58.… 22110 39472 #> 5 2103213001320003 ((-58.52966 -34.53371, -58.52417 -34.53371, -58.… 22113 39473 #> 6 2103213001230110 ((-58.59009 -34.52919, -58.58459 -34.52919, -58.… 22102 39472 polyvar <- files |> dplyr::inner_join(polygrid, by = 'quadkey') head(polyvar) #> # A tibble: 6 × 11 #> lat lon quadkey date_time n_crisis percent_change day #> #> 1 -34.6 -58.6 2103213001… 2020-04-15 00:00:00 NA 2.86 2020-04-15 #> 2 -34.5 -58.6 2103213001… 2020-04-15 00:00:00 NA -2.60 2020-04-15 #> 3 -34.6 -58.6 2103213001… 2020-04-15 00:00:00 NA 1.46 2020-04-15 #> 4 -34.5 -58.5 2103213001… 2020-04-15 00:00:00 NA 2.61 2020-04-15 #> 5 -34.5 -58.5 2103213001… 2020-04-15 00:00:00 NA 3.24 2020-04-15 #> 6 -34.5 -58.6 2103213001… 2020-04-15 00:00:00 NA 1.17 2020-04-15 #> # ℹ 4 more variables: hour , geometry , tileX , #> # tileY "},{"path":"/articles/facebook_mobility_csvs_to_raster_files.html","id":"create-the-rasters-for-the-variables-and-data-involved-","dir":"Articles","previous_headings":"2 Advanced use: intermediate functions","what":"Create the rasters for the variables and data involved.","title":"Converting Facebook Mobility QuadKey-identified Datasets into Raster Files","text":"rasters going created automatically day time reported. raster created __