R/fourier_series.R

Defines functions fourier_series

Documented in fourier_series

#' Title
#'
#' @param x TODO
#' @param n TODO
#' @param period TODO
#'
#' @return
#' @export
#'
#' @examples # TODO
fourier_series <- function(x, n, period) {
  p2 <- "2 * pi"
  h <-  seq_len(n)
  paste0("sin(", x, " * ", h, " * ", p2, " / ", period, ")", " + ", 
         "cos(", x, " * ", h, " * ", p2, " / ", period, ")", 
         collapse = " + ")
}
IDEMSInternational/RInstatClimatic documentation built on June 30, 2023, 7:40 p.m.