From 9853b0a8d390c5d699abe7c797a0678836ec234a Mon Sep 17 00:00:00 2001 From: Romain Bulteau Date: Mon, 27 Mar 2023 17:50:39 +0200 Subject: [PATCH] Fixed by.inter error --- R/prepare_refdata.R | 6 +++--- man/prepare_refdata.Rd | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/prepare_refdata.R b/R/prepare_refdata.R index 057c555..659f27e 100644 --- a/R/prepare_refdata.R +++ b/R/prepare_refdata.R @@ -5,7 +5,7 @@ #' #' @param ref the name of the reference dataset to load (as given in \code{\link{list_refs}}). #' @param datapkg the name of the data-package to load the rreference from. -#' @param n.inter the resolution of the interpolation, as in \code{seq(start, end, length.out = n.inter)}. +#' @param n.inter,by.inter the resolution of the interpolation, as in \code{seq(start, end, length.out = n.inter)} or \code{seq(start, end, by = by.inter)}. #' #' @return a list with the interpolated reference dataset and its associated time series. #' @@ -16,7 +16,7 @@ #' @eval ae_example() #' #' @importFrom utils getFromNamespace -prepare_refdata <- function(ref, datapkg, n.inter = 200) +prepare_refdata <- function(ref, datapkg, n.inter = NULL, by.inter = NULL) { requireNamespace(datapkg) prepf <- paste0(".prepref_", ref) @@ -24,7 +24,7 @@ prepare_refdata <- function(ref, datapkg, n.inter = 200) if(exists(prepf, where = asNamespace(datapkg), mode = 'function')){ prepf <- utils::getFromNamespace(x = prepf, ns = datapkg) - return(invisible(prepf(n.inter = n.inter))) + return(invisible(prepf(n.inter = n.inter, by.inter = by.inter))) } else { stop(paste0("Reference ", ref, " not found. Check list_refs(datapkg = '", datapkg, "') for a valid reference.")) } diff --git a/man/prepare_refdata.Rd b/man/prepare_refdata.Rd index be0d461..f610163 100644 --- a/man/prepare_refdata.Rd +++ b/man/prepare_refdata.Rd @@ -4,14 +4,14 @@ \alias{prepare_refdata} \title{Prepare the reference data included in the package} \usage{ -prepare_refdata(ref, datapkg, n.inter = 200) +prepare_refdata(ref, datapkg, n.inter = NULL, by.inter = NULL) } \arguments{ \item{ref}{the name of the reference dataset to load (as given in \code{\link{list_refs}}).} \item{datapkg}{the name of the data-package to load the rreference from.} -\item{n.inter}{the resolution of the interpolation, as in \code{seq(start, end, length.out = n.inter)}.} +\item{n.inter, by.inter}{the resolution of the interpolation, as in \code{seq(start, end, length.out = n.inter)} or \code{seq(start, end, by = by.inter)}.} } \value{ a list with the interpolated reference dataset and its associated time series.