Martin Maechler
2020-Jan-07 11:58 UTC
[Rd] Another wish (?) for R 4.0.0: print(*, width = <n>)
One of the things I often wish R would work with: When calling print() explicitly --- as I do not so rarely, e.g., specifying digits = <nd> --- it sometimes seems awkward that from the printing options() , one can specify 'digits' and it has default digits = NULL which is documented to be equivalent to digits = getOption("digits"), but one cannot specify 'width' ... well "even worse": one *can* specify 'width = .' but it is silently ignored - as well documented on ?print.default Before considering to add this for R 4.0.0, doing the work myself, I'd quickly wanted to hear opinions / caveats / .. about this. wishing you all a Happy New Year, Martin Martin Maechler ETH Zurich and R Core Team
brodie gaslam
2020-Jan-07 14:13 UTC
[Rd] Another wish (?) for R 4.0.0: print(*, width = <n>)
For whatever my 2c are worth I think this would be nice.? I'm still uncomfortable at having to call `options` in my package `diffobj` to set output width. And since the topic is here, what about `show`?? Feels like it should accept `...` so that it too could be given some set of standard or non standard parameters, including `width`. Happy new decade. B. On Tuesday, January 7, 2020, 6:58:32 AM EST, Martin Maechler <maechler at stat.math.ethz.ch> wrote: One of the things I often wish R would work with: When calling print() explicitly --- as I do not so rarely, e.g., specifying? digits = <nd> --- it sometimes seems awkward that from the printing options() , one can specify 'digits' and it has default? digits = NULL which is documented to be equivalent to? digits = getOption("digits"), but one cannot specify 'width' ... well "even worse": one *can* specify 'width = .' but it is silently ignored - as well documented? on? ?print.default Before considering to add this for R 4.0.0, doing the work myself, I'd quickly wanted to hear opinions / caveats / .. about this. wishing you all a? Happy New Year, Martin Martin Maechler ETH Zurich and R Core Team ______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel [[alternative HTML version deleted]]
Henrik Bengtsson
2020-Jan-07 21:31 UTC
[Rd] Another wish (?) for R 4.0.0: print(*, width = <n>)
On Tue, Jan 7, 2020 at 6:14 AM brodie gaslam via R-devel <r-devel at r-project.org> wrote:> > For whatever my 2c are worth I think this would be nice. I'm still uncomfortable at having to call `options` in my package `diffobj` to set output width.Adding a few more cents: It might be worth considering "who" should be allow to control the 'width' argument. In an interactive session, it's neat for the user to quickly be able to adjust 'width'. But in what cases should this be controlled by a (package) developer? What assumptions can the developer safely make about the 'width' of the end user? I don't know the answer to this and I'm sure one can find valid cases where it makes sense to set the 'width' in a package - maybe like width = 0.90 * getOption("width", 80)? Could it be that print() ignoring 'width' has protected us from packages producing output with a fixed, hardcoded width that is set by the developer? If print() us updated to acknowledge 'width', will we start seeing print(..., width = 120) and so on in package code? Is this good or bad? This might be a complementary problem to what we have with 'stringsAsFactors' where the user's settings can override the intention of the developer. /Henrik> > And since the topic is here, what about `show`? Feels like it should accept `...` so that it too could be given some set of standard or non standard parameters, including `width`. > Happy new decade. > B. > > On Tuesday, January 7, 2020, 6:58:32 AM EST, Martin Maechler <maechler at stat.math.ethz.ch> wrote: > > One of the things I often wish R would work with: > > When calling print() explicitly --- as I do not so rarely, e.g., > specifying digits = <nd> --- > it sometimes seems awkward that from the printing options() , > one can specify 'digits' and it has default digits = NULL which is > documented to be equivalent to digits = getOption("digits"), > but one cannot specify 'width' > ... well "even worse": one *can* specify 'width = .' but it is > silently ignored - as well documented on ?print.default > > Before considering to add this for R 4.0.0, doing the work > myself, I'd quickly wanted to hear opinions / caveats / .. about this. > > wishing you all a Happy New Year, > Martin > > Martin Maechler > ETH Zurich and R Core Team > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Pages, Herve
2020-Jan-08 01:04 UTC
[Rd] Another wish (?) for R 4.0.0: print(*, width = <n>)
On 1/7/20 06:13, brodie gaslam via R-devel wrote: ...> Happy new decade.*** caught segfault *** conflicting decade boundaries Traceback: 1: new_decade <- 2020:2029 2: previous_decade <- 2011:2020 3: previous_previous_decade <- 2001:2010 4: current_millenium <- 2001:3000 5: previous_millenium <- 1001:2000 6: previous_previous_millenium <- 1:1000 Cheers, H. -- Herv? Pag?s Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpages at fredhutch.org Phone: (206) 667-5791 Fax: (206) 667-1319
Apparently Analagous Threads
- Another wish (?) for R 4.0.0: print(*, width = <n>)
- Another wish (?) for R 4.0.0: print(*, width = <n>)
- Another wish (?) for R 4.0.0: print(*, width = <n>)
- setClass accepts slot-mismatch between slots and prototype arguments
- Newbie wants to compare 2 huge RDSs row by row.