Skip to content

Commit

Permalink
Added note on memoise and other edits to prep for v1.0.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jessecambon committed Oct 30, 2021
1 parent feb86d4 commit 9906c98
Show file tree
Hide file tree
Showing 35 changed files with 288 additions and 246 deletions.
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# tidygeocoder (development version)

- Corrected documentation for `quiet` parameter in `geo()` and `reverse_geo()`
- Reconfigured the vignette so that it is precomputed and is not executed during
`R CMD check` (ie. `devtools::check()`). Also added a check at the beginning of the vignette to check for the availability of APIs. This fixes an issue that occurred on Mac CRAN checks ([#152](https://github.com/jessecambon/tidygeocoder/issues/152)).
- To fix an issue that occurred on Mac CRAN checks ([#152](https://github.com/jessecambon/tidygeocoder/issues/152)) the vignette is now precomputed so that it does not run during `R CMD check` (ie. `devtools::check()`).
- Changed some default parameter values to facilitate the use of the [memoise package](https://memoise.r-lib.org/) ([@dpprdan](https://github.com/dpprdan), [#154](https://github.com/jessecambon/tidygeocoder/pull/154)).

# tidygeocoder 1.0.4

Expand Down
28 changes: 14 additions & 14 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ options(tibble.print_min = 5, tibble.print_max = 5)
[![CRAN Downloads Per Month](http://cranlogs.r-pkg.org/badges/tidygeocoder)](https://cran.r-project.org/package=tidygeocoder)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![R Build Status](https://github.com/jessecambon/tidygeocoder/workflows/R-CMD-check/badge.svg)](https://github.com/jessecambon/tidygeocoder/actions?workflow=R-CMD-check)
[![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.5574263.svg)](https://doi.org/10.5281/zenodo.5574263)
[![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.5627341.svg)](https://doi.org/10.5281/zenodo.5627341)
<!-- badges: end -->

Tidygeocoder makes getting data from geocoding services easy. A unified high-level interface is provided for a selection of [supported geocoding services](https://jessecambon.github.io/tidygeocoder/articles/geocoder_services.html) and results are returned in [tibble](https://tibble.tidyverse.org/) (dataframe) format.
Expand All @@ -45,13 +45,13 @@ In addition to the usage examples below, see the [Getting Started Vignette](http

To install the stable version from CRAN (the official R package servers):

```{r, eval=F}
```{r, eval = FALSE}
install.packages('tidygeocoder')
```

Alternatively, you can install the latest development version from GitHub:

```{r, eval=F}
```{r, eval = FALSE}
devtools::install_github("jessecambon/tidygeocoder")
```

Expand All @@ -61,11 +61,10 @@ In this first example we will geocode a few addresses using the `geocode()` func

```{r}
library(dplyr, warn.conflicts = FALSE)
library(tibble)
library(tidygeocoder)
# create a dataframe with addresses
some_addresses <- tribble(
some_addresses <- tibble::tribble(
~name, ~addr,
"White House", "1600 Pennsylvania Ave NW, Washington, DC",
"Transamerica Pyramid", "600 Montgomery St, San Francisco, CA 94111",
Expand All @@ -87,16 +86,16 @@ Now that we have the longitude and latitude coordinates, we can use ggplot to pl

```{r usamap}
library(ggplot2)
library(maps)
library(ggrepel)
ggplot(lat_longs, aes(longitude, latitude), color = "grey99") +
borders("state") + geom_point() +
geom_label_repel(aes(label = name)) +
ggrepel::geom_label_repel(aes(label = name)) +
theme_void()
```

To perform reverse geocoding (obtaining addresses from geographic coordinates), we can use the `reverse_geocode()` function. The arguments are similar to the `geocode()` function, but now we specify the input data columns with the `lat` and `long` arguments. The dataset used here is from the geocoder query above. The single line address is returned in a column named by the `address` argument and all columns from the geocoding service are returned because `full_results = TRUE`. See the `reverse_geo()` function documentation for more details.
To perform reverse geocoding (obtaining addresses from geographic coordinates), we can use the `reverse_geocode()` function. The arguments are similar to the `geocode()` function, but now we specify the input data columns with the `lat` and `long` arguments. The input dataset used here is from the geocoder query above.

The single line address is returned in a column named by the `address` argument and all columns from the geocoding service results are returned because `full_results = TRUE`. See the `reverse_geo()` function documentation for more details.

<!--
Removing the licence column is done just to prevent a note from
Expand All @@ -117,11 +116,12 @@ knitr::kable(reverse)

For inspiration, here are a few articles (with code) that leverage tidygeocoder:

- [Exercises: Spatial Data Wrangling with sf](http://www2.stat.duke.edu/courses/Spring21/sta323.001/exercises/lec_12.html) - part of a [statistical computing course](http://www2.stat.duke.edu/courses/Spring21/sta323.001/) at Duke.
- [Geocoding the Minard Map](https://www.jla-data.net/eng/minard-map-tidygeocoder/) - recreating a famous infographic with geocoding.
- [Mapping a network of women in demography](https://www.monicaalexander.com/posts/2021-21-02-mapping/) - using rvest and tidygeocoder to map Google Scholar data.
- [Road Routing in R](https://www.jla-data.net/eng/routing-in-r-context/) - demonstration of three different routing APIs.
- [Mapping Texas Ports With R](https://www.sharpsightlabs.com/blog/mapping-texas-ports-with-r-part1/) - mapping the Texas coast with rnaturalearth and sf.
- [Exercises: Spatial Data Wrangling with sf](http://www2.stat.duke.edu/courses/Spring21/sta323.001/exercises/lec_12.html) - part of a [statistical computing course](http://www2.stat.duke.edu/courses/Spring21/sta323.001/) at Duke
- [Geocoding the Minard Map](https://www.jla-data.net/eng/minard-map-tidygeocoder/) - recreating a famous infographic with geocoding
- [Mapping a network of women in demography](https://www.monicaalexander.com/posts/2021-21-02-mapping/) - using rvest and tidygeocoder to map Google Scholar data
- [Mapping Routes](https://bensstats.wordpress.com/2021/10/21/robservations-15-i-reverse-engineered-atlas-co-well-some-of-it/) - mapping routes with tidygeocoder and osrm
- [Road Routing in R](https://www.jla-data.net/eng/routing-in-r-context/) - demonstration of three different routing APIs
- [Mapping Texas Ports With R](https://www.sharpsightlabs.com/blog/mapping-texas-ports-with-r-part1/) - mapping the Texas coast with rnaturalearth and sf

## Contributing

Expand Down
42 changes: 22 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Month](http://cranlogs.r-pkg.org/badges/tidygeocoder)](https://cran.r-project.or
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![R Build
Status](https://github.com/jessecambon/tidygeocoder/workflows/R-CMD-check/badge.svg)](https://github.com/jessecambon/tidygeocoder/actions?workflow=R-CMD-check)
[![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.5574263.svg)](https://doi.org/10.5281/zenodo.5574263)
[![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.5627341.svg)](https://doi.org/10.5281/zenodo.5627341)
<!-- badges: end -->

Tidygeocoder makes getting data from geocoding services easy. A unified
Expand Down Expand Up @@ -66,11 +66,10 @@ In this first example we will geocode a few addresses using the

``` r
library(dplyr, warn.conflicts = FALSE)
library(tibble)
library(tidygeocoder)

# create a dataframe with addresses
some_addresses <- tribble(
some_addresses <- tibble::tribble(
~name, ~addr,
"White House", "1600 Pennsylvania Ave NW, Washington, DC",
"Transamerica Pyramid", "600 Montgomery St, San Francisco, CA 94111",
Expand All @@ -81,7 +80,7 @@ some_addresses <- tribble(
lat_longs <- some_addresses %>%
geocode(addr, method = 'osm', lat = latitude , long = longitude)
#> Passing 3 addresses to the Nominatim single address geocoder
#> Query completed in: 3.6 seconds
#> Query completed in: 3 seconds
```

The `geocode()` function geocodes addresses contained in a dataframe.
Expand All @@ -103,12 +102,10 @@ ggplot to plot our addresses on a map.

``` r
library(ggplot2)
library(maps)
library(ggrepel)

ggplot(lat_longs, aes(longitude, latitude), color = "grey99") +
borders("state") + geom_point() +
geom_label_repel(aes(label = name)) +
ggrepel::geom_label_repel(aes(label = name)) +
theme_void()
```

Expand All @@ -117,11 +114,13 @@ ggplot(lat_longs, aes(longitude, latitude), color = "grey99") +
To perform reverse geocoding (obtaining addresses from geographic
coordinates), we can use the `reverse_geocode()` function. The arguments
are similar to the `geocode()` function, but now we specify the input
data columns with the `lat` and `long` arguments. The dataset used here
is from the geocoder query above. The single line address is returned in
a column named by the `address` argument and all columns from the
geocoding service are returned because `full_results = TRUE`. See the
`reverse_geo()` function documentation for more details.
data columns with the `lat` and `long` arguments. The input dataset used
here is from the geocoder query above.

The single line address is returned in a column named by the `address`
argument and all columns from the geocoding service results are returned
because `full_results = TRUE`. See the `reverse_geo()` function
documentation for more details.

<!--
Removing the licence column is done just to prevent a note from
Expand All @@ -139,9 +138,9 @@ reverse <- lat_longs %>%

| name | latitude | longitude | address\_found | place\_id | osm\_type | osm\_id | osm\_lat | osm\_lon | office | house\_number | road | city | state | postcode | country | country\_code | boundingbox | tourism | neighbourhood | county | suburb |
|:---------------------|---------:|-----------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------|----------:|:----------|----------:|:-------------------|:--------------------|:------------|:--------------|:------------------------------|:--------------|:---------------------|:---------|:--------------|:--------------|:-----------------------------------------------------|:---------------------|:--------------|:--------------|:-------|
| White House | 38.89770 | -77.03655 | White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Columbia, 20500, United States | 159859857 | way | 238241022 | 38.897699700000004 | -77.03655315 | White House | 1600 | Pennsylvania Avenue Northwest | Washington | District of Columbia | 20500 | United States | us | 38.8974908 , 38.897911 , -77.0368537, -77.0362519 | NA | NA | NA | NA |
| Transamerica Pyramid | 37.79520 | -122.40279 | Transamerica Pyramid, 600, Montgomery Street, Chinatown, San Francisco, San Francisco City and County, San Francisco, California, 94111, United States | 106590650 | way | 24222973 | 37.795200550000004 | -122.40279267840137 | NA | 600 | Montgomery Street | San Francisco | California | 94111 | United States | us | 37.7948854 , 37.7954472 , -122.4031399, -122.4024317 | Transamerica Pyramid | Chinatown | San Francisco | NA |
| Willis Tower | 41.87535 | -87.63576 | South Wacker Drive, Printer’s Row, Loop, Chicago, Cook County, Illinois, 60606, United States | 182316972 | way | 337681342 | 41.8753503 | -87.6357587 | NA | NA | South Wacker Drive | Chicago | Illinois | 60606 | United States | us | 41.8749718 , 41.8757997 , -87.6361005, -87.6354602 | NA | Printer’s Row | Cook County | Loop |
| White House | 38.89770 | -77.03655 | White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Columbia, 20500, United States | 159983331 | way | 238241022 | 38.897699700000004 | -77.03655315 | White House | 1600 | Pennsylvania Avenue Northwest | Washington | District of Columbia | 20500 | United States | us | 38.8974908 , 38.897911 , -77.0368537, -77.0362519 | NA | NA | NA | NA |
| Transamerica Pyramid | 37.79520 | -122.40279 | Transamerica Pyramid, 600, Montgomery Street, Chinatown, San Francisco, San Francisco City and County, San Francisco, California, 94111, United States | 106008002 | way | 24222973 | 37.795200550000004 | -122.40279267840137 | NA | 600 | Montgomery Street | San Francisco | California | 94111 | United States | us | 37.7948854 , 37.7954472 , -122.4031399, -122.4024317 | Transamerica Pyramid | Chinatown | San Francisco | NA |
| Willis Tower | 41.87535 | -87.63576 | South Wacker Drive, Printer’s Row, Loop, Chicago, Cook County, Illinois, 60606, United States | 182238096 | way | 337681342 | 41.8753503 | -87.6357587 | NA | NA | South Wacker Drive | Chicago | Illinois | 60606 | United States | us | 41.8749718 , 41.8757997 , -87.6361005, -87.6354602 | NA | Printer’s Row | Cook County | Loop |

## In the Wild

Expand All @@ -152,19 +151,22 @@ tidygeocoder:
sf](http://www2.stat.duke.edu/courses/Spring21/sta323.001/exercises/lec_12.html) -
part of a [statistical computing
course](http://www2.stat.duke.edu/courses/Spring21/sta323.001/) at
Duke.
Duke
- [Geocoding the Minard
Map](https://www.jla-data.net/eng/minard-map-tidygeocoder/) -
recreating a famous infographic with geocoding.
recreating a famous infographic with geocoding
- [Mapping a network of women in
demography](https://www.monicaalexander.com/posts/2021-21-02-mapping/) -
using rvest and tidygeocoder to map Google Scholar data.
using rvest and tidygeocoder to map Google Scholar data
- [Mapping
Routes](https://bensstats.wordpress.com/2021/10/21/robservations-15-i-reverse-engineered-atlas-co-well-some-of-it/) -
mapping routes with tidygeocoder and osrm
- [Road Routing in
R](https://www.jla-data.net/eng/routing-in-r-context/) -
demonstration of three different routing APIs.
demonstration of three different routing APIs
- [Mapping Texas Ports With
R](https://www.sharpsightlabs.com/blog/mapping-texas-ports-with-r-part1/) -
mapping the Texas coast with rnaturalearth and sf.
mapping the Texas coast with rnaturalearth and sf

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

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

Loading

0 comments on commit 9906c98

Please sign in to comment.