-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
non-atomic columne.g. list columns, S4 vector columnse.g. list columns, S4 vector columns
Description
library(data.table)
library(dplyr)
#>
#> Attaching package: "dplyr"
#> The following objects are masked from "package:data.table":
#>
#> between, first, last
#> The following objects are masked from "package:stats":
#>
#> filter, lag
#> The following objects are masked from "package:base":
#>
#> intersect, setdiff, setequal, union
library(tibble)
library(drake)
plan <- drake::drake_plan(
expr = dat[, col := val]
)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.
# command column class of <expr>
plan
#> # A tibble: 1 x 2
#> target command
#> <chr> <expr>
#> 1 expr dat[, `:=`(col, val)]
# command column class of <expr>
plan %>% mutate(col = "val")
#> # A tibble: 1 x 3
#> target command col
#> <chr> <expr> <chr>
#> 1 expr dat[, `:=`(col, val)] val
# command column class of <list>
plan <- data.table(plan)[, col := "val"]
plan
#> target command col
#> <char> <list> <char>
#> 1: expr <call> val
# command column class of <list>
as_tibble(plan)
#> # A tibble: 1 x 3
#> target command col
#> <chr> <list> <chr>
#> 1 expr <language> valCreated on 2019-11-12 by the reprex package (v0.3.0)
Metadata
Metadata
Assignees
Labels
non-atomic columne.g. list columns, S4 vector columnse.g. list columns, S4 vector columns