Closed
Description
I suspect it's a rare case, but because glimpse
doesn't quote factors like it does strings, if the factor level has a comma in it, it looks like they're two observations, e.g.
library(tibble)
glimpse(
tibble(x = factor(c('foo, bar', 'baz')),
y = factor(c('hello, world', 'howdy'), ordered = TRUE),
z = c('foo, bar', 'baz'))
)
#> Observations: 2
#> Variables: 3
#> $ x <fct> foo, bar, baz
#> $ y <ord> hello, world, howdy
#> $ z <chr> "foo, bar", "baz"
The evident solution would be to quote levels. Factors would be less differentiable from strings, though no worse than integers that happen to be stored as doubles, e.g. mtcars$gear
.
Metadata
Metadata
Assignees
Labels
No labels