powered by
Create Composite Table multinames from a character vector
as_multinames(x)
a named integer vector that can be used as multinames attribute for a Composite_table
a character vector of equal length as the data.frame for which it the multinames should be created.
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