means {rosetta} | R Documentation |
Compute means and sums
Description
These functions allow easily computing means and sums. Note that if you
attach rosetta
to the search path,
Usage
means(
...,
data = NULL,
requiredValidValues = 0,
returnIfInvalid = NA,
silent = FALSE
)
sums(
...,
data = NULL,
requiredValidValues = 0,
returnIfInvalid = NA,
silent = FALSE
)
Arguments
... |
The dataframe or vectors for which to compute the means or sums.
When passing a dataframe as unnamed argument (i.e. in the "dots", |
data |
If a dataframe is passed as |
requiredValidValues |
The number (if larger than 1) or proportion (if between 0 and 1) of values that have to be valid (i.e. nonmissing) before the mean or sum is returned. |
returnIfInvalid |
Which value to return for rows not meeting the
criterion specified in |
silent |
Whether to suppress messages. |
Value
The means or sums.
Examples
rosetta::means(mtcars$mpg, mtcars$disp, mtcars$wt);
rosetta::means(data=mtcars, 'mpg', 'disp', 'wt');
rosetta::sums(mtcars$mpg, mtcars$disp, mtcars$wt);
rosetta::sums(data=mtcars, 'mpg', 'disp', 'wt');