Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print(dt, class=TRUE) shows only "topn - 1" rows #2803

Closed
heavywatal opened this issue Apr 28, 2018 · 2 comments
Closed

print(dt, class=TRUE) shows only "topn - 1" rows #2803

heavywatal opened this issue Apr 28, 2018 · 2 comments
Milestone

Comments

@heavywatal
Copy link
Contributor

@heavywatal heavywatal commented Apr 28, 2018

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.

@MichaelChirico
Copy link
Member

@MichaelChirico MichaelChirico commented Apr 28, 2018

That's a bug! Probably my fault. Since you've already identified the problem, feel free to file a PR. If not, I'll fix this soon.

@MichaelChirico MichaelChirico added this to the v1.11.0 milestone Apr 28, 2018
heavywatal added a commit to heavywatal/data.table that referenced this issue Apr 28, 2018
heavywatal added a commit to heavywatal/data.table that referenced this issue Apr 28, 2018
heavywatal added a commit to heavywatal/data.table that referenced this issue Apr 28, 2018
@heavywatal
Copy link
Contributor Author

@heavywatal heavywatal commented Apr 28, 2018

Confirmed. Thank you for your prompt response, @MichaelChirico and @mattdowle !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.