Skip to content

Commit

Permalink
Merge pull request #119 from Merck/bug-118
Browse files Browse the repository at this point in the history
bug fix: #118
  • Loading branch information
nanxstats authored Aug 26, 2022
2 parents 5d49141 + 0fb452a commit 98cbcf5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/rtf_nrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ rtf_nline_vector <- function(text, strwidth, size) {
index <- strwidth / size > 1
n_row <- rep(1, length(text))

if (any(index)) {
if (any(na.omit(index))) {
l <- length(text)

if (length(strwidth) < l) {
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test-independent-testing-rtf_nrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ cellsize <- matrix(width, nrow = nrow(tbl), ncol = ncol(tbl), byrow = TRUE) - pa

# rtf_nline_vector example
nline_vector <- rtf_nline_vector(
text = c("title 1", "this is a sentence for title 2"),
text = c("title 1", "this is a sentence for title 2", NA),
strwidth = c(
strwidth("title 1", units = "inches"),
strwidth("this is a sentence for title 2", units = "inches")
Expand Down Expand Up @@ -116,7 +116,6 @@ test_that("test if rtf_nline_vector() return to correct numbers", {
expect_equal(nline_vector[2], 6)
})


test_that("test if rtf_nline_matrix() return to correct numbers", {

# maximum lines for first row
Expand Down

0 comments on commit 98cbcf5

Please sign in to comment.