MyNixOS website logo
Description

Scrape Lake Metadata Tables from Wikipedia.

Scrape lake metadata tables from Wikipedia <https://www.wikipedia.org/>.

wikilake

Lifecycle:stable CRAN_Status_Badge build CRAN RStudio mirrordownloads

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

devtools::install_github("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,United States 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,United States 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,United StatesDane County, Wisconsin,United States
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
#> 1 Gull Lake Kalamazoo / Barry counties, Michigan, United States
#>   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
#> 1 Gull Lake Kalamazoo / Barry counties, Michigan, United States
#>   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 Primary outflows Catchment area
#> 1 Lake Nipigon  Ontario   Glacial    Nipigon River          25400
#>   Basin countries Surface area Average depth Max. depth Water volume
#> 1          Canada         4848          54.9        165     2.48e+11
#>   Shore length1 Surface elevation   Lat   Lon
#> 1          1044               260 49.83 -88.5
lake_wiki("Cass Lake (Michigan)", map = TRUE, database = "state", regions = "Michigan")
#> Retrieving data from: https://en.wikipedia.org/wiki/Cass_Lake_(Michigan)

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

Version

0.7.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows