From 4e1cfcdd18a4d2270e480290015483331681e644 Mon Sep 17 00:00:00 2001 From: aho Date: Wed, 21 Oct 2020 13:38:48 +0200 Subject: [PATCH] Fix example in Composite.R and update .Rd --- R/Composite.R | 3 ++- man/Composite.Rd | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/R/Composite.R b/R/Composite.R index 90abb5ba..f6860497 100644 --- a/R/Composite.R +++ b/R/Composite.R @@ -69,11 +69,12 @@ #' #'filled.contour(Composite(var=f1, occ=occ2)$composite[,,1]) #' -#'Example with one missing composite (#3) in occ: +#'# Example with one missing composite (#3) in occ: #'data <- 1 : (4 * 5 * 6) #'dim(data) <- c(lon = 4, lat = 5, case = 6) #'occ <- c(1, 1, 2, 2, 3, 3) #'res <- Composite(data, occ, K = 4) +#' #'@importFrom stats sd pt #'@export Composite <- function(var, occ, lag = 0, eno = FALSE, K = NULL, fileout = NULL) { diff --git a/man/Composite.Rd b/man/Composite.Rd index 4e990020..3d9a3fd8 100644 --- a/man/Composite.Rd +++ b/man/Composite.Rd @@ -4,7 +4,7 @@ \alias{Composite} \title{Computes composites} \usage{ -Composite(var, occ, lag = 0, eno = FALSE, fileout = NULL) +Composite(var, occ, lag = 0, eno = FALSE, K = NULL, fileout = NULL) } \arguments{ \item{var}{3-dimensional array (x, y, time) containing the variable to @@ -23,6 +23,8 @@ use +2 occurrences (i.e., shifted 2 time steps forward). Default is lag = 0.} \item{eno}{For using the effective sample size (TRUE) or the total sample size (FALSE that is the default) for the number of degrees of freedom.} +\item{K}{numeric value indicating the maximum number of composites. By default (NULL), it takes the maximum value provided in occ.} + \item{fileout}{Name of the .sav output file (NULL is the default).} } \value{ @@ -76,6 +78,13 @@ occ2 <- rep(0, 30) occ2[c(3, 9, 15, 21)] <- 1 filled.contour(Composite(var=f1, occ=occ2)$composite[,,1]) + +# Example with one missing composite (#3) in occ: +data <- 1 : (4 * 5 * 6) +dim(data) <- c(lon = 4, lat = 5, case = 6) +occ <- c(1, 1, 2, 2, 3, 3) +res <- Composite(data, occ, K = 4) + } \author{ History: -- GitLab