Bug 17219 - str(x,1) prints out extra '... [list output truncated]'
Summary: str(x,1) prints out extra '... [list output truncated]'
Alias: None
Product: R
Classification: Unclassified
Component: Misc (show other bugs)
Version: R 3.3.0
Hardware: All All
: P5 enhancement
Assignee: R-core
Depends on:
Reported: 2017-02-01 21:44 UTC by Neal Fultz
Modified: 2017-02-02 15:18 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Neal Fultz 2017-02-01 21:44:06 UTC
The truncation message should only be shown when str is actually used recursively. Right now, it prints out even when max.level is specified. For example: 

> str(loadTQF,1)
List of 75
 $ /home/nfultz/drive/tqf//DataSet100.xml           :List of 7
 $ /home/nfultz/drive/tqf//DataSet101.xml           :List of 3
 $ /home/nfultz/drive/tqf//DataSet102.xml           :List of 17
 $ /home/nfultz/drive/tqf//DataSet103.xml           :List of 798
  .. [list output truncated]
 $ /home/nfultz/drive/tqf//DataSet104.xml           :List of 3
 $ /home/nfultz/drive/tqf//DataSet105.xml           :List of 3
 $ /home/nfultz/drive/tqf//DataSet106.xml           :List of 17
 $ /home/nfultz/drive/tqf//DataSet107.xml           :List of 52
 $ /home/nfultz/drive/tqf//DataSet108.xml           :List of 334
  .. [list output truncated]
 $ /home/nfultz/drive/tqf//DataSet109.xml           :List of 31

This ought to be fixable by moving the line in str.default:

   if (list.len < le) 
                cat(indent.str, "[list output truncated]\n")

up inside the previous if block.
Comment 1 Martin Maechler 2017-02-02 15:18:39 UTC
Thank you.  Indeed your proposition solves the problem.