Title: | Scrape Lake Metadata Tables from Wikipedia |
---|---|
Description: | Scrape lake metadata tables from Wikipedia <https://www.wikipedia.org/>. |
Authors: | Jemma Stachelek [aut, cre] |
Maintainer: | Jemma Stachelek <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.7.0 |
Built: | 2025-01-28 03:54:07 UTC |
Source: | https://github.com/jsta/wikilake |
Convert numeric coordinate vectors in degrees, minutes, and seconds to decimal degrees
dms2dd(x)
dms2dd(x)
x |
numeric vector of length 3 corresponding to degrees, minutes, and seconds |
dt <- rbind(c(25,12,53.66),c(-80,32,00.61)) apply(dt, 1, function(x) dms2dd(x))
dt <- rbind(c(25,12,53.66),c(-80,32,00.61)) apply(dt, 1, function(x) dms2dd(x))
get_lake_wiki
get_lake_wiki(lake_name, cond = NA)
get_lake_wiki(lake_name, cond = NA)
lake_name |
character |
cond |
character stopping condition |
## Not run: get_lake_wiki("Lake Nipigon") ## End(Not run)
## Not run: get_lake_wiki("Lake Nipigon") ## End(Not run)
Currently the only operation is to standardize the units of numeric fields. See the output units with the unit_key_ function.
lake_clean(dt)
lake_clean(dt)
dt |
output of the lake_wiki function |
## Not run: dt <- lake_wiki(c("Lake Mendota","Flagstaff Lake (Maine)")) dt_clean <- lake_clean(dt) dt <- lake_wiki(c("Lake Mendota","Trout Lake (Wisconsin)")) dt_clean <- lake_clean(dt) ## End(Not run)
## Not run: dt <- lake_wiki(c("Lake Mendota","Flagstaff Lake (Maine)")) dt_clean <- lake_clean(dt) dt <- lake_wiki(c("Lake Mendota","Trout Lake (Wisconsin)")) dt_clean <- lake_clean(dt) ## End(Not run)
lake_wiki
lake_wiki(lake_name, map = FALSE, clean = TRUE, ...)
lake_wiki(lake_name, map = FALSE, clean = TRUE, ...)
lake_name |
character |
map |
logical produce map of lake location? |
clean |
logical enforce standardized units following wikilake::unit_key_()? |
... |
arguments passed to maps::map |
## Not run: lake_wiki("Lake Peipsi") lake_wiki("Flagstaff Lake (Maine)") lake_wiki("Lake George (Michigan-Ontario)") lake_wiki("Lake Michigan", map = TRUE, "usa") lake_wiki("Lac La Belle, Michigan") lake_wiki("Lake Antoine") lake_wiki("Lake Baikal") lake_wiki("Dockery Lake (Michigan)") lake_wiki("Coldwater Lake") lake_wiki("Bankson Lake") lake_wiki("Fisher Lake (Michigan)") lake_wiki("Beals Lake") lake_wiki("Devils Lake (Michigan)") lake_wiki("Lake Michigan") lake_wiki("Fletcher Pond") lake_wiki("Lake Bella Vista (Michigan)") lake_wiki("Lake Mendota") lake_wiki("Lake Mendota", map = TRUE, "usa") lake_wiki("Lake Nipigon", map = TRUE, regions = "Canada") lake_wiki("Trout Lake (Wisconsin)") # a vector of lake names lake_wiki(c("Lake Mendota","Trout Lake (Wisconsin)")) lake_wiki(c("Lake Mendota","Trout Lake (Wisconsin)"), map = TRUE) # throws warning on redirects lake_wiki("Beals Lake") # ignore notability box lake_wiki("Rainbow Lake (Waterford Township, Michigan)") ## End(Not run)
## Not run: lake_wiki("Lake Peipsi") lake_wiki("Flagstaff Lake (Maine)") lake_wiki("Lake George (Michigan-Ontario)") lake_wiki("Lake Michigan", map = TRUE, "usa") lake_wiki("Lac La Belle, Michigan") lake_wiki("Lake Antoine") lake_wiki("Lake Baikal") lake_wiki("Dockery Lake (Michigan)") lake_wiki("Coldwater Lake") lake_wiki("Bankson Lake") lake_wiki("Fisher Lake (Michigan)") lake_wiki("Beals Lake") lake_wiki("Devils Lake (Michigan)") lake_wiki("Lake Michigan") lake_wiki("Fletcher Pond") lake_wiki("Lake Bella Vista (Michigan)") lake_wiki("Lake Mendota") lake_wiki("Lake Mendota", map = TRUE, "usa") lake_wiki("Lake Nipigon", map = TRUE, regions = "Canada") lake_wiki("Trout Lake (Wisconsin)") # a vector of lake names lake_wiki(c("Lake Mendota","Trout Lake (Wisconsin)")) lake_wiki(c("Lake Mendota","Trout Lake (Wisconsin)"), map = TRUE) # throws warning on redirects lake_wiki("Beals Lake") # ignore notability box lake_wiki("Rainbow Lake (Waterford Township, Michigan)") ## End(Not run)
lake_wiki_browser
lake_wiki_browser(lake_wiki_obj = NA, lake_names = NA)
lake_wiki_browser(lake_wiki_obj = NA, lake_names = NA)
lake_wiki_obj |
data.frame output of lake_wiki |
lake_names |
fallback character vector of lake names |
## Not run: lake_wiki_browser(lake_names = "Lake Mendota") lake_wiki_browser(lake_names = c("Lake Mendota", "Lake Champlain")) lake_wiki_browser(lake_wiki(c("Lake Mendota", "Lake Champlain"))) ## End(Not run)
## Not run: lake_wiki_browser(lake_names = "Lake Mendota") lake_wiki_browser(lake_names = c("Lake Mendota", "Lake Champlain")) lake_wiki_browser(lake_wiki(c("Lake Mendota", "Lake Champlain"))) ## End(Not run)
map_lake_wiki
map_lake_wiki(res, ...)
map_lake_wiki(res, ...)
res |
data.frame output of get_lake_wiki |
... |
arguments passed to maps::map |
## Not run: map_lake_wiki(lake_wiki("Corey Lake"), database = "usa") map_lake_wiki(lake_wiki("Lake Nipigon"), regions = "Canada") ## End(Not run)
## Not run: map_lake_wiki(lake_wiki("Corey Lake"), database = "usa") map_lake_wiki(lake_wiki("Lake Nipigon"), regions = "Canada") ## End(Not run)
Metadata of Michigan lakes scraped from Wikipedia.
A data frame with 48 columns and 177 rows:
Name: lake name
Location: location description
Primary inflows: rivers and streams
Basin countries: countries
Surface area: hectares
Max. depth: meters
Surface elevation: meters
Lat: decimal degrees
Lon: decimal degrees
Primary outflows: rivers and streams
Average depth: meters
Max. length: meters
Max. width: meters
Parse string representation of units package quantities
parse_unit_brackets(x, target_unit = NA)
parse_unit_brackets(x, target_unit = NA)
x |
character string with unit in brackets |
target_unit |
target unit to convert to. optional |
x <- "1 [m]" x <- "8.5 [m]" parse_unit_brackets(x, "feet")
x <- "1 [m]" x <- "8.5 [m]" parse_unit_brackets(x, "feet")
tidy_lake_df
tidy_lake_df(lake)
tidy_lake_df(lake)
lake |
data.frame output of get_lake_wiki |