comp_mean | R Documentation |
Calculates the compositional mean of a dataset.
comp_mean( data, comp_labels, rounded_zeroes = TRUE, det_limit = NULL, units = "unitless", specified_units = NULL )
data |
Dataset to calculate compositional mean of. |
comp_labels |
The labels of the compositional parts. |
rounded_zeroes |
Are zeroes rounded zeroes? |
det_limit |
Detection limit if zeroes are to be imputed. This is needed when |
units |
What should the units of the compositional variables be in any output? Currently available are "unitless" (where working in terms of proportions), "hr/day", "hr/wk", "min/day", "min/wk" and "specified", in which case the |
specified_units |
If units are being specified via the composition sum, this is where it is done. It should be a vector where the first argument is a string describing the units, and the second argument is the expected sum of a composition e.g. |
Vector which is the compositional mean.
comp_mean(data = simdata, # this is the dataset comp_labels = c("vigorous", "moderate", "light", "sedentary", "sleep"), # this is the labels # of the compositional columns, which we specified above rounded_zeroes = TRUE, # this option specifies that we'll treat the zeroes # as rounded zeroes i.e. we'll impute them. det_limit = 0.00119, # This is the det_limit for zero imputation units = "hr/day" # this is the units. There are pre-specified options "hr/day", # "hr/wk", "min/day", "min/wk" and "unitless". # If you set units = "specified", you can also specify your own units using # specified = c("my_units_name", sum of a composition in these units) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.