named_vec_to_df: Convert a named vector returned from vapply to a dataframe

Description Usage Arguments See Also Examples

View source: R/utils.R

Description

When running a vapply function and each element returns a single value, the return value is a named vector. This function can be used to convert that return value into a data.frame. Similar to lol_to_df, but because the output format from vapply is different depending on whether a single value or multiple values are returned, a different function needs to be used.

Usage

1
named_vec_to_df(v, name, rowname = "well")

Arguments

v

Named vector that is a result of a vapply

name

Column name to use for the name of each element

rowname

Column name to use for the values of the rownames

See Also

lol_to_df

Examples

1
2
3
4
vapply(c("a", "b", "c"),
       toupper,
       character(1)) %>%
  named_vec_to_df("capital", "letter")

ddpcr documentation built on July 8, 2020, 6:49 p.m.