Learn R Programming

rimu (version 0.6)

as.vmr: Tidyversatile multiple-response objects

Description

The vmr class wraps the mr class using the vctrs package, for compatibility with tidyverse tbl_df objects (tibbles).

Usage

as.vmr(x, ...)
new_vmr(x, levels = unique(do.call(c, x)))

Value

An object of class vmr

Arguments

x

For as.vmr, an mr object or anything coercible to one. For new_vmr, a list of character vectors

...

not used

levels

the permitted levels for the object

Details

These objects need the vctrs and pillar packages to work, and need the tibble package to be useful.

See Also

as.mr

The internals vignette for internal structure

Examples

Run this code
if (requireNamespace("vctrs", quietly=TRUE)){
   data(nzbirds)
   nzbirds
   tidybirds<-as.vmr(nzbirds, na.rm=TRUE)
   tidybirds
}

Run the code above in your browser using DataLab