roxygen

When documenting in Roxygen: How do I make an itemized list in @details?

删除回忆录丶 提交于 2020-02-26 10:49:09
问题 What is the appropriate syntax to add an itemized list to roxygen2, for instance, in the @details section? Can I create a latex list environment? It seems that line breaks are simply ignored, i.e. #' @details text describing parameter inputs in more detail #' #' parameter 1: stuff #' #' parameter 2: stuff thanks! 回答1: Here is a roxygen2 example following your problem formulation. ##' ##' @details text describing parameter inputs in more detail. ##' \itemize{ ##' \item{"parameter 1"}{Stuff} ##

Good reference for Roxygen? [closed]

耗尽温柔 提交于 2020-01-11 18:50:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Other than the excellent SO answer here, and the Roxygen manual and vignette, is there any particularly thorough guide to using Roxygen? 回答1: I'm working on a guide (but it's still incomplete). A more comprehensive set of vignettes have been added to the package, and were made available on CRAN as of version 4.0

Inline package overview documentation using roxygen

流过昼夜 提交于 2020-01-02 10:02:50
问题 I imagine this is a simple thing that I keep overlooking in the documentation, but I can't seem to figure out how to get package-level documentation to work in R. I'm not referring to function or class-specific documentation, but the documentation that you get when you type, for example, ?stats. I've followed the general instructions I've found on the web, creating a sckeleton documentation file saved as .R. The .R file is copied with the package scripts, but the help documentation doesn't

Can Roxygen really document R script (not a package) just like Doxygen does for C++?

假装没事ソ 提交于 2019-12-30 09:43:12
问题 Roxygen is inspired by the Doxygen documentation system that is used by C, C++ programmers. I have used Doxygen and I find it really easy to document any program as long as you have the doxygen comment. It also generate call graphs for functions and classes. I thought roxygen would work the same way but when I search for roxygen help, I only find solution to documenting R packages. I have checked Hadley Wickham's online roxygen2 help but that does not describe anything about the R script

Automatic documentation of datasets

时光毁灭记忆、已成空白 提交于 2019-12-28 08:08:12
问题 I'm working on a project right now where I have been slowly accumulating a bunch of different variables from a bunch of different sources. Being a somewhat clever person, I created a different sub-directory for each under a main "original_data" directory, and included a .txt file with the URL and other descriptors of where I got the data from. Being an insufficiently clever person, these .txt files have no structure. Now I am faced with the task of compiling a methods section which documents

Does roxygen2 automatically write NAMESPACE directives for “Imports:” packages?

江枫思渺然 提交于 2019-12-28 05:16:30
问题 tl;dr version of my question If I want to import packages, do I have to manually write import() directives into my NAMESPACE file? It seems like roxygen2 won't magically do that for me, even if I have them listed as "Imports:" in my description. Fuller Version This is a pretty dumb question, but I ask because the answer's not obvious to me. I use roxygen2 to handle my R package documentation. When I want to be sure a function is exported, I add an @export tag to its roxygen block. Subsequent

How to properly document a S3 method of a generic from a different package, using Roxygen?

梦想的初衷 提交于 2019-12-28 05:16:15
问题 I am writing a package that defines a new class, surveyor, and a print method for this, i.e. print.surveyor . My code works fine and I use roxygen for inline documentation. But R CMD check issues a warning: Functions/methods with usage in documentation object 'print.surveyor' but not in code: print I have used the following two pages, written by Hadley, as inspiration: Namespaces and Documenting functions, both of which states that the correct syntax is @method function-name class So my

Roxygen2 - how to @export reference class generator?

懵懂的女人 提交于 2019-12-22 04:01:52
问题 For instance, say I have the following package called Test and I want to export class A : # In /R/Test.R: #' @docType package #' @import methods #' @exportClass A A <- setRefClass("A", methods = list(foo = identity)) However, after building and loading, I get the following error when using A 's generator: > library(Test) > A()$foo(1) Error: could not find function "A" I've checked the contents of my NAMESPACE file is fine: exportClasses(A) import(methods) So what's going wrong? Why isn't my

Roxygen: how to set a default parameter including backslash ('\') to functions

 ̄綄美尐妖づ 提交于 2019-12-22 01:26:41
问题 I use Roxygen to generate Rd files of my packages under development, but I have some problems with functions with default parameter set to ' \n' , e.g.: lineCount <- function(text, sep='\n') { ... } Which purpose is to count new line ( '\n' ) characters in a string. The problem is that R CMD check gives a warning about: Codoc mismatches from documentation object 'lineCount': lineCount Code: function(text, sep = "\n") Docs: function(text, sep = " ") Mismatches in argument default values: Name:

Is there a way to automatically update the documentation in an R package?

此生再无相见时 提交于 2019-12-19 17:34:53
问题 I used 'package.skeleton()' to generate .Rd help files a few months ago. I have edited these files, and I have also changed the functions, removed some functions, added others. Is there a function that automates updating the Rd files? update A nice package was just released called Rd2roxygen, it is described by the author Yihui Xie on his blog. As the name implies, this package allows one to retroactively insert documentation currently contained in .Rd into .R files. Sounds like a promising