valuesof: Convert character vector to scalar

Description Usage Arguments Value Author(s) Examples

View source: R/transform.R

Description

Convenience function to summarize a character vector (or argument that can be coerced), by converting to a character scalar containing the unique values present.

Usage

1
valuesof(x, sep = ",", na.convert = NA)

Arguments

x

a character vector of allele frequencies

sep

character used to separate values of x in the return value

na.convert

character used to represent NA values in x. After conversion, NA values are removed

Value

A character vector of length 1.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

1
2
3
4
5
  valuesof(c(1:5, NA))
  valuesof(c(1:5, NA), na.convert = "NA")
  valuesof(factor(c("Drug A", "Drug A", "Drug A")), sep = "/")
  valuesof(factor(c("Drug A", "Drug B", "Drug A", "Placebo")), sep = "/")
  valuesof(matrix(rbinom(100, 2, 0.5), ncol = 10))

tobyjohnson/gtx documentation built on Aug. 30, 2019, 8:07 p.m.