Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses
issue #833
"as.data.table behavior inconsistent with as.data.frame for matrix list members #833"
Modified / Added:
details:
as.data.table.list -- checks if any element has dim, then rest of function splits into two parts (yes/no dim). If an element has dimension, several other tests are performed and eventually returns
do.call(cbind, lapply(x, as.data.table))
Additionally, gave user option to userbind
instead ofcbind
via the argumentbind.using
. This is useful for list of matrices. For mixed lists, a warning is thrown to inform user thatrbind
may coerce data types.as.data.table.matrix -- fixed issue where if
keep.rownames=TRUE
butx
does not have rownames, an error would result. Solution implemented is to usern=NA_character_
. Alternative is to override user and setkeep.rownames=FALSE
as.data.tabel.array -- added this function. Goal was to mimic results of
as.data.frame.array
as closely as possible. One issue remains. Namely, for single-dimension array, as.data.frame preserves dim info. We cannot do that with as.data.table since a column having a dim attribtue will annoyprint(x)
.