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
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
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
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-
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
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
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
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"
[
8 matches
Mail list logo