Learn R Programming

tatoo (version 1.1.2)

as_multinames: Create Composite Table multinames from a character vector

Description

Create Composite Table multinames from a character vector

Usage

as_multinames(x)

Value

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

Arguments

x

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

Examples

Run this code

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)

Run the code above in your browser using DataLab