knitr::opts_chunk$set( collapse = TRUE, comment = "#>", echo = FALSE ) library(hera) library(dplyr) library(purrr) library(tidyr) library(tibble) library(magrittr) library(testthat) library(visNetwork)
This document has been created following the generic assessment guidance.
Basic details about the assessment. Update the 'response' values as required.
description <- tribble( ~question, ~response, "name_short", "TDI", "name_long", "Example", "parameter", "River Diatoms", "status", "prototype" ) description
A list of questions required to run the assessment.
input <- tibble( location_id = c("8175", "8175"), sample_id = c("12345", "12345"), date_taken = c("2019-11-21", "2019-11-21"), question = c("Taxon abundance", "Alkalinity"), response = c("12", "45"), label = c("Gomphonema olivaceum", NA), parameter = c("River Diatoms", "Chemistry"), type = c("number", "number"), max = c(NA, NA), min = c(NA, NA), source = c("sepa_ecology_results", "location_attributes") ) input
If applicable, write a function to assess your input data and return an outcome. For example, a metric, statistic, prediction etc.
assessment_function <- function(data) { # Calculated some statistic... # Note, any non-standard base R library must be call using require(). # require(dplyr) # require(tidyr) # require(magrittr) # require(tibble) # data <- data %>% # group_by(sample_id) %>% # summarise(question = "n_count", # response = n(), # sample_id = unique(sample_id) # ) return(data) }
The outcome of your assessment.
outcome <- assessment_function(input) outcome
Run checks on the assessment.
# No need to edit this code # Format description standard_format <- hera:::hera_format(description = description) # Check description check_list <- hera:::hera_test(description = description) knitr::kable(check_list$standard_check)
Update the catalogue of assessments to make them available.
# No need to edit this code hera:::update_catalogue( description = description, input = input, assessment_function = assessment_function, output = outcome )
After updating the catalogue, rebuild the package, click on Build > Install and Restart menu or 'Install and Restart' button in the Build pane.
This section tests if this assessment is usable using assessment
function.
# No need to edit this code assess( data = hera::demo_data, name = description$response[description$question == "name_long"] )
Below is an interactive application displaying the results of your assessment.
# No need to edit this code # launch_app(new_catalogue = catalogue, data = data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.