ITADN
rstudio/DT/Issues

boxAtomicScalarElements errors on vctrs::list_of list

#1180Openzeehio 创建于 2025-11-14
Z
zeehiocommented
I have a data frame with list columns, that have been created via DBI... Those list columns are of type `vctrs::list_of` I can't use that data frame with DT because I get an error when I try to. I've trimmed the issue down to a short function in the DT package. Here is a reprex that reproduces the error: ``` r val1 <- list("a", c("a", "b")) out1 <- DT:::boxAtomicScalarElements(val1) out1 #> [[1]] #> [[1]][[1]] #> [1] "a" #> #> #> [[2]] #> [1] "a" "b" val2 <- vctrs::as_list_of(val1) out2 <- DT:::boxAtomicScalarElements(val2) #> Error in `lapply()`: #> ! Can't convert `X[[i]]` <list> to <character>. ``` <sup>Created on 2025-11-14 with [reprex v2.1.1](https://reprex.tidyverse.org)</sup> <img width="885" height="260" alt="Image" src="https://github.com/user-attachments/assets/967634b3-9603-4b65-b8d7-1823e6c66aaf" />
2 条评论