[datatable-help] Bug in as.data.table.xts?

Michael Smith my.r.help at gmail.com
Mon Jan 4 00:53:10 CET 2016



On 01/03/2016 10:11 PM, Jan Gorecki wrote:
> Michael Smith <my.r.help <at> gmail.com> writes:
>
>>
>> Potential bug in as.data.table.xts when converting a single-row xts
>> object. Using the dev version from GitHub.
>>
>> library(xts)
>> library(data.table)
>> x <- as.xts(8, order.by = Sys.Date())
>>
>> ## Single-row conversion doesn't work.
>> as.data.table(x)
>
> Thanks for bug report. Just pushed fix. You can find it here:
> https://github.com/Rdatatable/data.table/pull/1485
> You can test it by installing "jangorecki/data.table at as.dt.xts.1rowfix"




Many thanks for the quick fix. Appreciate it a lot.

I've noticed two lines above your fix in R/xts.R there's another case of

as.data.frame(x, row.names=FALSE)

Should it also be changed to row.names=NULL?

M


More information about the datatable-help mailing list