collapse_others: Summarise Haplotype Metadata Down to One Row

View source: R/collapse_others.R

collapse_othersR Documentation

Summarise Haplotype Metadata Down to One Row

Description

collapse_others() returns a tbl_df summarising all unique haplotype frequencies, duplicates and selected metadata into a single row.

Usage

collapse_others(data, hap_tbl, labels, cols)

Arguments

data

An object of class tbl_df containing sequence metadata.

hap_tbl

Output from haplotype_tbl.

labels

Column name which contains sequence names.

cols

A character vector of variables to collapse.

Details

collapse_others() is a helper function to summarise metadata along with haplotype_tbl. For any given cols, collapse_others() flattens its content by unique haplotypes and its duplicates in hap_tbl.

Value

an object of class tbl_df.

Author(s)

Pedro S. Bittencourt, Rupert A. Collins.

Examples

# summarise haplotypes
hap_tbl <- haplotype_tbl(geophagus)

# summarise country
others_df <- collapse_others(geophagus_info, hap_tbl, "gbAccession", "country")


delimtools documentation built on April 3, 2025, 9:28 p.m.