-
Notifications
You must be signed in to change notification settings - Fork 997
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.data.table
warns when options(datatable.show.indices=TRUE)
and an index exists
#6806
Comments
@aitap I am excited to get involved and help with this bug issue. Could you assign it to me? I am looking forward to contributing and collaborating with the team. Thank you!" |
@PradeepFSTdhane123 You are absolutely welcome to try your hand at preventing the warning. Good luck! Start by reproducing the warning with |
print.data.table
may warn when key and index are both presentprint.data.table
may warn when an index is present
Hi , i was checking out this issue , i am not able to reproduce it .
can you please explain. |
It looks like you also need options(datatable.show.indices=TRUE). So
the full reproducer is either library(data.table); options(warn = 2,
error = recover); example(print.data.table) or do the same thing
manually:
library(data.table)
DT <- data.table(x = 10:1, y = 1:10) # <-- also needs multiple columns?
setindex(DT, x)
options(
datatable.show.indices = TRUE,
warn = 2, error = recover
)
DT
Works for me on both the CRAN version and the latest Git revision.
|
print.data.table
may warn when an index is presentprint.data.table
warns when options(datatable.show.indices=TRUE) and an index exists
print.data.table
warns when options(datatable.show.indices=TRUE) and an index existsprint.data.table
warns when options(datatable.show.indices=TRUE)
and an index exists
Hi @aitap , I’ve been investigating the issue related to index printing in data.table, where setting an index causes a warning due to mismatched dimensions when printing. My Approach: I’d love to get your thoughts on this approach. If you think it’s viable, I can refine it further and submit a PR. Let me know if you have any feedback or suggestions! Thanks, |
This is a viable approach. You can also save the column classes from |
Hi @aitap , I have been working on improving the I shifted to a new approach, where I created a header string and added the index information to it. Below is the code snippet that I removed from
And here is the updated code that I wrote to replace the above:
This new implementation successfully resolves the error related to I am unsure what is causing these specific test failures. Could you kindly take a look and provide any insights or suggestions on what might be causing this issue? Thank you for your time and guidance, |
Let's continue with a pull request.
|
Observed while reading the
source("data.table-Ex")
output for translation purposes; taken fromexample(print.data.table)
:The warning most likely originates here:
data.table/R/print.data.table.R
Line 106 in b7f2106
May be a good exercise in finding the emergency exit from R Inferno. If not, will debug myself soon.
The text was updated successfully, but these errors were encountered: