| convert_from_wide | R Documentation |
Feature tables are usually stored in a "wide" data format where sample names are stored in columns and features are stored in rows.
This functions transforms those feature tables into a "long" and tidy data format to use it with functions provided in the metamorphr package.
convert_from_wide works with tibbles and data frames. To convert a matrix, see convert_from_matrix.
convert_from_wide(data, label_col = 1, metadata_cols = NULL)
data |
A feature table data frame or tibble in wide format. To convert a matrix, see |
label_col |
The index or name of the column that will be used to label Features. For example an identifier (e.g., KEGG, CAS, HMDB) or a m/z-RT pair. |
metadata_cols |
The index/indices or name(s) of column(s) that hold additional feature metadata (e.g., retention times, additional identifiers or m/z values). |
A tidy tibble.
featuretable_path <- system.file("extdata", "toy_metaboscape.csv", package = "metamorphr")
featuretable_wide <- read.csv(featuretable_path)
convert_from_wide(featuretable_wide, metadata_cols = 2:5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.