From be9bb63013298b141bd1278259f8cafce292fa14 Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Tue, 4 Apr 2023 17:39:37 +0200 Subject: [PATCH] Correct NOTE in R CMD check for a global variable and update documentation --- NAMESPACE | 1 + R/zzz.R | 3 +++ man/CST_InsertDim.Rd | 53 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 man/CST_InsertDim.Rd diff --git a/NAMESPACE b/NAMESPACE index d28fa03b..a2df146d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -20,6 +20,7 @@ export(CST_Calibration) export(CST_CategoricalEnsCombination) export(CST_DynBiasCorrection) export(CST_EnsClustering) +export(CST_InsertDim) export(CST_Load) export(CST_MergeDims) export(CST_MultiEOF) diff --git a/R/zzz.R b/R/zzz.R index 18cddaff..b0c8b259 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -193,3 +193,6 @@ GradientCatsColorBar <- function(nmap, brks = NULL, cols = NULL, vertical = TRUE x <- base::Filter(Negate(.isNullOb), x) lapply(x, function(x) if (is.list(x)) .rmNullObs(x) else x) } + +# Definition of a global variable to store the warning message used in Calibration +warning_shown <- FALSE \ No newline at end of file diff --git a/man/CST_InsertDim.Rd b/man/CST_InsertDim.Rd new file mode 100644 index 00000000..2aa22a5b --- /dev/null +++ b/man/CST_InsertDim.Rd @@ -0,0 +1,53 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/CST_InsertDim.R +\name{CST_InsertDim} +\alias{CST_InsertDim} +\title{Add a named dimension to an object of class s2dv_cube} +\usage{ +CST_InsertDim(data, posdim, lendim, name, values = NULL) +} +\arguments{ +\item{data}{An object of class \code{s2dv_cube} to which the additional +dimension should be added.} + +\item{posdim}{An integer indicating the position of the new dimension.} + +\item{lendim}{An integer indicating the length of the new dimension.} + +\item{name}{A character string indicating the name for the new dimension.} + +\item{values}{A vector containing the values of the new dimension and any +relevant attributes. If NULL, a sequence of integers from 1 to lendim will +be added.} +} +\value{ +An object of class \code{s2dv_cube} with similar data, coordinates and +attributes as the \code{data} input, but with an additional dimension. +} +\description{ +Insert an extra dimension into an array at position 'posdim' with length +'lendim'. The array in \code{data} repeats along the new dimension. +The dimensions, coordinates and attributes are modified accordingly. +} +\examples{ +#Example with sample data: +# Check original dimensions and coordinates +lonlat_temp$exp$dims +names(lonlat_temp$exp$coords) +# Add 'variable' dimension +exp <- CST_InsertDim(lonlat_temp$exp, + posdim = 2, + lendim = 1, + name = "variable", + values = c("tas")) +# Check new dimensions and coordinates +exp$dims +exp$coords$variable + +} +\seealso{ +\link[s2dv]{InsertDim} +} +\author{ +Agudetse Roures Victoria, \email{victoria.agudetse@bsc.es} +} -- GitLab