> I find that things line up better in data.frames

That's a good idea, although I was hoping there would be something in
R to do it for me.

I have ended up with:

        fwidth <- max(nchar(x[,1]))
        descs <- strwrap(x[,2], width=width - fwidth - 5, simplify=FALSE)
        
output <- do.call(rbind, mapply(function(name, desc) {
        cbind(c(name, rep("", length=length(desc)-1)), desc)
}, x[,1], descs))
        
        cat(paste(format(output[,1]), output[,2], collapse="\n"), "\n")

Thanks,

Hadley

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to