h_factor_ref {mmrm}R Documentation

Convert Character to Factor Following Reference

Description

Convert Character to Factor Following Reference

Usage

h_factor_ref(x, ref, var_name = vname(x))

Arguments

x

(character or factor)
input.

ref

(factor)
reference.

var_name

(string)
variable name of input x.

Details

Use ref to convert x into factor with the same levels. This is needed even if x and ref are both character because in model.matrix if x only has one level there could be errors.


[Package mmrm version 0.3.11 Index]