aboutsummaryrefslogtreecommitdiff
path: root/R/twa.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2017-05-24 16:07:35 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2017-05-24 16:07:35 +0200
commite6f968cf97ed6ca9268e6098d86ba63ff2c6d2b0 (patch)
tree9a6bcfc76838ce8c5a30163e98745d0ca84494b4 /R/twa.R
parent4835e20d1d08203657ab616600286ad9dfd71344 (diff)
Fix for the sawtooth function for repeated applications
For n > 2, the second application was made at 2 * i instead of i.
Diffstat (limited to 'R/twa.R')
-rw-r--r--R/twa.R2
1 files changed, 1 insertions, 1 deletions
diff --git a/R/twa.R b/R/twa.R
index 0cece29..ace7656 100644
--- a/R/twa.R
+++ b/R/twa.R
@@ -195,7 +195,7 @@ plot.one_box <- function(x,
#'
#' max_twa(pred_2_saw)
sawtooth <- function(x, n = 1, i = 365,
- applications = data.frame(time = seq(0, 0 + n * i, length.out = n),
+ applications = data.frame(time = seq(0, (n - 1) * i, length.out = n),
amount = 1))
{
n_obs = ncol(as.matrix(x))

Contact - Imprint