Skip to content

Commit

Permalink
Use ASCII space (' ') instead of non-breaking space in `as.data.frame…
Browse files Browse the repository at this point in the history
….table1()` (#60)
  • Loading branch information
benjaminrich committed Feb 18, 2022
1 parent ce6e41e commit 272cf88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/table1.R
Original file line number Diff line number Diff line change
Expand Up @@ -1103,10 +1103,10 @@ update_html <- function(x) {
as.data.frame.table1 <- function(x, ...) {
obj <- attr(x, "obj")
with(obj, {
rlh <- if (is.null(rowlabelhead) || rowlabelhead=="") "\U{00A0}" else rowlabelhead
rlh <- if (is.null(rowlabelhead) || rowlabelhead=="") " " else rowlabelhead
z <- lapply(contents, function(y) {
y <- as.data.frame(y, stringsAsFactors=F)
y2 <- data.frame(x=paste0(c("", rep("\U{00A0}\U{00A0}", nrow(y) - 1)), rownames(y)), stringsAsFactors=F)
y2 <- data.frame(x=paste0(c("", rep(" ", nrow(y) - 1)), rownames(y)), stringsAsFactors=F)
y <- cbind(setNames(y2, rlh), y)
y
})
Expand Down

0 comments on commit 272cf88

Please sign in to comment.