build_datalist() with specified at breaks factor's levels
tzoltak opened this issue · 1 comments
tzoltak commented
- [x ] a suggested code or documentation change, improvement to the code, or feature request
If user specifies some value using at
that regards to a factor variable, this variable in data that is returned by build_datalist()
is always a factor with only one level - this specified with at
irrespective original set of levels of this factor. It will be more reasonable to keep original levels.
dat <- mtcars
dat$cyl <- as.factor(dat$cyl)
levels(dat$cyl)
newDat <- build_datalist(dat, list(cyl = '6'))
levels(newDat[[1]]$cyl)
tzoltak commented
This issue is related to #124 at @leeper /margins.