I am trying to build a histogram from the results of the data.table grouping, but it seems I cannot get more than one diagram created before the following error occurred:
Error in [.data.table(DT, hist (V2, breaks = 2), by = V1): maxn (3) is not an exact multiple of this column length j (2)
This toy example should hope to demonstrate the problem.
require( data.table )
DT = data.table(c(1,1,2,2), c(1,2,3,4))
DT[,plot(V2,V2), by = V1]
DT[,hist(V2, breaks = 2), by = V1]
Any ideas on what I'm doing wrong?
source
share