match_datasets: Match up samples from two datasets

View source: R/input_output_filter.R

match_datasetsR Documentation

Match up samples from two datasets

Description

Function to match up sample order and optionally, taxa order from two datasets that contain some overlapping sample IDs. Sample IDs that are not present in both datasets will be dropped. The output is a list containing the two filtered datasets in the same order as they were input.

Usage

match_datasets(ds1, ds2, match_taxa = FALSE)

Arguments

ds1

The first dataset as loaded by load_taxa_table.

ds2

The second dataset.

match_taxa

[OPTIONAL] Do you want to match taxa in addition to sample IDs? If TRUE, taxa will be removed if they are not in common between datasets. Default = FALSE

Value

A list variable with the matched ds1 as the first element and ds2 as the second element.

Examples

# This function would normally be run with two different datasets not the
# same one as in this example. For example if you had bacterial and fungal
# data for the same samples and wanted to compare the two.
match_datasets(fruits_veggies, fruits_veggies)

leffj/mctoolsr documentation built on Aug. 5, 2022, 1:27 a.m.