combine_groups: Combine values from different groups if specific groups only...

Description Usage Arguments Value See Also Examples

View source: R/combine-groups.R

Description

Combine values from different groups if specific groups only have a low contribution to the overall value.

Usage

1
2
3
4
5
6
combine_groups(
  data,
  group_col,
  groups = names(data)[!is.element(names(data), c("atoutput", "time", group_col))],
  combine_thresh = 15
)

Arguments

data

Dataframe whose groups shall be combined.

group_col

Character string giving the name of the group column in 'data'.

groups

Vector of character strings giving the grouping variables.

combine_thresh

Integer indicating the number of groups to display. Default is 15.

Value

dataframe with groups combined to "Rest" if contribution is low.

See Also

Other combine functions: combine_runs()

Examples

1
2
df <- combine_groups(ref_dm, group_col = "prey")
df <- combine_groups(ref_dm, group_col = "prey", combine_thresh = 2)

alketh/atlantistools documentation built on Oct. 30, 2021, 5:46 a.m.