data.table::transpose
applied to lists changes element types
#5639
Labels
data.table::transpose
applied to lists changes element types
#5639
Applying
data.table::transpose
to a data.table that contains numerical and string values will convert everything to strings. By comparisonpurrr::transpose
preserves the original types by creating a list of lists. Note that it is very easy to convert a list of lists to a list of vectors (that is, get the output ofdata.table::transpose
from the output ofpurrr::transpose
) but very hard the other way.#
Minimal reproducible example
; please be sure to setverbose=TRUE
where possible!This is a very frequent operation, which is currently very hard to do with
data.table
. Seehttps://stackoverflow.com/questions/3492379/data-frame-rows-to-a-list
https://stackoverflow.com/questions/27784076/r-data-table-to-list-of-rows-better-ways
https://stackoverflow.com/questions/41005943/turn-all-data-table-rows-into-a-list-r
https://stackoverflow.com/questions/56901903/convert-a-data-table-to-list-of-rows-that-are-data-tables-and-apply-a-function-t
(and more)
The text was updated successfully, but these errors were encountered: