When class=TRUE is provided to print.data.table(), only topn - 1 rows are printed. Is this a bug, or a feature? If the former is the case, as I suppose, the flaw seems to be in the line 87 of print.data.table.R.
Minimal example:
library(data.table)
print(as.data.table(iris), topn=3L, class=TRUE)
# Sepal.Length Sepal.Width Petal.Length Petal.Width Species
# <num> <num> <num> <num> <fctr>
# 1: 5.1 3.5 1.4 0.2 setosa
# 2: 4.9 3.0 1.4 0.2 setosa
# ---
# 148: 6.5 3.0 5.2 2.0 virginica
# 149: 6.2 3.4 5.4 2.3 virginica
# 150: 5.9 3.0 5.1 1.8 virginica
sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.4
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] C/en_US.UTF-8/C/C/C/C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] data.table_1.10.4-3
loaded via a namespace (and not attached):
[1] compiler_3.5.0
Thanks.
When
class=TRUEis provided toprint.data.table(), onlytopn - 1rows are printed. Is this a bug, or a feature? If the former is the case, as I suppose, the flaw seems to be in the line 87 ofprint.data.table.R.Minimal example:
sessionInfo()Thanks.