knitr::opts_chunk$set( collapse = TRUE, comment = "#>", warning = FALSE, message = TRUE, out.width = "100%" )
Some times if you have more than two batch peak tables, and they are processed at different times, so you need to align them together before other analysis. In masscleaner
, we use the align_batch()
function to do that.
See the massdataset package, and create you metabolomics dataset into 2 mass_dataset objects.
Here we use the demo data from demodata
package, so please install it first.
if(!require(devtools)){ install.packages("devtools") } devtools::install_github("tidymass/demodata")
library(masscleaner) library(demodata) library(tidyverse)
align_batch()
functiondata(object1, package = "demodata") data(object2, package = "demodata") object1 object2 x = object1 y = object2 match_result = align_batch(x = object1, y = object2, return_index = TRUE) head(match_result) new_object = align_batch(x = object1, y = object2, return_index = FALSE) new_object
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.