Making an R package PDF manual using devtools
Asked Answered
E

3

31

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

Excisable answered 2/6, 2015 at 22:10 Comment(0)
S
37

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)))
Stranger answered 2/6, 2015 at 22:57 Comment(3)
is it possible to just add a "Introduction" page to the pdf manual generated by R CMD check ?Odom
@Odom please start a new questionStranger
i did so.. here at #41935636Odom
C
26

There is

devtools::build_manual()

Maybe also

devtools::check(manual=TRUE)

could work.

Callimachus answered 23/11, 2018 at 12:3 Comment(1)
devtools::build_manual() works when I run it on Linux, but not if I run it on Windows. +1Priapism
B
0

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.

Borkowski answered 24/7, 2018 at 13:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.