subsetting in data.table

I am trying to subset a data.table ( from the package data.table ) in R (not a data.frame). I have a 4 digit year as a key. I would like to subset by taking a series of years. For example, I want …

data.table bug, causing a segfault in R

The following code segfaults my R 2.15.0, running data.table 1.8.9.

d = data.table(date = c(1,2,3,4,5), value = c(1,2,3,4,5))

# works as expected
d[-5][, mean(value), by = list(I(…

Merge Rows within Data Frame

I have a relational dataset, where I’m looking for dyadic information.

I have 4 columns. Sender, Receiver, Attribute, Edge

I’m looking to take the repeated Sender — Receiver counts and convert them …

Simple sum if expression

These are my sample data:

dt <- data.table(id=c("a","a","a","a","b","b"), monthsinarrears=c(0,1,0,0,1,0), date=c(2013,2014,2015,2016,2014,2015)) The table looks like this: > dt
id …