Skip to content

Commit

Permalink
Fixed by.inter error
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain-B committed Mar 27, 2023
1 parent dfd9241 commit 9853b0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions R/prepare_refdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#'
Expand All @@ -16,15 +16,15 @@
#' @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)

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."))
}
Expand Down
4 changes: 2 additions & 2 deletions man/prepare_refdata.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9853b0a

Please sign in to comment.