merge_groups: Merge groups of elements within a vector by a function

merge_groupsR Documentation

Merge groups of elements within a vector by a function

Description

Internal function used in merge_samples2() to merge variables. Note, owing to the use of split(), the merged elements in the new vector will be reordered according to group.

Usage

merge_groups(x, group, f = unique_or_na)

Arguments

x

A vector whose elements will be merged.

group

A vector such that as.factor(group) defines the grouping.

f

A function that, when applied to a subvector of x, returns a single value. Can also be a formula as interpretted by purrr::as_mapper().


mikemc/speedyseq documentation built on April 22, 2024, 6:40 p.m.