Skip to contents

Requires tidyr and tibble; errors with an install hint if either is missing.

Usage

get_tidy(daf, axis, columns = NULL, cache = TRUE, ...)

Arguments

daf

A DafReader.

axis

Axis name.

columns

Optional character vector of vector names to include. Defaults to all vectors on axis.

cache

Logical; if TRUE (default), the result is memoised in the query cache and served on repeat calls.

...

Passed to tidyr::pivot_longer().

Value

A tibble with columns name, key, value.

Examples

if (requireNamespace("tidyr", quietly = TRUE) &&
    requireNamespace("tibble", quietly = TRUE)) {
    d <- memory_daf()
    add_axis(d, "cell", c("c1", "c2"))
    set_vector(d, "cell", "donor", c("A", "B"))
    get_tidy(d, "cell")
}
#> # A tibble: 2 × 3
#>   name  key   value
#>   <chr> <chr> <chr>
#> 1 c1    donor A    
#> 2 c2    donor B