Questions tagged [roxygen2]

roxygen2 is a Doxygen-like in-source documentation system for Rd, collation, and NAMESPACE. Its primary use is in documenting R functions in-line with the function definition.

0
votes
0answers
3 views

roxygen2 link whole function family

In the @seealso tag of the roxygen2 package one typically links to another function like this @seealso \code{\link{functionName}}. I would like to link from one function to a whole family of functions ...
0
votes
1answer
5 views

Cannot see all my functions when running Open CPU single-user server

When I run ocpu_start_app("my_package") not all the functions are displayed and I cannot access those that are not listed, although they are under the my_package/R/ folder as the OpenCPU documentation ...
0
votes
1answer
22 views

Documenting a ggplot2 Statistic extension - devtools::document() is not creating packagename-ggproto.Rd

I'm creating a package which will contain a new ggplot2 Statistic. I'm using the ggplot2::ggproto to create the new Statistic, but I'm having problems with the documentation with roxygen2. After ...
2
votes
0answers
28 views

Breaking long equations in R documentation

I am trying to write a long equation in the documentation of a function in R. How can I break it into multiple lines? I tried adding \cr into the \deqn environment but the check returned me the ...
0
votes
0answers
10 views

'org.Hs.egALIAS2EG' not found in mget when building my own package,

I am trying to build my own R package. In this package, I am writing a function which can automatically transform gene name to gene ID. For example, if I give gene_name = S100A8, then it will give me ...
0
votes
0answers
23 views

Error in read.dcf(con) : Line starting 'dplyr …' is malformed

I am following this guide when regarding building an R package. However, when I copy the following code: #' Population adjuster #' #' This function appends state population data #' @param any_df The ...
1
vote
0answers
29 views

roxygen templates from a different location

Is there a way how to call roxygen templates from a different location, other than the current package? Use Case I have a lot of packages. Many of them use the same templates for documentation. If a ...
1
vote
0answers
18 views

Print methods in Roxygen2

I am trying to get familiar with the package roxygen2. In particular, I want to understand how print summary methods work in roxygen2. Suppose that I need to create a function of the kind: #' my ...
12
votes
1answer
452 views

Warning about UTF-8 with roxygen2

I have a problem about UTF-8. After conducting roxygen2::roxygenise() for my package, it showed the warning message 'roxygen2 requires Encoding: UTF-8'. How can I fix it? roxygen2::roxygenise() &...
2
votes
1answer
97 views

Roxygen Warning “cannot open the connection” “Permission Denied”

I'm working with roxygen2 and for some reason I can't get it to run. I've tried: > devtools::load_all() > devtools::document() which resulted in: Updating xxxx documentation Loading xxxx ...
0
votes
0answers
8 views

How can I most cleanly use Roxygen2 to document a vector in R

I am writing a package and use Roxygen2 to build the documentation inside the source files (and pkgdown to render them as a website). I have all the key exported functions documented - so far so good....
1
vote
1answer
29 views

import the same PACKAGE in several R files

When writing an R package, I need to import another R package B. I use the roxygen2 for the documentation. My question is, if I have several R functions using the package B, should I write #' @...
0
votes
1answer
26 views

read roxygen2 @importFrom when reading R code

Goal I would like to read an R function into the environment and import it's dependent functions listed in roxygen2 in-line documentation. This mimics the behavior of loading an R package, but does ...
1
vote
2answers
55 views

roxygen Warning: : Missing name

So I'm trying to use roxygen2 to document my code. Unfortunately my supervisor felt it was cluttered having so many functions in the global environment. So I've been told to hide them away in sub ...
0
votes
1answer
69 views

fatal error: RcppArmadilloExtensions/sample.h: No such file or directory

I will apologize in advance for the lack of a reproducible example (yet) - if this isn't an easy answer without that, I'll work on one tomorrow (although due to the nature of the question, I'm not ...
2
votes
2answers
37 views

What's the best way to automatically generate roxygen2 documentation for a data frame?

In my new CRAN package I have 10 dataframes that have 10 or so columns each of various types in the data/ folder. The types are strings, int, floats, booleans, etc. I need to add roxygen2 ...
0
votes
0answers
20 views

How does roxygen handle … in function argument

I have function that takes in one argument only. To error check with nargs() I include .... Problem is, when I check package with roxygen, I get warning. Code and error below. Entire script on ...
0
votes
0answers
16 views

devtools::document() crashes with segfault when documenting R package

I searched for this for a full day and I don't know how to find out why this happens and how to solve it. When I run devtools::document() on a freshly started project (a package in a new directory) ...
2
votes
0answers
23 views

Does roxygen2 use a “prefix is known” heuristic?

Hypothesis Roxygen2 uses a heuristic. If the prefix preceding the period is known (merge, cut), the method is an S3 method, otherwise (slice), it is an ordinary method. Question Is this heuristic ...
0
votes
0answers
10 views

Generating Roxygen2 comments from Rd files

I would like to convert the whole documentation of a package to roxygen2. The current documentation has been done by manually editing the .Rd files in man/. Is there a smart way to convert them back ...
0
votes
0answers
12 views

Rd2pdf prevent adding external package functions to INDEX of reference manual

Several functions of the package I'm developing are calling external functions, and hence, ... argument of my function refers to optional arguments of those functions. This is why, I'm including ...
1
vote
1answer
244 views

Registering routines for R package submission to cran

I'd like to submit an updated version of an R package ot cran but it's failing because of the note: Found no calls to: ‘R_registerRoutines’, ‘R_useDynamicSymbols’ I tried the solution here: https://...
0
votes
0answers
9 views

s3 method for class appearing in documentation produced by roxygen2

Normally, the Usage section in a documentation file produced by roxygen2 just shows the function with its parameters. However, this one inserts a line of text starting ## S3 method for class. It ...
0
votes
0answers
39 views

Objects listed as exports, but not present in namespace

I'm trying to install a package in R. But I get this error upon running install(). The incident_score.R file as roxygen comments as below. Upon running document() the NAMESPACE is automatically ...
0
votes
0answers
22 views

Documentation not being created when building a package in R using roxygen2

The following code reveals a function where it checks if two data.frames are equal in all possible manners and tell the diferences. Now, I am trying to add this function to a package and I am using ...
1
vote
1answer
187 views

Error in R documentation using roxygen2

After building an R package, when typing any of the package's functions name i get this error: Error in gzfile(file, "rb") : cannot open the connection Screenshot of the problem. This error ...
2
votes
1answer
38 views

Is there a canonical syntax for parameter types in roxygen?

I use R with Roxygen. There you have @param blocks just like in Doxygen and JavaDoc. Since R is dynamically typed (duck-typed even), there is no type information as there is with C++ or Java. For PHP ...
1
vote
0answers
22 views

Is there a way to check each function in an R package against only the imports in its own roxygen2 comment block?

I am making an R package, and I'm using roxygen2 to auto-generate my NAMESPACE file, which means I am declaring my imports in the roxygen2 comments above each function in my package, something like ...
5
votes
2answers
92 views

Stuck with definition of S3 method for autoplot

I'm stuck with defining S3 method for autoplot. I have the following (full code here): #' Autoplot for bigobenchmark object #' #' @importFrom ggplot2 autoplot #' #' @param object #' #' @return A ...
2
votes
1answer
51 views

generating .R file from .Rd file

I know roxygen2::roxygenise() or devtools::document() cane be used to generate .Rd file from .R file. For example, if Test.R is as follow #' Add together two numbers #' #' @param x A number #' @...
1
vote
1answer
168 views

Documenting R6 class methods with Roxygen2

I'm writing a package with an R6 class that has several methods. I would like to be able to generate documentation for both, class and methods. For the below example, I would like to be able to access ...
1
vote
2answers
33 views

Documenting `..`

I'm trying to use roxygen to document and export a function I have named .. -- I use it for some pattern matching and want a name that doesn't take up much space in an expression but I don't want to ...
0
votes
1answer
140 views

Adding dependencies properly to an r package, so that they install automatically

I'm making my first R package, and I'm trying to include package dependencies. The package installs and works fine on my machine, but I already have all of the dependencies installed. When another ...
0
votes
0answers
31 views

How to use/document a ggplot2 special variable ..count.. in an R Package

I'm creating a package for reporting data using ggplot2. I'm using the variable ..count.. but the R CMD Check notes the existence of this variable: report <- function(df, a){ ggplot2::ggplot(df, ...
1
vote
1answer
56 views

Writing R demos for a package [closed]

I have a very simple question really. There's a demo function demo() i.e. demo(scoping) which runs a demo of the topic. How do I write something like this for my own package? Its crazy but I have ...
1
vote
0answers
21 views

How to correctly document a method with roxygen2 in R

I have a custom class, called "FOO", and would like to set the "length" method for that class. Here is a template: #' Returns the length of the FOO object #' #' @name length #' @param x a FOO object #...
3
votes
1answer
98 views

R Package: how “import” works when my exported function does not call explicitly a function from other packages, but a subroutine does

I am developing my first R package and there is something that it is not clear to me about Imports in the DESCRIPTION file. I went through quite some guides that explain package structure but I do not ...
0
votes
1answer
28 views

Roxygen documentation for existing generics

I wrote a show() method for the S4 class myclass which I had defined in my package. I generated documentation for class and method with roxygen2. Everything works nicely, except that I get the ...
0
votes
0answers
22 views

Organising .R files in a hierarchical directory strucutre

Is there a way to both have a hierarchical directory structure at the same time using a tool for auto-generating consistent documentation? Background: I am developing a network analysis application. ...
1
vote
1answer
113 views

checking S3 generic/method consistency … WARNING

I have already read following two discussion: Roxygen2 - how to properly document S3 methods S3 method consistency warning when building R package with Roxygen And following two tutorial: http://cran....
0
votes
0answers
31 views

Overflowing table in R documentation

I am creating R documentation for an R function in an R package using roxygen2 syntax. I am trying to insert the following data.frame bman usint the tabular function as follows`. library(htmltab) ...
0
votes
0answers
29 views

How do you control import order in an R package documented with roxygen2?

roxygen2 will automatically build a NAMESPACE file based on my @import directives in my package documentation. But apparently, it doesn't matter how I order the @import directives, it always adds the ...
0
votes
0answers
23 views

Unwrap examples in Rd files

I've recently submitted a package to CRAN, and one of their comments was "Please unwrap all examples in your Rd-files that can be executed in less than 5 sec per Rd-files". I generate those rd files ...
0
votes
0answers
128 views

Generate R package manual in .tex or .pdf - cut off lines

I created my first R package using roxygen2. I generated the manual with a .pdf extension using the code pack <- "name_of_your_package" path <- find.package(pack) system(paste(shQuote(file....
1
vote
0answers
66 views

how do I use @importFrom so that it applies to a whole R package?

automated data analysis workflows I have the following code in my packagename.R file in the packagename folder. I know I am going to use certain functions from other packages routinely, so I want to ...
8
votes
1answer
185 views

Displaying numbered list in R package

I'm having trouble getting a numbered list to display in R package help. Here's what I have in roxygen: #' @return #' Bunch of text #' Bunch of text: #' \enumerate { #' \item a #' \item b #' ...
0
votes
0answers
66 views

CRAN submission - How should I document hidden functions in R?

Long story short: My aim is to submit a R package developed with roxygen2 to CRAN, and I need to find some guidelines on writing and documenting hidden functions. More details: I am writing my ...
0
votes
1answer
72 views

R package not loading `Imports` packages

I am working on a package which has a function that relies on dplyr among many other packages. As suggested by H. Wickham in his R Packages book, I am including all the necessary packages under ...
0
votes
0answers
78 views

Ignoring the symbol ° in R devtools function document()

I would like to create a package for internal usage (not to distribute somewhere). One of my functions contains the line if (data$unit[i] != "°C") { It works perfectly in the script, but if I want ...
0
votes
0answers
36 views

is it possible to keep the roxygen2 documentation in a file separate from the function?

My use case involves keeping the documentation for a package in one repo and the functions in a different package. Is that possible with roxygen2?