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

still wrapping with trunc.cols=TRUE #4266

Closed
tdhock opened this issue Feb 28, 2020 · 1 comment · Fixed by #4268
Closed

still wrapping with trunc.cols=TRUE #4266

tdhock opened this issue Feb 28, 2020 · 1 comment · Fixed by #4268
Labels
Milestone

Comments

@tdhock
Copy link
Member

tdhock commented Feb 28, 2020

hi all especially @TysonStanley @jangorecki @MichaelChirico who reviewed the related PR #4074

I found a data set which prints incorrectly using the new trunc.cols feature. Here is the minimal code:

options(datatable.print.trunc.cols=TRUE)
DT=data.table::fread(text=("sample,channel,Time,RFU,bases,relative.height,milli.bases,diff.prev,offset,chromStart,chromEnd,count,Sample
mixture,4,2708,-29,90.0787401574803,0.0411348318837306,90078,,39,90039,90118,20,mixture
four.parts,4,5106,-44,289.865470852018,-0.00274517475221701,289865,90,45,289820,289910,11,four.parts"))
DT
do.call(rbind, lapply(1:101, function(i)DT[1]))
do.call(rbind, lapply(1:101, function(i)DT))

Here is the output on my system:

th798@cmp2986 MINGW64 ~/projects/proved-it (master)
$ R --vanilla < ~/R/datatable-print-trunc-cols.R

R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> options(datatable.print.trunc.cols=TRUE)
> DT=data.table::fread(text=("sample,channel,Time,RFU,bases,relative.height,milli.bases,diff.prev,offset,chromStart,chromEnd,count,Sample
+ mixture,4,2708,-29,90.0787401574803,0.0411348318837306,90078,,39,90039,90118,20,mixture
+ four.parts,4,5106,-44,289.865470852018,-0.00274517475221701,289865,90,45,289820,289910,11,four.parts"))
> DT
       sample channel Time RFU     bases relative.height milli.bases diff.prev
1:    mixture       4 2708 -29  90.07874     0.041134832       90078        NA
2: four.parts       4 5106 -44 289.86547    -0.002745175      289865        90
5 variables not shown: [offset, chromStart, chromEnd, count, Sample]
> do.call(rbind, lapply(1:101, function(i)DT[1]))
      sample channel Time RFU    bases relative.height milli.bases diff.prev
  1: mixture       4 2708 -29 90.07874      0.04113483       90078        NA
  2: mixture       4 2708 -29 90.07874      0.04113483       90078        NA
  3: mixture       4 2708 -29 90.07874      0.04113483       90078        NA
  4: mixture       4 2708 -29 90.07874      0.04113483       90078        NA
  5: mixture       4 2708 -29 90.07874      0.04113483       90078        NA
 ---                                                                        
 97: mixture       4 2708 -29 90.07874      0.04113483       90078        NA
 98: mixture       4 2708 -29 90.07874      0.04113483       90078        NA
 99: mixture       4 2708 -29 90.07874      0.04113483       90078        NA
100: mixture       4 2708 -29 90.07874      0.04113483       90078        NA
101: mixture       4 2708 -29 90.07874      0.04113483       90078        NA
5 variables not shown: [offset, chromStart, chromEnd, count, Sample]
> do.call(rbind, lapply(1:101, function(i)DT))
         sample channel Time RFU     bases relative.height milli.bases
  1:    mixture       4 2708 -29  90.07874     0.041134832       90078
  2: four.parts       4 5106 -44 289.86547    -0.002745175      289865
  3:    mixture       4 2708 -29  90.07874     0.041134832       90078
  4: four.parts       4 5106 -44 289.86547    -0.002745175      289865
  5:    mixture       4 2708 -29  90.07874     0.041134832       90078
 ---                                                                  
198: four.parts       4 5106 -44 289.86547    -0.002745175      289865
199:    mixture       4 2708 -29  90.07874     0.041134832       90078
200: four.parts       4 5106 -44 289.86547    -0.002745175      289865
201:    mixture       4 2708 -29  90.07874     0.041134832       90078
202: four.parts       4 5106 -44 289.86547    -0.002745175      289865
     diff.prev
  1:        NA
  2:        90
  3:        NA
  4:        90
  5:        NA
 ---          
198:        90
199:        NA
200:        90
201:        NA
202:        90
5 variables not shown: [offset, chromStart, chromEnd, count, Sample]
> 
�]0;MINGW64:/c/Users/th798/projects/proved-it�
th798@cmp2986 MINGW64 ~/projects/proved-it (master)
$ 

I expected that the print output should always fit on one scree. Here in the last line of code I expected that the diff.prev column should not be shown, but it was shown.

@MichaelChirico
Copy link
Member

I see the issue, filing now, thanks for the report!

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

Successfully merging a pull request may close this issue.

4 participants