You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dt= data.table(a=1:5)
# all is well
boxplot(dt$a)
# lots of errorsdt[, boxplot(a)]
#Error in data.table(stats = c(1, 2, 3, 4, 5), n = 5, conf = c(1.58680503822013, : # Item 4 has no length. Provide at least one item (such as NA, NA_integer_ etc) to be repeated to #match the 5 rows in the longest column. Or, all columns can be 0 length, for insert()ing rows into.#In addition: Warning message:#In data.table(stats = c(1, 2, 3, 4, 5), n = 5, conf = c(1.58680503822013, :# Item 3 is of size 2 but maximum size is 5 (recycled leaving remainder of 1 items)
Related to #482. Iirc it used to plot and output all the stuff you get if you do (boxplot(dt$a)), but now it's not working at all.
The text was updated successfully, but these errors were encountered:
This makes sense to me since the end result of a j expression is coerced to a data.table.
What I find weird is that dt[, hist(a)] from #1471 works without error, even though it's another case of a list that doesn't coerce to data.table nicely. I don't know the internal bit of code that handles this coercion, but it seems to fail in the latter case because as.data.table.histogram is not a thing, while as.data.table.list is (and boxplot just gives a list).
Personally, I would like to see an option to turn off the coercion (with j returned raw or, when by= is present, as a list column, as in dt[, .(.(boxplot(a))), by=rep(1,5)]).
@franknarf1drop=TRUE could be used for that, where drop=FALSE would force to return data.table by adding additional setDT(list(j)) if j is not a data.table. I've proposed it in another issue where I would benefit from drop=FALSE.
Ultimate solution would be to detect visibility of results in j and cascade it down. For now the good alternatives are using DT[,as.null(j)] -> nul or I() function instead of as.null. See related issue #4326.
Related to #482. Iirc it used to plot and output all the stuff you get if you do
(boxplot(dt$a))
, but now it's not working at all.The text was updated successfully, but these errors were encountered: