Learn R Programming

openadds (version 0.2.0)

oa_get: Get data from Openaddresses

Description

Get data from Openaddresses

Usage

oa_get(x, overwrite = FALSE, ...)

Arguments

x
(character) URL for an openaddresses dataset, or an object of class openadd
overwrite
(logical) Will only overwrite existing path if TRUE
...
Pass on curl options to HttpClient

Value

a tibble (a data.frame), with attributes for original url and path on disk

References

https://openaddresses.io/

Examples

Run this code
## Not run: 
# (out1 <- oa_get("http://data.openaddresses.io/runs/142103/at/tirol.zip"))
# (out2 <-
#   oa_get("http://data.openaddresses.io/runs/142676/ca/bc/victoria.zip"))
# 
# # from a openadd class object
# oa_get(as_openadd(country="us", state="nv", city="las_vegas"))
# 
# # combine data sets
# (alldat <- oa_combine(out1, out2))
# 
# # Map data
# if (!requireNamespace("leaflet")) {
#   install.packages("leaflet")
# }
# library(leaflet)
# small <- out2[[1]][1:5000,]
# leaflet(small) %>%
#   addTiles() %>%
#   addCircles(lat = ~LAT, lng = ~LON,
#              popup = unname(apply(small[, c('NUMBER', 'STREET')], 1,
#              paste, collapse = " ")))
# ## End(Not run)

Run the code above in your browser using DataLab