Skip to content

Commit 5b45dea

Browse files
author
hornik
committed
Give HTML Tidy results as data frames instead of matrices.
git-svn-id: https://svn.r-project.org/R/trunk@89132 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 4358ff0 commit 5b45dea

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/library/tools/R/htmltools.R

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function(f, tidy = "tidy") {
5252
if (!is.null(concordance))
5353
result <- cbind(result, matchConcordance(p, concordance = concordance))
5454

55-
result
55+
as.data.frame(result)
5656
}
5757

5858
tidy_validate_db <-
@@ -63,7 +63,7 @@ function(x, paths = NULL, ignore = character()) {
6363
e <- x[i]
6464
x <- Filter(length, x[!i])
6565
if(!length(x) && !length(e)) return(NULL)
66-
y <- do.call(rbind, x)
66+
y <- do.call(rbind, c(x, list(make.row.names = FALSE)))
6767
if(is.null(y)) {
6868
y <- list() # cannot set an attr on NULL
6969
} else {
@@ -128,15 +128,12 @@ function(package, dir, lib.loc = NULL, auto = NA, verbose = interactive())
128128
tryCatch(tidy_validate_R_httpd_path(path),
129129
error = identity)
130130
})
131-
## names(results) <- sprintf("%s/%s", p, files)
132-
## results <- Filter(length, results)
133-
## if(!length(results)) return(NULL)
134-
## cbind(file = rep.int(names(results), vapply(results, nrow, 0)),
135-
## do.call(rbind, results))
136131
tidy_validate_db(results, sprintf("%s/%s", p, files))
137132
}
138133

139-
do.call(rbind, lapply(package, one))
134+
do.call(rbind,
135+
c(lapply(package, one),
136+
list(make.row.names = FALSE)))
140137
}
141138

142139
tidy_validate_package_Rd_files_from_dir <- function(dir, auto = NA, verbose) {
@@ -178,7 +175,9 @@ tidy_validate_package_Rd_files_from_dir <- function(dir, auto = NA, verbose) {
178175
sprintf("%s::%s", basename(d), names(db)))
179176
}
180177

181-
do.call(rbind, lapply(dir, one))
178+
do.call(rbind,
179+
c(lapply(dir, one),
180+
list(make.row.names = FALSE)))
182181
}
183182

184183

0 commit comments

Comments
 (0)