well_report: Compile report

View source: R/report.R

well_reportR Documentation

Compile report

Description

Compile report

Usage

well_report(
  ows,
  name = "report",
  report_dates = c(Sys.Date() - lubridate::weeks(2), Sys.Date() - lubridate::weeks(4)),
  title = NULL,
  description = NULL,
  remarks = NULL,
  n_days = 13,
  years_min = 5,
  out_dir = ".",
  cache_age = 7,
  water_year_start = 10
)

Arguments

ows

Character vector. Observation well numbers (e.g, "OW000")

name

Character string. Short text to name the file. Will become name_YYYY_MM_DD.html

report_dates

Character vector. Two current dates to explore. By default a date 2 week ago and 4 weeks before that are used.

title

Character. Title of the report.

description

Character. Descriptive paragraph to place at the start.

remarks

Character / data frame. Path to file OR data frame containing remarks on specific observation wells to be included in the main summary table (see Details).

n_days

Numeric. If there is no data on the report date chosen, this is the range of days over which to look for alternative dates with data. Defaults to 2 weeks, meaning 2 weeks before and 2 weeks after a given report date, for a total window of 4 weeks.

years_min

Numeric. Minimum number of years required to to calculate a percentiles

out_dir

Character. Location of output report. Defaults to working directory.

cache_age

Logical. Maximum age in days of cached datasets (not obs well data, but metadata related to regional maps, aquifer and wells).

Details

remarks can be a file path to a TSV (tab-separated) text file or Excel file contain columns 'ow' and 'remarks', or it can be a data.frame()/tibble() (see examples) containing the same. Note that CSV is not permitted as ',' is used for separating variables which can make it difficult to write out complete, complex remarks.

Examples


## Not run: 

well_report(ows = c("OW008", "OW217", "OW377", "OW197"))

# If short, easiest to add remarks in script:

library(dplyr)

remarks <- tribble(~ow,     ~remarks,
                   "OW377", "Construction in the area disrupting measurements",
                   "OW008", "No problems")

well_report(ows = c("OW008", "OW217", "OW377", "OW197"),
            remarks = remarks)

# Or load from a file
library(readr)
write_tsv(remarks, "remarks.txt")
check_remarks(remarks = "remarks.txt")

## End(Not run)


bcgov/bcgwlreports documentation built on Aug. 9, 2024, 10:47 p.m.