[datatable-help] Change in list( ) behavior inside join
Eduard Antonyan
eduard.antonyan at gmail.com
Mon Mar 24 20:57:06 CET 2014
You're probably expecting the by-without-by behavior - see this post:
http://r.789695.n4.nabble.com/by-EACHI-and-related-please-check-ok-td4686732.htmland
follow the links within for more detail.
On Mon, Mar 24, 2014 at 2:37 PM, Shir Levkowitz <levkowitz at dc-energy.com>wrote:
> It looks like the latest version of data.table has changed the behavior of
> list( ) inside of a join - is this behavior as expected? Has anyone
> reported or encountered this change? It seems like a bug to me. I am using
> data.table v1.9.2 in R 3.2.0 .
>
> Thanks,
> Shir Levkowitz
>
>
>
>
>
> #-----------------------------------------------
>
>
> library(data.table)
>
> # dates
> dt.dateEx <- data.table(date = as.character(seq(as.Date('2014-04-01'),
> as.Date('2014-04-15'), by = 1)))
> setkey(dt.dateEx, date)
>
> # hours
> dt.hrEx <- copy(dt.dateEx)
> dt.hrEx <- dt.hrEx[, list(hour_beginning =0:23), by = list(dt = date)] #
> rep x24 per date
> setkey(dt.hrEx, dt, hour_beginning)
>
> # as expected
> dt.classEx[dt.dateEx][, list(dt, hour_beginning)]
>
> # not expected outcome
> dt.classEx[dt.dateEx, list(hour_beginning)]
>
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20140324/8f421a97/attachment.html>
More information about the datatable-help
mailing list