get_annotation gets row annotations.

get_annotation(population, annotation_prefix = "Metadata_")

Arguments

population

data.frame with annotations (a.k.a. metadata) and observation variables.

annotation_prefix

optional character string specifying prefix for annotation columns (e.g. "Metadata_" (default)).

Value

data.frame with row annotations of the same class as population.

Examples

suppressMessages(suppressWarnings(library(magrittr)))
population <- tibble::tibble(
  Metadata_group = c(
    "control", "control", "control", "control",
    "experiment", "experiment", "experiment", "experiment"
  ),
  Metadata_batch = c("a", "a", "b", "b", "a", "a", "b", "b"),
  AreaShape_Area = c(10, 12, 15, 16, 8, 8, 7, 7)
)
matric::get_annotation(population, annotation_prefix = "Metadata_")
#> # A tibble: 8 × 3
#>      id Metadata_group Metadata_batch
#>   <int> <chr>          <chr>         
#> 1     1 control        a             
#> 2     2 control        a             
#> 3     3 control        b             
#> 4     4 control        b             
#> 5     5 experiment     a             
#> 6     6 experiment     a             
#> 7     7 experiment     b             
#> 8     8 experiment     b