Skip to content

Commit

Permalink
Small edits
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrerebeau committed Aug 31, 2024
1 parent 65082f5 commit 4874c1d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions R/AllGenerics.R
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ NULL
#' Row Sums
#'
#' Retrieves or defines the row sums (before closure).
#' @param x An object from which to get or set `totals`.
#' @param object An object from which to get or set `totals`.
#' @param value A possible value for the `totals` of `x`.
#' @return
#' * `total() <- value` returns an object of the same sort as `x` with the new
Expand All @@ -216,13 +216,13 @@ NULL
#' @aliases total-method
setGeneric(
name = "total",
def = function(x) standardGeneric("total")
def = function(object) standardGeneric("total")
)

#' @rdname total
setGeneric(
name = "total<-",
def = function(x, value) standardGeneric("total<-")
def = function(object, value) standardGeneric("total<-")
)

#' Working With Groups
Expand Down
12 changes: 6 additions & 6 deletions R/mutators.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ setMethod("weights", "LogRatio", weights.LogRatio)
#' @export
#' @rdname total
#' @aliases total,CompositionMatrix-method
setMethod("total", "CompositionMatrix", function(x) x@totals)
setMethod("total", "CompositionMatrix", function(object) object@totals)

#' @export
#' @rdname total
#' @aliases total,LogRatio-method
setMethod("total", "LogRatio", function(x) x@totals)
setMethod("total", "LogRatio", function(object) object@totals)

#' @export
#' @rdname total
setMethod(
f = "total<-",
signature = "CompositionMatrix",
definition = function(x, value) {
x@totals <- if (is.null(value)) rowSums(x) else as.numeric(value)
methods::validObject(x)
x
definition = function(object, value) {
object@totals <- if (is.null(value)) rowSums(object) else as.numeric(value)
methods::validObject(object)
object
}
)
2 changes: 1 addition & 1 deletion man/pca.Rd

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

12 changes: 6 additions & 6 deletions man/total.Rd

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

0 comments on commit 4874c1d

Please sign in to comment.