Learn R Programming

wikilake

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
namevalues_numericvalues_raw
NameLake MendotaLake Mendota
LocationDane County, Wisconsin, U.S.Dane County, Wisconsin, U.S.
TypeNatural freshwater lakeNatural freshwater lake
Primary inflowsYahara RiverYahara River
Primary outflowsYahara RiverYahara River
Catchment area562562 [km^2]
Basin countriesUnited StatesUnited States
Max. length9.049.04 [km]
Max. width6.616.61 [km]
Surface area39.41653922017529740 [acres]
Average depth12.812.8 [m]
Max. depth25.325.3 [m]
Water volumeNA500 million cubic metres
Residence time4.54.5 [years]
Shore length134.834.8 [km]
Surface elevation259259 [m]
FrozenDecember 20 (average freezing date)December 20 (average freezing date)
Lat43.106643.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

Copy Link

Version

Install

install.packages('wikilake')

Monthly Downloads

321

Version

0.7.1

License

GPL (>= 2)

Maintainer

Jemma Stachelek

Last Published

November 14th, 2026

Functions in wikilake (0.7.1)

dms2dd

dms2dd
lake_clean

Clean output of lake_wiki
milakes

Michigan Lakes
parse_unit_brackets

Parse string representation of units package quantities
get_lake_wiki

get_lake_wiki
lake_wiki_browser

lake_wiki_browser
tidy_lake_df

tidy_lake_df
lake_wiki

lake_wiki
wikilake-package

Scrape Wikipedia lakes metadata
map_lake_wiki

map_lake_wiki