strengejacke / sjlabelled

Working with Labelled Data in R

Home Page:https://strengejacke.github.io/sjlabelled

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get_term_labels() returns wrong level if lowest factor level is 0

strengejacke opened this issue · comments

library(strengejacke)
data(efc)
efc$e42dep <- recode_to(efc$e42dep)
efc$e42dep <- as.factor(efc$e42dep)
m <- lm(neg_c_7 ~ e42dep + c161sex, data = efc)
get_term_labels(m)
#>           e42dep          c161sex          e42dep1          e42dep2 
#>         "e42dep" "carer's gender"        "e42dep0"        "e42dep1" 
#>          e42dep3          e42dep4 
#>        "e42dep2"        "e42dep3"

Created on 2018-11-01 by the reprex package (v0.2.1)