From 63df3871a442de4bf47e4d9de1449e7f6ed65b2f Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 9 Oct 2019 19:17:07 +0200 Subject: Function to set non-detects in residue series --- man/set_nd.Rd | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 man/set_nd.Rd (limited to 'man') diff --git a/man/set_nd.Rd b/man/set_nd.Rd new file mode 100644 index 0000000..8c766ac --- /dev/null +++ b/man/set_nd.Rd @@ -0,0 +1,65 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/process_residues.R +\name{set_nd} +\alias{set_nd} +\alias{set_nd_focus} +\title{Set non-detects in residue series without replicates +Sets non-detects directly before or directly after detects to NA. Values between +lod and loq are set to their mean value if an loq is specified. +If 'time_zero' is set to TRUE, the residue series is assumed to start with time +zero, and non-detects at time zero are set to 'time_zero_nd_value'. For the +set_nd_focus variant, this is zero, otherwise this argument has NA as default +value. +If stopping after the first non-detection is requested, as in in the FOCUS +variant of the function, an loq has to be specified in order to decide +if any later detections are above the loq.} +\usage{ +set_nd(r, lod, loq = NA, time_zero = TRUE, time_zero_nd_value = NA, + stop_after_first_nondetect = FALSE) + +set_nd_focus(res, lod, loq = NA, time_zero = TRUE) +} +\arguments{ +\item{r}{A character vector of sequential residues without replicates, with +non-detects specified as 'nd' and unquantified values above the limit of +detection specified as 'nq', otherwise coercible to numeric} + +\item{lod}{Limit of detection (numeric)} + +\item{loq}{Limit of quantification(numeric). Must be specified if the FOCUS rule to +stop after the first non-detection is to be applied} + +\item{stop_after_first_nondetect}{Should we really stop after the first non-detection?} +} +\description{ +Set non-detects in residue series without replicates +Sets non-detects directly before or directly after detects to NA. Values between +lod and loq are set to their mean value if an loq is specified. +If 'time_zero' is set to TRUE, the residue series is assumed to start with time +zero, and non-detects at time zero are set to 'time_zero_nd_value'. For the +set_nd_focus variant, this is zero, otherwise this argument has NA as default +value. +If stopping after the first non-detection is requested, as in in the FOCUS +variant of the function, an loq has to be specified in order to decide +if any later detections are above the loq. +} +\section{Functions}{ +\itemize{ +\item \code{set_nd_focus}: Set non-detects in residues series according to FOCUS rules +}} + +\examples{ +parent_1 <- c(.12, .09, .05, .03, "nd", "nd", "nd", "nd", "nd", "nd") +set_nd(parent_1, 0.02) +parent_2 <- c(.12, .09, .05, .03, "nd", "nd", .03, "nd", "nd", "nd") +set_nd(parent_2, 0.02) +set_nd_focus(parent_2, 0.02, loq = 0.05) +parent_3 <- c(.12, .09, .05, .03, "nd", "nd", .06, "nd", "nd", "nd") +set_nd(parent_3, 0.02) +set_nd_focus(parent_3, 0.02, loq = 0.05) +metabolite <- c("nd", "nd", "nd", 0.03, 0.06, 0.10, 0.11, 0.10, 0.09, 0.05, 0.03, "nd", "nd") +set_nd(metabolite, 0.02) +} +\references{ +FOCUS (2014) p. 75, 76, 131, 132 +} -- cgit v1.2.1