Actually, my previous post had a small bug in it: it would throw an
error when printing a zero-column data frame. The following code fixes this:
print.data.frame <- function(df) {
if (ncol(df) > 0 && require("IRanges")) {
prev.max.print <- getOption("max.print")
on.exit(options(max.print=prev.max.print))
options(max.print=ncol(df) * 20)
x <- capture.output(print(as(df, "DataFrame")))
cat(str_replace(x[[1]], "DataFrame", "data frame"),
x[-1],
sep="\n")
} else {
base::print.data.frame(df)
}
}
_______________________________________________
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel