knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

LEAFPACS

Codecov test coverage R-CMD-check

THIS PACKAGE IS A WORK IN PROGRESS - DON'T USE IN PRODUCTION.

The goal of leafpacs R package is to calculate river LEAFPACS classification.

Installation

Install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("aquaMetrics/leafpacs", dependencies = TRUE)

Example

Run classification:

library(leafpacs)
data <- leafpacs(taxa_data)
data[, c("sample_id", "eqr", "class", "high", "good", "moderate", "poor", "bad")]

Data

Enter taxa and percentage cover categories and/or enter pre-calculated rmni, rfa_pc etc values.

Dataframe structure:

  1. Book-keeping variables for instance locations_id, date_taken etc.
  2. Observation variables: question, response, and taxon.
  3. Predictor variables such as slope, dist_from_source etc.

The columns can be in any order. You can add as many columns as you like as you as you provide the required* columns.

Example data:

Demo data in package, *required columns required:

library(leafpacs)
taxa_data

Download web data including optional extra columns:

library(hera)
data <- get_data(location_id = 92751)
data
#># A tibble: 6 × 21
#>   location_id            location_descri… sample_id date_taken season quality_element question response taxon latitude #> longitude
#>   <chr>                  <chr>            <chr>     <chr>      <chr>  <chr>           <chr>    <chr>    <chr>    <dbl>     #> <dbl>
#> 1 http://environment.da… CAM - 92751      724530    2015-09-08 3      River Macrophy… percent… 8        Phra…     52.1   #> -0.0226
#> 2 http://environment.da… CAM - 92751      724530    2015-09-08 3      River Macrophy… percent… 7        Spar…     52.1   #> -0.0226
#> 3 http://environment.da… CAM - 92751      724530    2015-09-08 3      River Macrophy… n_rfg    0        NA        52.1   #> -0.0226
#> 4 http://environment.da… CAM - 92751      724530    2015-09-08 3      River Macrophy… rmhi     8.62     NA        52.1   #> -0.0226
#> 5 http://environment.da… CAM - 92751      724530    2015-09-08 3      River Macrophy… rmni     8        NA        52.1   #> -0.0226
#> 6 http://environment.da… CAM - 92751      724530    2015-09-08 3      River Macrophy… rn_a_ta… 0        NA        52.1   #> -0.0226
# … with 10 more variables: grid_reference <chr>, alkalinity <chr>, full_result_id <chr>, result.result_id <chr>,
#   result_id <chr>, northing <int>, easting <int>, dist_from_source <chr>, source_altitude <chr>, slope <chr>


aquaMetrics/leafpacs documentation built on Feb. 5, 2022, 9:10 a.m.