as_multinames {tatoo}R Documentation

Create Composite Table multinames from a character vector

Description

Create Composite Table multinames from a character vector

Usage

as_multinames(x)

Arguments

x

a character vector of equal length as the data.frame for which it the multinames should be created.

Value

a named integer vector that can be used as multinames attribute for a Composite_table

Examples


dat <- data.frame(
  apple = 1,
  banana = 2,
  dog = 1,
  cat = 2,
  parrot = 3
)

multinames(dat) <- as_multinames(
  c('fruit', 'fruit', 'animal', 'animal', 'animal')
)

multinames(dat)


[Package tatoo version 1.1.2 Index]