kbarton at zbs.bialowieza.pl
2008-Nov-18 00:55 UTC
[Rd] "deparse" with "nlines" argument produces empty elements (PR#13299)
Full_Name: Kamil Barto? Version: 2.8.0 OS: windows xp Submission from: (NULL) (212.33.92.187) According to the "deparse" function documentation "nlines" is the *maximum* number of lines to produce. But, when "nlines" argument is supplied, it produces exactly nlines of result, and the result contains empty elements at the end. Example:> deparse(quote(foo(1,2,3)), width.cutoff = 20, nlines=7)[1] "foo(1, 2, 3)" "" "" "" "" "" "" This behavior affects e.g. output of warnings() where "..." is attached to every call rather than only the truncated ones.> warnings()Warning messages: 1: In plot.window(...) ... : "na.action" is not a graphical parameter
Prof Brian Ripley
2008-Nov-18 15:58 UTC
[Rd] (PR#13299) "deparse" with "nlines" argument produces empty elements
Although it does actually do what it is documented to do, producing the minimum necessary number of lines would be better, and I've altered R-patched to do so. Thank you for the report. Brian Ripley (who was in Bialowieza a couple of months ago). On Tue, 18 Nov 2008, kbarton at zbs.bialowieza.pl wrote:> Full_Name: Kamil Barto? > Version: 2.8.0 > OS: windows xp > Submission from: (NULL) (212.33.92.187) > > > According to the "deparse" function documentation "nlines" is the *maximum* > number of lines to produce. But, when "nlines" argument is supplied, it produces > exactly nlines of result, and the result contains empty elements at the end. > > Example: > >> deparse(quote(foo(1,2,3)), width.cutoff = 20, nlines=7) > [1] "foo(1, 2, 3)" "" "" "" "" > "" "" > > This behavior affects e.g. output of warnings() where "..." is attached to every > call rather than only the truncated ones. > >> warnings() > Warning messages: > 1: In plot.window(...) ... : "na.action" is not a graphical parameter > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Seemingly Similar Threads
- find bayesian information criterion for all variable combinations
- Running "all possible subsets" of a GLM (binomial) model
- newbie (me) needs to model distribution as two overlapping gaussians
- Dataimport with readLines using skip= and nlines= ?
- IBM C/C++ and Fortran compilers to adopt LLVM open source infrastructure