Convert sample metadata from a tibble to a dataframe with sample IDs as row names
Source:R/metadata.R
meta_tbl_to_dat.Rd
Convert sample metadata from a tibble to a dataframe with sample IDs as row names
Examples
sample_meta_tbl <- readr::read_tsv(system.file("extdata",
"sample_metadata.tsv.gz",
package = "MOSuite"
))
#> Rows: 4 Columns: 2
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: "\t"
#> chr (2): sample_id, condition
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(sample_meta_tbl)
#> # A tibble: 4 × 2
#> sample_id condition
#> <chr> <chr>
#> 1 KO_S3 knockout
#> 2 KO_S4 knockout
#> 3 WT_S1 wildtype
#> 4 WT_S2 wildtype
meta_tbl_to_dat(sample_meta_tbl)
#> sample_id
#> KO_S3 KO_S3
#> KO_S4 KO_S4
#> WT_S1 WT_S1
#> WT_S2 WT_S2