1

So I'm R newbie and reading a .dta file into R at some point in the project. But when I attempt to knit the whole report into HTML, its giving me an error message at that particular code line.

P.S. Its working fine when I run the chunk related to it individually. But somehow not knitting the whole report.

library(haven)
whtpjb_18 <- read_dta("finaldatawht2018.dta")
whtpjb_19 <- read_dta("finldatawht_2019.dta")

Error Message: Error in 'levels<-' ('temp*', value = as.character(levels)) : factor level [15] is duplicated Calls: ... lbl_pillar_info -> as_factor -> as_factor.haven_labelled -> factor

0 Answers0