partial_factor: Partially specify a factor

View source: R/partial-factor.R

partial_factorR Documentation

Partially specify a factor

Description

[Experimental]

This special class can be passed as a ptype in order to specify that the result should be a factor that contains at least the specified levels.

Usage

partial_factor(levels = character())

Arguments

levels

Character vector of labels.

Examples

pf <- partial_factor(levels = c("x", "y"))
pf

vec_ptype_common(factor("v"), factor("w"), .ptype = pf)


vctrs documentation built on Oct. 13, 2023, 1:05 a.m.