Skip to content

Commit c619bda

Browse files
committed
fix
1 parent 32699fc commit c619bda

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

R/matrix_form.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ mform_handle_newlines <- function(matform) {
3434
# remove top empty strings (because they are not topleft) and assign topleft to add back
3535
if (any(!nzchar(tl)) && length(tl) > 1) { # needed if ever has_top_left is true but only empties
3636
# values that are "" before topleft information
37-
which_is_fist_nzchar <- which(nzchar(tl))[1] - 1
38-
if (length(which_is_fist_nzchar) == 1 && which_is_fist_nzchar > 1) { # Extra safe
39-
tl <- tl[-seq(which_is_fist_nzchar)]
40-
}
37+
which_is_fist_nzchar <- which(nzchar(tl))[1]
38+
tl <- tl[-(seq(which_is_fist_nzchar) - 1)] # -1 because we take out "" from beginning
4139
}
4240
topleft_has_nl_char <- any(grepl("\n", tl))
4341
tl_to_add_back <- strsplit(paste0(tl, collapse = "\n"), split = "\n", fixed = TRUE)[[1]]

0 commit comments

Comments
 (0)