R create reference manual with R CMD check

前端 未结 4 1312
Happy的楠姐
Happy的楠姐 2020-12-02 16:55

I am writing an R package and would like to make a pdf reference manual of all functions in the package. I understood from here that R CMD check automatically c

相关标签:
4条回答
  • 2020-12-02 17:32

    I had the same issue. It seems that when you click Build or Check in Rstudio (when using devtools), by default arguments of '--no-manual' are added to the R CMD options.

    I solved this by manually giving the arguments in the R command prompt:

    library(devtools)
    
    check(cleanup = FALSE,manual = TRUE,path = getwd())
    
    # without running the examples
    check(cleanup = FALSE,args = c('--no-examples'),manual = TRUE,path = getwd())
    

    In this case, a folder called package.Rcheck will contain the manual as package-manual.pdf

    Also check for any errors in the output during the check. There might be characters that might crash the documentation.

    0 讨论(0)
  • 2020-12-02 17:36

    Another way is to create the reference manual directly using:

    R CMD Rd2pdf mypackage
    

    where mypackage is the folder containing your R package code folder structure including the man folder with your .Rd files.

    For some reason I never get the reference manual during build or check in RStudio, maybe because I've missed a setting somewhere. But running the command like this works fine as well.

    0 讨论(0)
  • 2020-12-02 17:38

    Another workaround is to produce it with:

    build_manual(path=getwd())
    #or
    check(manual = TRUE, args="--output=~/folder/subfolder")
    
    0 讨论(0)
  • 2020-12-02 17:54

    R CMD check creates a directory PACKAGE.RCheck. In this directory you could find the file PACKAGE-manual.pdf.

    0 讨论(0)
提交回复
热议问题