5268_as_xts_support_non_numerics#5276
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5276 +/- ##
=======================================
Coverage 99.50% 99.50%
=======================================
Files 77 77
Lines 14631 14645 +14
=======================================
+ Hits 14559 14573 +14
Misses 72 72
Continue to review full report at Codecov.
|
| if (!all(colsNumeric)) warningf("Following columns are not numeric and will be omitted: %s", brackify(names(colsNumeric)[!colsNumeric])) | ||
| r = setDF(x[, .SD, .SDcols = names(colsNumeric)[colsNumeric]]) | ||
| return(xts::as.xts(r, order.by = if ("IDate" %chin% class(x[[1L]])) as.Date(x[[1L]]) else x[[1L]])) | ||
| r <- x[, -1L]# exclude first col, xts index |
There was a problem hiding this comment.
sorry for the late review. would it be better to shallow()-copy x and then delete the first column?
|
|
||
| 51. `merge.data.table()` silently ignored the `incomparables` argument, [#2587](https://github.com/Rdatatable/data.table/issues/2587). It is now implemented and any other ignored arguments (e.g. misspellings) are now warned about. Thanks to @GBsuperman for the report and @ben-schwen for the fix. | ||
|
|
||
| 52. `as.xts.data.table` now supports non-numeric xts coredata matrixes, [5268](https://github.com/Rdatatable/data.table/issues/5268). Existing numeric only functionality is supported by a new `numeric.only` parameter, which defaults to `TRUE` for backward compatability and the most common use case. To convert non-numeric columns, set this parameter to `FALSE`. Conversions of `data.table` columns to a `matrix` now uses `data.table::as.matrix`, with all its performance benefits. Thanks to @ethanbsmith for the report and fix. |
There was a problem hiding this comment.
Do we plan to support this numeric.only option indefinitely? If not, we should state the migration plan up front.
|
it is an extremely common use case. the numeric filter was in place for years and no one ever mentioned it as a problem. i only ran into the issue when i needed to use a boolean matrix
|
allow bypass of numeric only columns
use
as.matrixfor fast conversionfixes #5268 (replaces pr: #5270)