Skip to content
cranPublic

About

❗ This is a read-only mirror of the CRAN R package repository. wikilake — Scrape Lake Metadata Tables from Wikipedia. Homepage: https://codeberg.org/jsta/wikilake Report bugs for this package: https://codeberg.org/jsta/wikilake/issues

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wikilake

Lifecycle: stable CRAN_Status_Badge CRAN RStudio mirror downloads

The wikilake package provides functions to scrape the metadata tables from lake pages on Wikipedia.

Installation

Stable release from CRAN

install.packages("wikilake")

Development version

# install.packages("pak")
pak::pak("git::https://codeberg.org/jsta/wikilake")

Usage

library(wikilake)
#> Loading required package: maps
# metadata only, see units of numeric fields with wikilake::unit_key_()
lake_wiki("Lake Mendota")
#> Retrieving data from: https://en.wikipedia.org/wiki/Lake_Mendota
#>           Name                     Location                    Type
#> 1 Lake Mendota Dane County, Wisconsin, U.S. Natural freshwater lake
#>   Primary inflows Primary outflows Catchment area Basin countries Max. length
#> 1    Yahara River     Yahara River            562   United States        9.04
#>   Max. width Surface area Average depth Max. depth Water volume Residence time
#> 1       6.61     39.41654          12.8       25.3           NA            4.5
#>   Shore length1 Surface elevation                              Frozen     Lat
#> 1          34.8               259 December 20 (average freezing date) 43.1066
#>        Lon
#> 1 -89.4247
# use the clean = FALSE argument to get raw data
# (i.e. avoid parsing of numeric fields)
lake_wiki("Lake Mendota", clean = FALSE)
#> Retrieving data from: https://en.wikipedia.org/wiki/Lake_Mendota
#>           Name                     Location                    Type
#> 1 Lake Mendota Dane County, Wisconsin, U.S. Natural freshwater lake
#>   Primary inflows Primary outflows Catchment area Basin countries Max. length
#> 1    Yahara River     Yahara River     562 [km^2]   United States   9.04 [km]
#>   Max. width Surface area Average depth Max. depth             Water volume
#> 1  6.61 [km] 9740 [acres]      12.8 [m]   25.3 [m] 500 million cubic metres
#>   Residence time Shore length1 Surface elevation
#> 1    4.5 [years]     34.8 [km]           259 [m]
#>                                Frozen     Lat      Lon
#> 1 December 20 (average freezing date) 43.1066 -89.4247
# pretty printing metadata
name values_numeric values_raw
Name Lake Mendota Lake Mendota
Location Dane County, Wisconsin, U.S. Dane County, Wisconsin, U.S.
Type Natural freshwater lake Natural freshwater lake
Primary inflows Yahara River Yahara River
Primary outflows Yahara River Yahara River
Catchment area 562 562 [km^2]
Basin countries United States United States
Max. length 9.04 9.04 [km]
Max. width 6.61 6.61 [km]
Surface area 39.4165392201752 9740 [acres]
Average depth 12.8 12.8 [m]
Max. depth 25.3 25.3 [m]
Water volume NA 500 million cubic metres
Residence time 4.5 4.5 [years]
Shore length1 34.8 34.8 [km]
Surface elevation 259 259 [m]
Frozen December 20 (average freezing date) December 20 (average freezing date)
Lat 43.1066 43.1066
Lon -89.4247 -89.4247
# metadata + map
lake_wiki("Gull Lake (Michigan)", map = TRUE)
#> Retrieving data from: https://en.wikipedia.org/wiki/Gull_Lake_(Michigan)

#>        Name                                            Location Type
#> 1 Gull Lake Kalamazoo / Barry counties, Michigan, United States Lake
#>   Primary outflows Basin countries Surface area Max. depth Surface elevation
#> 1   Gull Creek [1]   United States            8         34               268
#>      Lat     Lon
#> 1 42.399 -85.411
lake_wiki("Gull Lake (Michigan)", map = TRUE, database = "usa")
#> Retrieving data from: https://en.wikipedia.org/wiki/Gull_Lake_(Michigan)

#>        Name                                            Location Type
#> 1 Gull Lake Kalamazoo / Barry counties, Michigan, United States Lake
#>   Primary outflows Basin countries Surface area Max. depth Surface elevation
#> 1   Gull Creek [1]   United States            8         34               268
#>      Lat     Lon
#> 1 42.399 -85.411
lake_wiki("Lake Nipigon", map = TRUE, regions = "Canada")
#> Retrieving data from: https://en.wikipedia.org/wiki/Lake_Nipigon

#>           Name Location Lake type
#> 1 Lake Nipigon  Ontario   Glacial
#>                                                                      Primary inflows
#> 1 Gull, Wabinosh, Whitesand, Little Jackfish, Ombabika, Onaman, Namewaminikan rivers
#>   Primary outflows Catchment area Basin countries Surface area Average depth
#> 1    Nipigon River          24560          Canada         4848          54.9
#>   Max. depth Water volume Shore length1 Surface elevation     Lat     Lon
#> 1        165     2.66e+11          1044               260 49.8233 -88.518
lake_wiki("Cass Lake (Michigan)", map = TRUE, database = "state", regions = "Michigan")
#> Retrieving data from: https://en.wikipedia.org/wiki/Cass_Lake_(Michigan)

#>        Name                 Location Type Basin countries Surface area
#> 1 Cass Lake Oakland County, Michigan Lake   United States     5.179997
#>   Max. depth Surface elevation    Lat     Lon
#> 1         37               283 42.606 -83.365

About

❗ This is a read-only mirror of the CRAN R package repository. wikilake — Scrape Lake Metadata Tables from Wikipedia. Homepage: https://codeberg.org/jsta/wikilake Report bugs for this package: https://codeberg.org/jsta/wikilake/issues

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages