Skip to content

Instantly share code, notes, and snippets.

View roey-angel's full-sized avatar

Roey Angel roey-angel

View GitHub Profile

Keybase proof

I hereby claim:

  • I am roey-angel on github.
  • I am r_angel (https://keybase.io/r_angel) on keybase.
  • I have a public key ASCRa3gDoprPZEH5iqernknVk4YtNRhE61VYWa7Ie12urwo

To claim this, I am signing this object:

@roey-angel
roey-angel / MergeSamples.R
Last active August 6, 2019 11:48
Like phyloseq::merge_samples() but retains chr and fct information in sample_data()
#' Like phyloseq::merge_samples() but retains chr and fct information in sample_data()
#'
#' Merge/agglomerate the sample indices of a phyloseq object according to a categorical variable contained in a sample_data or a provided factor.
#' Unlike merge_samples() this function will only apply a `mean` to numeric variables in `samples_data()` and will retain all unique values of any non-numeric variable.
#' In case of conflicting entries for merged samples, both will be retained and separated by a ",".
#'
#' @author Roey Angel
#' @usage MergeSamples(Ps_obj, grouping_name = "Description")
#' @param ps (Required). A phyloseq object that has sample indices.
#'