roxygen2

Use roxygen2 to document multiple datasets in a single documentation object

ぃ、小莉子 提交于 2021-02-17 03:00:55
问题 I'm looking for an equivalent of @describeIn that will allow me to create a single documentation object for multiple R data objects. I had hoped that something like this: #' Tree Distances #' #' These datasets contain the distances between sets #' of 10-tip, 11-tip and 12-tip trees. #' #' @name treeDistances #' @keywords datasets "treeDistances10" "treeDistances11" "treeDistances12" would produce a single manual page that would apply to all three treeDistances## objects, similar to describing

Can I generate comments using roxygen2 without building an R package? [duplicate]

混江龙づ霸主 提交于 2021-02-08 08:26:24
问题 This question already has answers here : Possible to create Rd help files for objects not in a package? (6 answers) Closed 5 years ago . I need to generate documentation for a collection of R programs. Unfortunately, building a package based on the source code is not an option (I know how to do that, and I have already experimented with RStudio, roxygen2, and packages, and it works like a charm). Can I use roxygen2 to to generate documentation from the R source code without building a package

Can I generate comments using roxygen2 without building an R package? [duplicate]

大兔子大兔子 提交于 2021-02-08 08:26:20
问题 This question already has answers here : Possible to create Rd help files for objects not in a package? (6 answers) Closed 5 years ago . I need to generate documentation for a collection of R programs. Unfortunately, building a package based on the source code is not an option (I know how to do that, and I have already experimented with RStudio, roxygen2, and packages, and it works like a charm). Can I use roxygen2 to to generate documentation from the R source code without building a package

Error creating R package: Error in dyn.load(file, DLLpath = DLLpath, …)

夙愿已清 提交于 2021-01-28 08:31:13
问题 I am creating an R package called CVOC. It includes C++ code and uses high precision arithmetic from the C library gmp. The package is to be created by the following steps: 1) using Rcpp::Rcpp.package.skeleton to create the package skeleton. 2) copying the required files, such as DESCRIPTION, NAMESPACE, Makevars, etc. , into the correct folders 3) creating the .Rd documentation files using roxygen2::roxygenise() 4) checking the R-package using R CMD check 5) building the R-package using R CMD

Exporting and importing S3 method between packages

一曲冷凌霜 提交于 2021-01-27 05:04:22
问题 Disclaimer: I found the solution to this problem when writing this question. But my question now is "How does it work?" I am trying to export S3 method from one package (say pkg.from ) and import it into another package (say pkg.to ). To export the method I use roxygen2 comments. #' @export myclass <- function() { structure(NULL, class = 'myclass') } #' @export print.myclass <- function(x, ...) { print('NULL with class myclass') } File NAMESPACE now contains both the constructor and method.

Exporting and importing S3 method between packages

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-27 05:04:13
问题 Disclaimer: I found the solution to this problem when writing this question. But my question now is "How does it work?" I am trying to export S3 method from one package (say pkg.from ) and import it into another package (say pkg.to ). To export the method I use roxygen2 comments. #' @export myclass <- function() { structure(NULL, class = 'myclass') } #' @export print.myclass <- function(x, ...) { print('NULL with class myclass') } File NAMESPACE now contains both the constructor and method.

roxygen2: Issue with exporting print method

独自空忆成欢 提交于 2020-12-01 10:48:46
问题 I have updated to roxygen2 v4.0.0 and am now attempting to convert @S3method and @method commands to @export commands following the directions here. This seems to have worked well for all of my methods except for those related to print. Here is a toy example that illustrates my problem (I understand the silliness of the example). Here is the .R file ... #' Test. #' #' Test. #'@aliases zzzTest print.zzzTest summary.zzzTest #'@param v A numeric vector. #'@param x A \code{zzzTest} object. #'

R package fails devtools::check, because “could not find function” even though the function is imported in NAMESPACE

生来就可爱ヽ(ⅴ<●) 提交于 2020-07-21 05:25:47
问题 Trying to build my first R package using roxygen2 and devtools . I have added a function that uses %>% and mutate in the @examples section. When I run check() it fails, because it cannot find the function %>% or mutate . Based on this, this, and this I have tried the following: I have #' importFrom magrittr %>% and #' importFrom dplyr mutate in the function's .R file. I also have magrittr and dplyr under Imports: in the DESCRIPTION file. After running document() , my NAMESPACE file contains