convert_to_long: Converts wide format ILR transformed data to long format

View source: R/general_utils.R

convert_to_longR Documentation

Converts wide format ILR transformed data to long format

Description

Converts wide format ILR transformed data (see philr) to long format useful in various plotting functions where long format data is required.

Usage

convert_to_long(x, labels)

Arguments

x

PhILR transformed data in wide format (samples by balances) (see philr)

labels

vector (of length nrow(x)) with labels to group samples by

Value

x in long format with columns

  • sample

  • labels

  • coord

  • value

Examples

tr <- named_rtree(5)
x <- t(rmultinom(10,100,c(.1,.6,.2,.3,.2))) + 0.65 # add small pseudocount
colnames(x) <- tr$tip.label

x.philr <- philr(x, tree=tr, part.weights='enorm.x.gm.counts',
   ilr.weights='blw.sqrt', return.all=FALSE)
   convert_to_long(x.philr, rep(c('a','b'), 5))

jsilve24/philr documentation built on April 20, 2023, 12:43 p.m.