Skip to content

build_datalist() with specified at breaks factor's levels #39

@tzoltak

Description

@tzoltak
  • [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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions