library(rbiom)
# create a simple matrix ------------------------
mtx <- matrix(
data = floor(runif(24) * 1000),
nrow = 6,
dimnames = list(paste0("OTU", 1:6), paste0("Sample", 1:4)) )
mtx
# and some sample metadata ----------------------
df <- data.frame(
.sample = paste0("Sample", 1:4),
treatment = c("A", "B", "A", "B"),
days = c(12, 3, 7, 8) )
# convert data set to rbiom ---------------------
biom <- as_rbiom(mtx, metadata = df, id = "My BIOM")
biom
Run the code above in your browser using DataLab