From e6f968cf97ed6ca9268e6098d86ba63ff2c6d2b0 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 24 May 2017 16:07:35 +0200 Subject: Fix for the sawtooth function for repeated applications For n > 2, the second application was made at 2 * i instead of i. --- R/twa.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'R') 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)) -- cgit v1.2.1