-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data.table conversion turns the class of <expr> column into <list> column #4040
Comments
This looks like expected behavior. @MichaelChirico just made a PR regarding However, with that in mind, consider the following information: typeof(plan$command)
#> [1] "list"
typeof(plan$command[[1]])
#> [1] "language"
typeof(data.table(plan)[, command])
#> [1] "list"
typeof(data.table(plan)[, command][[1]])
#> [1] "language" So the unchanged object Is |
@JodyStats If d=data.frame(a=1)
d$b = expression(1+2)
d
# a b
#1 1 expression(1 + 2)
str(d)
#'data.frame': 1 obs. of 2 variables:
# $ a: num 1
# $ b: expression(1 + 2)
rbind(d,d)
# a b
#1 1 expression(1 + 2, 1 + 2)
#2 1 <NA>
#Warning message:
#In format.data.frame(if (omit) x[seq_len(n0), , drop = FALSE] else x, :
# corrupt data frame: columns will be truncated or padded with NAs I would suggest to wrap expression in a list if you want to keep it in |
The
drake_plan
returns a tibble to be manipulated. The problem is that one of the variable being "expr" class and when I convert it to data.table the "expr" class turns into "list" class. I do not intend to manipulate this "expr" column and it"s required for downstream processes, its "expr" class must be unchanged after being converted into data.table from tibble. Is this a bug that can be fixed? Otherwise, what is the solution and best practice? Thank you in advance.Created on 2019-11-12 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: