R-CMD-check

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

whpt

The goal of whpt package is to predict WHPT scores, and assess them against the expected class. This shows if a WHPT score is consistent with what is expected at a given location.

Installation

Install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("ecodata1/whpt")

Example

To run the prediction and check the consistency:

library(whpt)
library(dplyr)
whpts(demo_data)

Predict

To run a prediction, only need "GIS" and date variables (but you can have extra variables and doesn't matter what order or upper /lower case:)

# Select only the variables needed to run a prediction:
data <- demo_data
names(data) <- tolower(names(data))
 data <- select(
    data,
    sample_id,
    date_taken,
    ngr,
    altitude,
    d_f_source,
    logaltbar,
    log_area,
    disch_cat,
    slope,
    chalk,
    clay,
    hardrock,
    limestone,
    peat)

whpt_predict(data)

Predict and Assess

To run a prediction and then assess consistency:

predictions <- whpt_predict(demo_data)
data <- bind_rows(demo_data, predictions)
consistency(data)


ecodata1/whpt documentation built on Sept. 27, 2024, 9:02 p.m.