roxygen2

What roxygen should I put when I use a function of another package in my function

妖精的绣舞 提交于 2019-12-11 11:34:28
问题 I am writing many functions and I am trying to document using roxygen2 I use the futile.logger package a lot, say I use the flog.debug function in a function. What @* should I use to document it ? 回答1: First, being aware of your sessionInfo() getwd() # your R's working directory .libPaths() # your R's library location Step0 Download and install the necessary packages: library(roxygen2) library(devtools) library(digest) Step1 Put all your related ".R" files (yourfunction1.R, yourfunction2.R,

### ** Examples … Error: could not find function building packages in R

老子叫甜甜 提交于 2019-12-11 08:55:52
问题 I have created a package named test and I have a function named lad inside it. When I build it and after check it with cran=TRUE , I receive the following error. Any idea what's going wrong? * checking examples ... ERROR Running examples in 'test-Ex.R' failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: lad > ### Title: LAD > ### Aliases: lad > > ### ** Examples > > lad(y = "farm", x = "land", data="http://pages.stat.wisc.edu/

Importing two functions with same name using roxygen2

徘徊边缘 提交于 2019-12-11 07:35:35
问题 I'm a maintainer of a CRAN package and get the following messages when loading: * checking whether package ‘qdap’ can be installed ... [10s/10s] WARNING Found the following significant warnings: Warning: replacing previous import ‘annotate’ when loading ‘NLP’ Warning: replacing previous import ‘rescale’ when loading ‘scales’ Because I use the plotrix and scales packages as well as the NLP and ggplot packages. They have the functions rescale and annotate in common. This results in a

How can I automatically add/update Depends/Imports/Suggests versions in DESCRIPTION?

≯℡__Kan透↙ 提交于 2019-12-11 05:06:17
问题 I like to keep my R packages up to date, and in developing my own package, I want to stick to @Hadley's advice: Generally, it’s always better to specify the version and to be conservative about which version to require. Unless you know otherwise, always require a version greater than or equal to the version you’re currently using. So, I'll need some of those here in DESCRIPTION : Imports: knitr (>= 1.13), rmarkdown (>= 1.0) Is there an existing tool to programmatically update the versions of

roxygen2 importFrom and binary operator

喜欢而已 提交于 2019-12-11 04:06:48
问题 What is the way to format a call to importFrom while using roxygen2 ? I can see two approaches: importFrom base %in% or importFrom base `%in%` Obviously we wouldn't import a base function into a package but this is for demo's sake. 回答1: I tested it out HERE and it seems: importFrom base %in% is appropriate 来源: https://stackoverflow.com/questions/23280696/roxygen2-importfrom-and-binary-operator

roxygen2 not generating .Rd file

点点圈 提交于 2019-12-11 02:41:39
问题 When I try to use roxygen2::roxygenize() in RStudio, I get an error message. The message I am coming across is this: Warning message: trainModel.Rd not generated by roxygen2. Skipped. I have tried so much to fix this, but it just won't get fixed unless I remove all of the #' comments out (which would remove the purpose of using roxygen2 in the first place). I even took out everything except for the parts describing the title, description, and details and the error still persists (which makes

R S4 roxygen2 documentation

巧了我就是萌 提交于 2019-12-11 02:04:28
问题 I'm using roxygen2 for documentation in S4 and for some reason the usage section is not showing up. I made a simple example to show my confusion: #' Title #' #' @param x Temp #' #' @return Nothing of interest. #' #' @export #' @docType methods #' @rdname A-methods setGeneric("A", function(x, ...){ cat("test\n") standardGeneric("A") }) #' @rdname A-methods #' @aliases A,ANY,ANY-method setMethod("A", "ANY", function(x, ...){ cat(class(x)) }) #END# 回答1: IMHO that is a common problem. You could

Export a list of functions with roxygen2

情到浓时终转凉″ 提交于 2019-12-11 01:38:47
问题 Problem — I want to export a list of functions as part of an R package, ideally using roxygen2. To be more precise, I want to export the functions in the list, rather than the list itself. For example, consider a list of functions that are generated as closures, like so: addval <- 1:100 fns <- lapply(addval, function(y) {force(y); function(x) x + y}) names(fns) <- paste0("add_", addval) Then the problem is to bind the functions (using the same names in fns , for instance) to the package

Is it possible to @inheritParams from a function within another package?

余生长醉 提交于 2019-12-10 13:28:15
问题 I wrote an importer for an obscure TSV format, which I want to package and document: https://github.com/katrinleinweber/MWX-import/commits/package The importer function passes a renamed skip_lines parameter to utils::read.table so I would like to "pass" the latter's documentation of skip into my .Rd . However, trying a few notations like @inheritParams utils::read.table skip always results in Warning: Failed to find topic […] . Whether it's actually possible to inherit a single, specific

Automatic documentations of functions for Shiny app using RStudio

倾然丶 夕夏残阳落幕 提交于 2019-12-10 11:10:56
问题 I am developing a Shiny app at the moment and getting to a point with more functions than I expected. I plan to start automated testing with testthat and I would love to document my functions with roxygen2 . Since I am using RStudio, I started a new shiny app project. Now I am wondering, since I want the documentation and testing done, if I should instead start a package in RStudio to get all the devtools functions. I am wondering, how to get the functions documented properly and like in the