Re: [R] Printing left-justified character strings

2018-06-06 Thread zListserv
Duncan Many thanks. I removed the (re-)definitions for print and print.default, and I redefined print.data.frame using 'x' instead of 'df'. Your point about possible issues downstream with row names is well taken. I'll keep a lookout for any untoward side effects. In the meantime, all is wel

Re: [R] Printing left-justified character strings

2018-06-06 Thread Duncan Murdoch
On 06/06/2018 6:28 AM, zListserv wrote: Sorry. Here's how I re-defined print, print.default, and print.data.frame: print = function(df, ..., right=FALSE, row.names=FALSE) base::print(df, ..., right=right, row.names=row.names) base::print doesn't have those arguments. It only has arguments

Re: [R] Printing left-justified character strings

2018-06-06 Thread zListserv
Sorry. Here's how I re-defined print, print.default, and print.data.frame: print = function(df, ..., right=FALSE, row.names=FALSE) base::print(df, ..., right=right, row.names=row.names) print.default = function(df, ..., right=FALSE, row.names=FALSE) base::print.default(df, ..., right=right, ro

Re: [R] Printing left-justified character strings

2018-06-05 Thread Duncan Murdoch
On 05/06/2018 7:49 PM, zListserv wrote: p.s. It seems to work for print command, but not for head, tail, or printing a data frame, per below. Any way fix the others so they all left-justify? You haven't shown us what you did. Duncan Murdoch __ R-

Re: [R] Printing left-justified character strings

2018-06-05 Thread zListserv
p.s. It seems to work for print command, but not for head, tail, or printing a data frame, per below. Any way fix the others so they all left-justify? R> x <- as.data.frame(rep(c("a", "ab", "abc"), 7)) R> print(x) rep(c("a", "ab", "abc"), 7) a ab

Re: [R] Printing left-justified character strings

2018-06-05 Thread zListserv
Duncan et al I tried to redefine print.data.frame the way you suggested, but I misplaced the ellipsis by putting it at the end of the function definition instead of immediately following the name of the data frame. Works now. Thanks! > On 2018-06-05, at 12:39, Duncan Murdoch wrote: > > On

Re: [R] Printing left-justified character strings

2018-06-05 Thread David L Carlson
Anthropology Texas A&M University -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan Murdoch Sent: Tuesday, June 5, 2018 11:40 AM To: zListserv ; r-help@r-project.org Subject: Re: [R] Printing left-justified character strings On 05/06/2018 10:2

Re: [R] Printing left-justified character strings

2018-06-05 Thread Duncan Murdoch
On 05/06/2018 10:24 AM, zListserv wrote: Many (most?) R functions print character strings and factor labels right-justified. Could you be more specific? I see character strings left justified, e.g. x <- rep(c("a", "ab", "abc"), 7) prints as [1] "a" "ab" "abc" "a" "ab" "abc" "a" [