roxygen2

Linking to other packages in documentation in roxygen2 in R

自作多情 提交于 2019-12-03 04:43:19
问题 I am wondering it there exists a method to link to function from other package when I'm trying to write a documentation for new package using roxygen2 . Something like \link{pck=PACKAGE_NAME, fun=FUNCTION_NAME} ? 回答1: You have to type \link[pkg]{function} e.g. \link[stringi]{stri_c} 回答2: In addition to the answer by potockan: Some packages document several functions in a single help page. For example, the trim function from Bioconductor package GenomicRanges is documented in intra-range

Is it possible to use R package data in testthat tests or run_examples()?

大兔子大兔子 提交于 2019-12-03 02:18:24
问题 I'm working on developing an R package, using devtools, testthat, and roxygen2. I have a couple of data sets in the data folder (foo.txt and bar.csv). My file structure looks like this: / mypackage / data * foo.txt, bar.csv / inst / tests * run-all.R, test_1.R / man / R I'm pretty sure 'foo' and 'bar' are documented correctly: #' Foo data #' #' Sample foo data #' #' @name foo #' @docType data NULL #' Bar data #' #' Sample bar data #' #' @name bar #' @docType data NULL I would like to use the

R CMD check warning: Functions/methods with usage in documentation object … but not in code

半腔热情 提交于 2019-12-03 01:42:17
I am writing a package but one persistent R CMD check warning prevents me from finishing the package and posting it to CRAN. I use roxygen2 for inline documentation, although that possibly isn't the root cause of the error. If you know what to do to remove this warning, I can quite possibly figure out a way of doing it using roxygen2 . How can I remove the warning Functions/methods with usage in documentation object ... but not in code from my package checks? The R CMD check warning: * checking for code/documentation mismatches ... WARNING Functions/methods with usage in documentation object

Make third party library available in my R package [duplicate]

纵饮孤独 提交于 2019-12-02 19:32:45
问题 This question already has answers here : Regular expression to match a line that doesn't contain a word (29 answers) Better explanation of when to use Imports/Depends (4 answers) Closed last year . I am developing an R package that uses third party functions available in the Bioconductor package "methyilumi" In the code for my R package at the very beginning I import methylumi with library(methylumi) . During the development (I use roxygen2 and devtools) everything works fine. However, when I

Linking to other packages in documentation in roxygen2 in R

给你一囗甜甜゛ 提交于 2019-12-02 17:49:56
I am wondering it there exists a method to link to function from other package when I'm trying to write a documentation for new package using roxygen2 . Something like \link{pck=PACKAGE_NAME, fun=FUNCTION_NAME} ? You have to type \link[pkg]{function} e.g. \link[stringi]{stri_c} In addition to the answer by potockan : Some packages document several functions in a single help page. For example, the trim function from Bioconductor package GenomicRanges is documented in intra-range-methods (which is also the name of a help page from other packages such as IRanges ). To link to the right page with

Is it possible to use R package data in testthat tests or run_examples()?

岁酱吖の 提交于 2019-12-02 15:48:55
I'm working on developing an R package, using devtools, testthat, and roxygen2. I have a couple of data sets in the data folder (foo.txt and bar.csv). My file structure looks like this: / mypackage / data * foo.txt, bar.csv / inst / tests * run-all.R, test_1.R / man / R I'm pretty sure 'foo' and 'bar' are documented correctly: #' Foo data #' #' Sample foo data #' #' @name foo #' @docType data NULL #' Bar data #' #' Sample bar data #' #' @name bar #' @docType data NULL I would like to use the data in 'foo' and 'bar' in my documentation examples and unit tests. For example, I would like to use

chapters in R reference manual and documentation using roxygen2

巧了我就是萌 提交于 2019-12-02 14:34:14
问题 Once I've seen a package supporting R program in which his documentation and reference manual was divided into chapters ( they were called by the consecutive letters of the alphabet ) so that an user could see that functions presented by that package are divided into groups. Now I'm trying to do the same. I'm building package using roxygen2 package but can not deal with that problem. Can any1 has any solution ? So in that case my documentation will be split to a file like this: Group1: funAX

chapters in R reference manual and documentation using roxygen2

笑着哭i 提交于 2019-12-02 13:38:44
Once I've seen a package supporting R program in which his documentation and reference manual was divided into chapters ( they were called by the consecutive letters of the alphabet ) so that an user could see that functions presented by that package are divided into groups. Now I'm trying to do the same. I'm building package using roxygen2 package but can not deal with that problem. Can any1 has any solution ? So in that case my documentation will be split to a file like this: Group1: funAX funBX funCX Group2: funAY funBY funCY instead of funAX funAY funBX funBY funCX funCY A name of package

Example with Roxygen for R Package

ぐ巨炮叔叔 提交于 2019-12-02 05:33:40
问题 I'm trying to add an example of a function within my package. That for I want to use roxygen2. I'm doing the following (just a part of my code, at the end of roxygen2 documentation and until the code of the function starts ... #' @import EcoHydRology #' @export #' @example #' Tx <- 29 #' Tn <- 13 #' rain <- 100 #' lat <- 1 #' Ion <- 10 #' DOY <- 44 #' z <- 450 #' c <- 2.4 #' B <- 0.004 #' #' BC_alt(Tx, Tn, rain, lat, lon, DOY, z, c, B) BC_alt <- function(Tx, Tn, rain, lat, lon, DOY, z, c, B){

Example with Roxygen for R Package

﹥>﹥吖頭↗ 提交于 2019-12-02 01:10:04
I'm trying to add an example of a function within my package. That for I want to use roxygen2. I'm doing the following (just a part of my code, at the end of roxygen2 documentation and until the code of the function starts ... #' @import EcoHydRology #' @export #' @example #' Tx <- 29 #' Tn <- 13 #' rain <- 100 #' lat <- 1 #' Ion <- 10 #' DOY <- 44 #' z <- 450 #' c <- 2.4 #' B <- 0.004 #' #' BC_alt(Tx, Tn, rain, lat, lon, DOY, z, c, B) BC_alt <- function(Tx, Tn, rain, lat, lon, DOY, z, c, B){ #Extraterrestrial solar radiation (with EcoHydRology package) lat_rad <- lat*pi/180 A <- 0.75+(2*10^(