diff --git a/NEWS.md b/NEWS.md index 0db53f4..dbf954d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ * Column names can often now be additionally specified by a character string containing either comma separated column names, for example, `"x,y,z"`, or the start and end column separated by a colon, for example, `"x:z"` * Fixed a bug in `interpolateLinear()` causing partial last observation carried forward behaviour when its `roll` argument was specified smaller than the size of the gap to be interpolated * Fixed a bug in `interpolateLinear()` causing partial interpolation in certain cases when its `roll` argument was specified smaller than the size of the gap to be interpolated +* Slightly improved documentation # DTSg v1.0.0 diff --git a/R/Swrappers.R b/R/Swrappers.R index 050489d..2a80859 100644 --- a/R/Swrappers.R +++ b/R/Swrappers.R @@ -16,7 +16,7 @@ #' @seealso [`S3Methods`], [`R6::R6Class`] #' #' @examples -#' # generate an S3 wrapper method for 'alter' of 'DTSg' +#' # generate an S3 wrapper method for 'alter()' of 'DTSg' #' alter.DTSg <- S3WrapperGenerator( #' R6Method = DTSg$public_methods$alter #' ) @@ -431,6 +431,9 @@ cols <- function(x, ...) { #' ## R6 method #' x$cols(class = "numeric") #' +#' ## 'names()' is a "hidden" R6 alias for 'cols()' +#' x$names(class = "numeric") +#' #' ## S3 method #' cols(x = x, class = "numeric") #' @@ -826,6 +829,12 @@ rowaggregate <- function(x, ...) { #' fun = list(mean = mean, sd = sd) #' )$print() #' +#' ## 'raggregate()' is a "hidden" R6 alias for 'rowaggregate()' +#' x$raggregate( +#' resultCols = "flow", +#' fun = list(mean = mean, sd = sd) +#' )$print() +#' #' ## S3 method #' print(rowaggregate( #' x = x, @@ -867,6 +876,12 @@ rowbind <- function(x, ...) { #' flow[1501:.N, ] #' )$print() #' +#' ## 'rbind()' is a "hidden" R6 alias for 'rowbind()' +#' x$rbind( +#' list(flow[1001:1500, ], DTSg$new(values = flow[501:1000, ])), +#' flow[1501:.N, ] +#' )$print() +#' #' ## S3 method #' print(rowbind( #' x = x, @@ -913,6 +928,12 @@ setColNames <- function(x, ...) { #' values = "River Flow" #' )$print() #' +#' ## 'setnames()' is a "hidden" R6 alias for 'setColNames()' +#' x$setnames( +#' cols = "flow", +#' values = "River Flow" +#' )$print() +#' #' ## S3 method #' print(setColNames( #' x = x, @@ -965,6 +986,13 @@ setCols <- function(x, ...) { #' values = 100 #' )$print() #' +#' ## 'set()' is a "hidden" R6 alias for 'setCols()' +#' x$set( +#' i = flow > 100, +#' cols = "flow", +#' values = 100 +#' )$print() +#' #' ## S3 method #' print(setCols( #' x = x, diff --git a/man/S3WrapperGenerator.Rd b/man/S3WrapperGenerator.Rd index 7fdfffc..d467629 100644 --- a/man/S3WrapperGenerator.Rd +++ b/man/S3WrapperGenerator.Rd @@ -25,7 +25,7 @@ Generates S3 wrapper methods for public methods of \code{R6ClassGenerator}s, but can also be used to generate \dQuote{plain} function wrappers. } \examples{ -# generate an S3 wrapper method for 'alter' of 'DTSg' +# generate an S3 wrapper method for 'alter()' of 'DTSg' alter.DTSg <- S3WrapperGenerator( R6Method = DTSg$public_methods$alter ) diff --git a/man/cols.DTSg.Rd b/man/cols.DTSg.Rd index 2c3b92e..767a2e7 100644 --- a/man/cols.DTSg.Rd +++ b/man/cols.DTSg.Rd @@ -41,6 +41,9 @@ x <- DTSg$new(values = flow) ## R6 method x$cols(class = "numeric") +## 'names()' is a "hidden" R6 alias for 'cols()' +x$names(class = "numeric") + ## S3 method cols(x = x, class = "numeric") diff --git a/man/rowaggregate.DTSg.Rd b/man/rowaggregate.DTSg.Rd index 7568026..42f073f 100644 --- a/man/rowaggregate.DTSg.Rd +++ b/man/rowaggregate.DTSg.Rd @@ -71,6 +71,12 @@ x$rowaggregate( fun = list(mean = mean, sd = sd) )$print() +## 'raggregate()' is a "hidden" R6 alias for 'rowaggregate()' +x$raggregate( + resultCols = "flow", + fun = list(mean = mean, sd = sd) +)$print() + ## S3 method print(rowaggregate( x = x, diff --git a/man/rowbind.DTSg.Rd b/man/rowbind.DTSg.Rd index f510f09..c48285c 100644 --- a/man/rowbind.DTSg.Rd +++ b/man/rowbind.DTSg.Rd @@ -35,6 +35,12 @@ x$rowbind( flow[1501:.N, ] )$print() +## 'rbind()' is a "hidden" R6 alias for 'rowbind()' +x$rbind( + list(flow[1001:1500, ], DTSg$new(values = flow[501:1000, ])), + flow[1501:.N, ] +)$print() + ## S3 method print(rowbind( x = x, diff --git a/man/setColNames.DTSg.Rd b/man/setColNames.DTSg.Rd index d34b1b8..994fa81 100644 --- a/man/setColNames.DTSg.Rd +++ b/man/setColNames.DTSg.Rd @@ -49,6 +49,12 @@ x$setColNames( values = "River Flow" )$print() +## 'setnames()' is a "hidden" R6 alias for 'setColNames()' +x$setnames( + cols = "flow", + values = "River Flow" +)$print() + ## S3 method print(setColNames( x = x, diff --git a/man/setCols.DTSg.Rd b/man/setCols.DTSg.Rd index 8795319..2c84375 100644 --- a/man/setCols.DTSg.Rd +++ b/man/setCols.DTSg.Rd @@ -57,6 +57,13 @@ x$setCols( values = 100 )$print() +## 'set()' is a "hidden" R6 alias for 'setCols()' +x$set( + i = flow > 100, + cols = "flow", + values = 100 +)$print() + ## S3 method print(setCols( x = x,