From ea6d27fda267820b5a89d9b85ab57e9958b324d4 Mon Sep 17 00:00:00 2001 From: Emily de la Rua Date: Tue, 4 Feb 2025 20:46:10 -0500 Subject: [PATCH 1/4] Fix bug --- R/matrix_form.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/matrix_form.R b/R/matrix_form.R index b708c1689..651ea95ec 100644 --- a/R/matrix_form.R +++ b/R/matrix_form.R @@ -94,6 +94,7 @@ mform_handle_newlines <- function(matform) { ), expand_mat_rows(strmat[-1 * hdr_inds, , drop = FALSE], row_nlines[-hdr_inds]) ) + colnames(newstrmat) <- colnames(strmat) newfrmmat <- rbind( expand_mat_rows( From 42d0c44d0056a8e7402ef7393fb8d3b180a02eee Mon Sep 17 00:00:00 2001 From: Emily de la Rua Date: Tue, 4 Feb 2025 20:46:16 -0500 Subject: [PATCH 2/4] Update NEWS --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index cdd9c92f4..853fff991 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,5 @@ ## formatters 0.5.10.9000 +* Fixed a bug in `mform_handle_newlines` that caused string matrix column names to be removed. This prevented paginated listing key column info from being repeated when vertically spanning multiple pages. ## formatters 0.5.10 * Fixed a bug in `mf_update_cinfo` causing an error when `export_as_txt` was applied to empty listings. From f69c2bab4d56603e72677cf184756c7c5195de7e Mon Sep 17 00:00:00 2001 From: Emily de la Rua Date: Tue, 4 Feb 2025 20:46:48 -0500 Subject: [PATCH 3/4] Add project ID - required for R 4.4.2+ --- formatters.Rproj | 1 + 1 file changed, 1 insertion(+) diff --git a/formatters.Rproj b/formatters.Rproj index 270314b87..8d2f37c23 100644 --- a/formatters.Rproj +++ b/formatters.Rproj @@ -1,4 +1,5 @@ Version: 1.0 +ProjectId: 91d83c00-f38c-4245-80dc-783a2cfe8487 RestoreWorkspace: Default SaveWorkspace: Default From 5de4300edcdbd94ae4506ea47e92669a0ef413b1 Mon Sep 17 00:00:00 2001 From: Emily de la Rua Date: Tue, 4 Feb 2025 20:51:57 -0500 Subject: [PATCH 4/4] Fix tests --- tests/testthat/test-pagination.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-pagination.R b/tests/testthat/test-pagination.R index 3ff2b7219..3c15622e4 100644 --- a/tests/testthat/test-pagination.R +++ b/tests/testthat/test-pagination.R @@ -81,7 +81,7 @@ test_that("pagination works", { dfmf2 <- mform_handle_newlines(dfmf2) expect_identical( dfmf2$strings[1:2, 1:2], - matrix(c("", "tleft mats", "m", "pg"), nrow = 2, ncol = 2) + matrix(c("", "tleft mats", "m", "pg"), nrow = 2, ncol = 2, dimnames = list(NULL, c("rnms", "mpg"))) ) ## https://github.com/insightsengineering/formatters/issues/77