sfirke/janitor

three-way tabyl errors when first argument is an ordinal

sfirke opened this issue · 1 comments

For now this is just reprex'd in my private data but tracking the issue here too.

dat %>% tabyl(x, y, z) is failing when x is of class ordinal and doesn't fail if I first convert it to character.

Error message is:

Error in class(dat[[1]]) <- new_class : 
  adding class "factor" to an invalid object
In addition: Warning messages:
1: In if (col1_class %in% "factor") { :
  the condition has length > 1 and only the first element will be used
2: In if (new_class %in% "factor") { :
  the condition has length > 1 and only the first element will be used

duplicate of #386