I am trying to avoid showing headers in R\'s STOUT of data.table
output. Akrun says in the related thread the the null route may be possible with print
We can use the unname
unname(DF[time <8])[]
# 1: Acute 0.0 0 A 6 0.000000
# 2: An 7.7 26 B 6 1.283333
# 3: Fo 0.0 0 B 5 0.000000
# 4: Acute 7.5 1 C 6 1.250000
# 5: An 7.9 43 C 6 1.316667
# 6: En 0.0 0 C 6 0.000000
# 7: Fo 5.4 1 C 5 1.080000
# 8: An 7.8 77 D 6 1.300000
# 9: En 0.0 0 D 6 0.000000
#10: Fo 0.0 0 D 5 0.000000
#11: Acute 0.0 0 E 6 0.000000
#12: An 7.9 60 E 6 1.316667
#13: Fo 0.0 0 E 5 0.000000
#14: Fo 7.9 3 F 5 1.580000
One option to avoid the empty line would be
cat(trimws(capture.output(unname(DF[time <8]))[-1]) , sep="\n")
#1: Acute 0.0 0 A 6 0.000000
#2: An 7.7 26 B 6 1.283333
#3: Fo 0.0 0 B 5 0.000000
#4: Acute 7.5 1 C 6 1.250000
#5: An 7.9 43 C 6 1.316667
#6: En 0.0 0 C 6 0.000000
#7: Fo 5.4 1 C 5 1.080000
#8: An 7.8 77 D 6 1.300000
#9: En 0.0 0 D 6 0.000000
#10: Fo 0.0 0 D 5 0.000000
#11: Acute 0.0 0 E 6 0.000000
#12: An 7.9 60 E 6 1.316667
#13: Fo 0.0 0 E 5 0.000000
#14: Fo 7.9 3 F 5 1.580000
For better formatting, the trimws
could be avoided
cat(capture.output(unname(DF[time <8]))[-1] , sep="\n")
# 1: Acute 0.0 0 A 6 0.000000
# 2: An 7.7 26 B 6 1.283333
# 3: Fo 0.0 0 B 5 0.000000
# 4: Acute 7.5 1 C 6 1.250000
# 5: An 7.9 43 C 6 1.316667
# 6: En 0.0 0 C 6 0.000000
# 7: Fo 5.4 1 C 5 1.080000
# 8: An 7.8 77 D 6 1.300000
# 9: En 0.0 0 D 6 0.000000
#10: Fo 0.0 0 D 5 0.000000
#11: Acute 0.0 0 E 6 0.000000
#12: An 7.9 60 E 6 1.316667
#13: Fo 0.0 0 E 5 0.000000
#14: Fo 7.9 3 F 5 1.580000