Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/ID_tbl_length_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ ID_tbl_length_class <- function(
gt_table <- table_rda$table

# Get table length in rows
table_length <- nrow(gt_table)

table_length <- nrow(gt_table[["_data"]])
# determine table length class
if (table_length <= 38) {
length_class <- "regular" # fit on one landscape page (and, by default, portrait)
Expand Down
4 changes: 2 additions & 2 deletions R/ID_tbl_width_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ ID_tbl_width_class <- function(
col_inches <- 1.5

# Calculate total table width in inches
table_width <- ncol(gt_table) * col_inches

table_width <- ncol(gt_table[["_data"]]) * col_inches
Comment thread
sbreitbart-NOAA marked this conversation as resolved.
Resolved
# determine table width class
if (table_width <= portrait_pg_width) {
width_class <- "regular"
Expand Down
4 changes: 2 additions & 2 deletions R/create_tables_doc.R
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ load(file.path(tables_dir, '", stringr::str_remove(tab, "_split"), "'))\n
load(fs::path(tables_dir, "tables", tab))
# identify number of tables that each split table must be further split
# into, with different rows per table
split_table_rows <- length(rda[[1]][[1]])
split_table_rows <- nrow(rda$table[["_data"]])
split_tables_rowwise <- ceiling(split_table_rows / max_rows)

# prepare text for chunk that will display split tables
Expand Down Expand Up @@ -453,7 +453,7 @@ load(file.path(tables_dir, '", stringr::str_remove(tab, "_split"), "'))\n
}
# identify number of tables that each split table must be further split
# into, with different rows per table
split_table_rows <- length(table_list[[1]]$`_data`[[1]])
split_table_rows <- nrow(table_list[[1]][["_data"]])
split_tables_rowwise <- ceiling(split_table_rows / max_rows)

# add a chunk to import split tables
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-ID_tbl_length_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test_that("Table length calculated correctly for regular table", {
gt()

rda <- list(
"table" = test_table[[1]],
"table" = test_table,
"caption" = "test_caption"
)

Expand Down Expand Up @@ -82,7 +82,7 @@ test_that("Table lengths calculated correctly for a long table", {
gt()

rda <- list(
"table" = test_table[[1]],
"table" = test_table,
"caption" = "test_caption"
)

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-ID_tbl_width_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test_that("Table widths calculated correctly for wide table", {
gt()

rda <- list(
"table" = test_table[[1]],
"table" = test_table,
"caption" = "test_caption"
)

Expand Down Expand Up @@ -65,7 +65,7 @@ test_that("Table widths calculated correctly for extra-wide table", {
gt()

rda <- list(
"table" = test_table[[1]],
"table" = test_table,
"caption" = "test_caption"
)

Expand Down
Loading