factorpipe: Factor pipe

%^%R Documentation

Factor pipe

Description

A pipe that allows easy conversion of a vector into a factor with specified levels.

Usage

lhs %^% rhs

Arguments

lhs

a character vector to be converted into a factor vector

rhs

a named list specifying how to rename the levels

Examples

nsqipr:::`%^%`(
c("apple","cherry","pork"),
list(fruit = c("apple", "banana", "cherry"), meat = c("steak", "chicken", "pork"))
)


dylanrussellmd/nsqipr documentation built on Oct. 13, 2023, 11:01 a.m.