Open nuest opened 9 years ago
we can reuse this snippet:
listExamples <- function(package, blacklist = NULL) {
dir <- paste(find.package(package), 'examples', sep='/')
dirs <- list.dirs(dir, recursive=FALSE)
if (!is.null(blacklist)) {
dirs <- Reduce(intersect, lapply(blacklist, function(x)
dirs[!grepl(x, dirs, fixed=TRUE)]), dirs)
}
examples <- substr(dirs, nchar(dir) + 2, nchar(dirs))
htmltools::tag('ul', lapply(examples, function(x)
htmltools::tag('li', tagList(htmltools::a(href = paste(package, x, sep="/"), htmltools::code(x))))))
}
listExamples("sensorweby", blacklist = "iframe")
To replicate: