pl_search | R Documentation |
This function searches a locally created SQLite database created from csv files.
pl_search(query = NULL, ...) pl_search_loc(query = NULL, ...) pl_search_names(query = NULL, ...) pl_search_places(query = NULL, ...)
query |
A place ID. If left NULL, returns the table, which is of
class |
... |
Further args passed on to |
On the first query if not run before, the function takes a bit to get the raw data (if not already gotten), temporarily load the raw csv data, then create a SQLite database, and create the pointer to it. Subsequent calls should be very fast.
There is a function pl_cache, used to download the raw csv files. That function is run internally in these functions if you have not run it before, or if only some fo the files are present.
Requires RSQLite
package
## Not run: pl_search() pl_search_loc() pl_search_names() pl_search_places() pl_search_loc("SELECT * FROM locations limit 5") pl_search_names("SELECT * FROM names limit 5") pl_search_places("SELECT * FROM places limit 5") library(dplyr) locs <- pl_search("SELECT * FROM locations limit 1000") %>% select(pid, reprLat, reprLong) nms <- pl_search("SELECT * FROM names limit 1000") %>% select(pid) left_join(locs, nms, "pid", copy = TRUE) %>% collect %>% NROW ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.