Skip to content
Prev 5592 / 63421 Next

format() of a character matrix converts to vector (PR#960)

Thanks.  There is an easy fix.  In format.default

    f.char <- function(x, justify) {
	if(length(x) <= 1) return(x)
	nc <- nchar(x)
	w <- max(nc)
	all <- substring(paste(rep(" ", w), collapse=""), 1, w-nc)
	res <- if(justify == "left") paste(x, all, sep="")
	else paste(all, x, sep="")
        dim(res) <- dim(x)
        res
    }
On Thu, 31 May 2001 John.Peters@tip.csiro.au wrote: