Making an R package PDF manual using devtools

大憨熊 提交于 2019-11-28 17:49:49

问题


I am making an R package using devtools and roxygen2. I can get a PDF manual using R CMD but I am really curious as to whether this can be done using devtools. devtools' build(), check(), install() all don't make a PDF manual. Is this tied to making vignettes?

I have read and referred to a similar thread Package development : location of pdf manual and vignette


回答1:


After you install it, you can use:

pack <- "name_of_your_package"
path <- find.package(pack)
system(paste(shQuote(file.path(R.home("bin"), "R")),
    "CMD", "Rd2pdf", shQuote(path)))



回答2:


There is

devtools::build_manual()

Maybe also

devtools::check(manual=TRUE)

could work.




回答3:


For the PDF manual of one specific function, you can run

fun <- "name_of_function"
help(fun, package = "name_of_package", help_type = "pdf")
system(paste0("open ",  fun, ".pdf"))

assuming you have the package installed.



来源:https://stackoverflow.com/questions/30607496/making-an-r-package-pdf-manual-using-devtools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!