diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2017-01-18 19:58:13 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2017-01-18 19:58:13 +0100 |
commit | a1d9f93138c2cfed92a683e37e72c737d52b7ad7 (patch) | |
tree | b05e26c2c35f62145ad86a34ce43b9aeb9faef91 /man/sawtooth.Rd | |
parent | 7900d5aa3b9e3036d0fd983a5611f71d3f3f64b2 (diff) |
One box time series and twa values
- one_box() creates decline time series from mkinfit objects or simply
from a half-life
- sawtooth() generates sawtooth curves for arbitrary application
patterns and decline models
- twa() calculates moving window averages
- max_twa() gives their maxima and
- plot.one_box() can plot series generated by one_box() or sawtooth(),
optionally adding a greay rectangle to illustrate the maximum moving
window time weighted average
Diffstat (limited to 'man/sawtooth.Rd')
-rw-r--r-- | man/sawtooth.Rd | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/man/sawtooth.Rd b/man/sawtooth.Rd new file mode 100644 index 0000000..4576c8b --- /dev/null +++ b/man/sawtooth.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/twa.R +\name{sawtooth} +\alias{sawtooth} +\title{Create decline time series for multiple applications} +\usage{ +sawtooth(x, n = 1, i = 365, applications = data.frame(time = seq(0, 0 + n + * i, length.out = n), amount = 1)) +} +\arguments{ +\item{x}{A \code{\link{one_box}} object} + +\item{n}{The number of applications. If \code{applications} is specified, \code{n} is not used} + +\item{i}{The interval between applications. If \code{applications} is specified, \code{i} +is not used} + +\item{applications}{A data frame holding the application times in the first column and +the corresponding amounts applied in the second column for each application cycle. +If \code{n} is one, the application pattern specified here is used only once.} +} +\description{ +If the number of application cycles \code{n} is greater than 1, the +application pattern specified in \code{applications} is repeated \code{n} +times, with an interval \code{i}. +} +\examples{ +applications = data.frame(time = seq(0, 14, by = 7), amount = c(1, 2, 3)) +pred <- one_box(10) +plot(sawtooth(pred, applications = applications)) + +m_2 <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO")) +fit_2 <- mkinfit(m_2, FOCUS_2006_D) +pred_2 <- one_box(fit_2) +pred_2_saw <- sawtooth(pred_2, 2, 7) +plot(pred_2_saw, max_twa = 21, max_twa_var = "m1") + +max_twa(pred_2_saw) +} |