From 51f7a09c99874f1aa42b6744118c58a37c877976 Mon Sep 17 00:00:00 2001 From: hadley Date: Sat, 11 Apr 2009 10:30:05 -0500 Subject: [PATCH] Improve error message --- R/ply-list.r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/ply-list.r b/R/ply-list.r index 1938ee90..9b4e4b10 100644 --- a/R/ply-list.r +++ b/R/ply-list.r @@ -44,7 +44,7 @@ llply <- function(.data, .fun = NULL, ..., .progress = "none") { res <- try(.fun(piece, ...)) if (inherits(res, "try-error")) { - piece <- capture.output(print.default(piece)) + piece <- paste(capture.output(print(piece)), collapse = "\n") stop("with piece ", i, ": \n", piece, call. = FALSE) }