Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsta/wikilake
Scrape lake metadata tables from Wikipedia 🏞
https://github.com/jsta/wikilake
cran lakes limnology rstats wikipedia
Last synced: about 2 months ago
JSON representation
Scrape lake metadata tables from Wikipedia 🏞
- Host: GitHub
- URL: https://github.com/jsta/wikilake
- Owner: jsta
- Created: 2017-01-03T13:30:07.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:14:27.000Z (about 2 years ago)
- Last Synced: 2024-06-11T17:09:22.936Z (8 months ago)
- Topics: cran, lakes, limnology, rstats, wikipedia
- Language: R
- Homepage: https://jsta.github.io/wikilake
- Size: 1.5 MB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
output: github_document
---```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "tools/images/"
)
```# wikilake
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/wikilake)](https://cran.r-project.org/package=wikilake)
[![Travis-CI Build Status](https://travis-ci.org/jsta/wikilake.svg?branch=master)](https://travis-ci.org/jsta/wikilake)
[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/wikilake)](https://CRAN.R-project.org/package=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
`devtools::install_github("jsta/wikilake")`## Usage
```{r example}
library(wikilake)
``````{r metadata only, warning=FALSE}
# metadata only, see units of numeric fields with wikilake::unit_key_()
lake_wiki("Lake Mendota")
``````{r }
# use the clean = FALSE argument to get raw data
# (i.e. avoid parsing of numeric fields)
lake_wiki("Lake Mendota", clean = FALSE)
``````{r }
# pretty printing metadata
``````{r echo = FALSE, message=FALSE}
knitr::kable(
dplyr::left_join(
tidyr::pivot_longer(lake_wiki("Lake Mendota"),
cols = tidyr::everything(),
values_to = "values_numeric",
values_transform = list(values_numeric = as.character)),
tidyr::pivot_longer(lake_wiki("Lake Mendota", clean = FALSE),
cols = tidyr::everything(),
values_to = "values_raw",
values_transform = list(values_raw = as.character)),
by = "name"))
``````{r worldmapping}
# metadata + map
lake_wiki("Gull Lake (Michigan)", map = TRUE)
``````{r mapping}
lake_wiki("Gull Lake (Michigan)", map = TRUE, database = "usa")
``````{r mapping2}
lake_wiki("Lake Nipigon", map = TRUE, regions = "Canada")
``````{r mapping3}
lake_wiki("Cass Lake (Michigan)", map = TRUE, database = "state", regions = "Michigan")
```