aggregate_pers: Aggregate category percentages in groups

Description Usage Arguments

Description

General function to aggregate percentage variables by creating a new variable holding the sum. If a variable with the name for the aggregate already exists, it is overwritten, giving a warning if it is changed, not NA, not zero and not named "peruncod".

Usage

1
2
aggregate_pers(data, groups = v5_v4_aggregation_relations(), na.rm = FALSE,
  keep = FALSE, overwrite = names(groups))

Arguments

data

dataset to use in aggregation

groups

(named) list of variable name vectors to aggregate to a new one (as given in the name); see default value for an example of the format

na.rm

passed on to sum

keep

keep variables that were aggregated in result?

overwrite

Names of the variables that are allowed to be overwritten by aggregate. Defaults to all aggregate variable names. If a variable is overwritten, a message is issued in any case.



Search within the manifestoR package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.