From 5a829569e344658fe2b8d4f0ec05c1a76148f907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Fri, 5 Jan 2018 18:34:20 +0100 Subject: [PATCH 1/3] extract variable --- R/S3.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/S3.R b/R/S3.R index 24530c6f..4d5379a6 100644 --- a/R/S3.R +++ b/R/S3.R @@ -372,12 +372,14 @@ pander.summary.lm <- function(x, caption = attr(x, 'caption'), covariate.labels, colnames(stats) <- NULL pandoc.table(stats, keep.trailing.zeros = TRUE, ...) } else { - pandoc.table(data.frame( + stats <- data.frame( 'Observations' = length(x$residuals), 'Residual Std. Error' = x$sigma, '$R^2$' = x$r.squared, 'Adjusted $R^2$' = x$adj.r.squared, - check.names = FALSE), keep.trailing.zeros = TRUE, caption = caption, digits = panderOptions('digits')) + check.names = FALSE + ) + pandoc.table(stats, keep.trailing.zeros = TRUE, caption = caption, digits = panderOptions('digits')) } } else { From 5d709eb243fb59aba6b702b1702c1b49b0f9fdb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Fri, 5 Jan 2018 18:35:24 +0100 Subject: [PATCH 2/3] don't include caption in first table --- R/S3.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/S3.R b/R/S3.R index 4d5379a6..670da57a 100644 --- a/R/S3.R +++ b/R/S3.R @@ -358,7 +358,7 @@ pander.summary.lm <- function(x, caption = attr(x, 'caption'), covariate.labels, } if (summary) { - pandoc.table(res, ...) + pandoc.table(res, caption = NULL, ...) if (class(x) == 'summary.glm') { cat('\n(Dispersion parameter for ', x$family$family, ' family taken to be ', format(x$dispersion), ')\n\n') From b01069dfb92280812e73414ffb842d8daf950756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Tue, 9 Jan 2018 10:21:28 +0100 Subject: [PATCH 3/3] restore caption in glm case --- R/S3.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/S3.R b/R/S3.R index 670da57a..5594ec91 100644 --- a/R/S3.R +++ b/R/S3.R @@ -370,7 +370,7 @@ pander.summary.lm <- function(x, caption = attr(x, 'caption'), covariate.labels, 1L, paste, collapse = ' ')) rownames(stats) <- NULL colnames(stats) <- NULL - pandoc.table(stats, keep.trailing.zeros = TRUE, ...) + pandoc.table(stats, keep.trailing.zeros = TRUE, caption = caption, ...) } else { stats <- data.frame( 'Observations' = length(x$residuals),