roxygen2

Making an R package PDF manual using devtools

早过忘川 提交于 2019-11-29 21:37:02
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 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))) There is devtools::build_manual() Maybe also devtools:

Multiple functions in one .Rd file

人走茶凉 提交于 2019-11-29 20:35:12
Short version : Can I emulate the documentation of Normal in package stats using roxygen ? Long version : I'm working on a package and was trying make the documentation more readable by having a number of functions with common inputs/parameters collected under one heading, which will be a generic reference to the group. Each function should still be available to the end user independently. I took as inspiration the documentation for Normal which gives a number of methods related to the normal distribution e.g. stats::dnorm() . When I search ?dnorm I find the name of the help section is Normal

Error when building R package using roxygen2

不羁岁月 提交于 2019-11-29 18:40:03
问题 I have 2 files, Rfile.R and Cppfile.cpp. Contents in Cppfile.cpp: #include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] int CPPF(int k){return ++k;} Contents in Rfile.R: RF<-function(k){return(CPPF(k))} I want to build an R package based on the 2 files. I use the lastest versions of Rstudio and Roxygen2. I tried 3 ways to build the package with or without Roxygen2, and had different results: New Project->New Directory->R package->Type:Package w/Rcpp, add both Rfile.R and Cppfile.cpp as

How to extend S3 method from another package without loading the package

…衆ロ難τιáo~ 提交于 2019-11-29 17:02:49
问题 I am developing a package which has the function forecast.myclass . I want that function to work nicely with forecast package. I.e. when forecast package is loaded the code forecast(object) should call forecast.myclass from my package. Since I need only generic definition of forecast from the package forecast , and I do not use any other function from the package forecast I am reluctant to include it in the Depends. So I define the generic in my package in the following way: ##' ##' @export

Rd file name conflict when extending a S4 method of some other package

久未见 提交于 2019-11-29 16:33:55
问题 Actual question How do I avoid Rd file name conflicts when a S4 generic and its method(s) are not necessarily all defined in the same package (package containing (some of) the custom method(s) depends on the package containing the generic) and using roxygenize() from package roxygen2 to generate the actual Rd files? I'm not sure if this is a roxygen2 problem or a common problem when the generic and its method(s) are scattered across packages (which IMHO in general definitely is a realistic

roxygen2 not fully updating DESCRIPTION file

这一生的挚爱 提交于 2019-11-29 13:07:47
I'm making my first package rlandscape , using Roxygen2 and trying to follow the plain Roxygen vignette since Roxygen2 doesn't have one. As in the vignette (page 3), I created a file called rlandscape-package.R that contains nothing but package documentation. In the vignette, they say each Roxygen description block must be followed by a statement, even header material that describes a le or package in lieu of a specific function. roxygen() is provided as a NOOP (null statement) to stand in for such cases. but if I follow the description block with roxygen() a call to package.skeleton produces

Keyboard shortcut for inserting roxygen #' comment start

一曲冷凌霜 提交于 2019-11-29 01:26:40
This question might be over-answered but I could not find one. Basically I am using RStudio and the keyboard shortcut cmd + shift + c for inserting comments. Is there an other combination to insert directly the roxygen tags #' ? Or a way to modify RStudio to tell it to add the ' when I press cmd + shift + c ? You could use an RStudio addin , you'll need a fairly recent version of RStudio. I've just created an RStudio addin that comments/uncomments using roxygen2 tags, i.e. works just like code commenting, but with #' . The addin is hosted on github . Just install and attach a convenient

Using Roxygen2 Template tags

耗尽温柔 提交于 2019-11-28 18:45:32
Could someone provide an example of how to properly use the Template Tags in Roxygen2 . I have tried to do the most obvious thing (to me): In my packageName-package.R file: #' [... other Roxygen blocks ...] #' #' @templateVar testTemplateTag Testing one two NULL Then in a file someFunction.R #' [... other Roxygen blocks ...] #' #' @template testTemplateTag I get the error: Error : Can not find template testTemplateTag I am trying to have one place to document commonly repeated definitions examples etc. When these things are nested within a set of functions I have been using @inheritParms . But

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

Error in fetch(key) : lazy-load database

◇◆丶佛笑我妖孽 提交于 2019-11-28 17:23:06
I don't know what is going on, everything was working great but suddenly I started to have this error message on the documentation: Error in fetch(key) : lazy-load database '......descopl.rdb' is corrupt I removed almost all my code and build again then publish to Github, but when I use the other laptop to download the package, the package is being downloaded and loaded but I can't call any of the functions, and the documentation states that error. I don't know what caused the problem, I am using roxygen to generate the documentation. https://github.com/WilliamKinaan/descopl Rodrigo Zepeda It