basically library(pkg) = if (!require(pkg)) stop()

This commit is contained in:
Yihui Xie
2014-03-24 23:49:34 -05:00
parent 338afb4893
commit 35090251ef

View File

@@ -108,8 +108,7 @@ includeText <- function(path) {
#' @rdname include
#' @export
includeMarkdown <- function(path) {
if (!require(markdown))
stop("markdown package is not installed")
library(markdown)
dependsOnFile(path)
html <- markdown::markdownToHTML(path, fragment.only=TRUE)