roxygen

Can Roxygen ignore non-user functions?

大憨熊 提交于 2019-12-18 15:55:16
问题 I've just started playing around with the roxygen package and I've very happy with the results so far. However I was wondering, is there a way to specify to roxygen that it should ignore certain functions that are not user-accessible? Specifically, I'd rather not have a .Rd file pop up because I'm using the .onLoad() hook in my package. This function is already documented in the base package so there's no reason for me to re-document it. 回答1: Well, I finally found and browsed the Roxygen

R documentation with Roxygen? [closed]

霸气de小男生 提交于 2019-12-18 12:18:45
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . I find R documentation to be important but also time-consuming to create/maintain. Has anyone used Roxygen yet, and if so, does it help in maintaining an R package? I've used Doxygen in the past, but those projects didn't have the man structure that R packages require. You

Can RStudio automatically generate an roxygen template for a function?

本小妞迷上赌 提交于 2019-12-18 12:05:48
问题 Does RStudio support any automated roxygen template creation? In Emacs-ESS, C-x C-o will produce an roxygen template for a function. For example, it will automagically convert this: foo <- function(x,y) x+y into this: ##' .. content for \description{} (no empty lines) .. ##' ##' .. content for \details{} .. ##' @title ##' @param x ##' @param y ##' @return ##' @author David foo <- function(x,y) x+y Does similar functionality exist within RStudio? updates as of ESS 12.09-2, the command has been

devtools roxygen package creation and rd documentation

≯℡__Kan透↙ 提交于 2019-12-18 11:34:34
问题 I am new to roxygen and am struggling to see how to be able to use it to quickly create a new/custom package. I.e. I would like to know the minimum requirements are to make a package called package1 using devtools , roxygen2/3 so that I can run the commands require(package1) fun1(20) fun2(20) to generate 2000 and 4000 random normals respectively So lets take the simplest example. If I have two functions fun1 and fun2 fun1 <- function(x){ rnorm(100*x) } and fun2 <- function(y){ rnorm(200*y) }

devtools roxygen package creation and rd documentation

眉间皱痕 提交于 2019-12-18 11:34:33
问题 I am new to roxygen and am struggling to see how to be able to use it to quickly create a new/custom package. I.e. I would like to know the minimum requirements are to make a package called package1 using devtools , roxygen2/3 so that I can run the commands require(package1) fun1(20) fun2(20) to generate 2000 and 4000 random normals respectively So lets take the simplest example. If I have two functions fun1 and fun2 fun1 <- function(x){ rnorm(100*x) } and fun2 <- function(y){ rnorm(200*y) }

How to properly document S4 “[” and “[<-“ methods using roxygen?

风流意气都作罢 提交于 2019-12-17 22:39:41
问题 Below I posted a mini example in which I want do write documentation for an “[“ method for a S4 class. Does someone know how to properly document a method for the generic "[" using roxygen and S4? I get a warning when checking the package after building (see below). #' An S4 class that stores a string. #' @slot a contains a string #' @export setClass("testClass", representation(a="character")) #' extract method for testClass #' #' @docType methods #' @rdname extract-methods setMethod("[",

generate markdown comments within for loop

狂风中的少年 提交于 2019-12-17 08:59:13
问题 I am trying to generate an HTML report, using knitr, based on an R script that has for loops. I want to generate markdown comments from the comments within the for loop, but I am not sure if it's possible. Here is simple example, this is in test.R: for (i in 1:5) { ## This is a heading for `i` #' This is a comment for `i` print(i) } Then i use spin to generate a Rmd file: spin('test.R') However, the Rmd file looks like the following. ```{r } for (i in 1:5) { ## This is a heading for `i` #'

Best Practices for Roxygen Imports/Depends?

被刻印的时光 ゝ 提交于 2019-12-14 03:47:32
问题 I'm writing a small convenience package for accessing a private API, and am using httr functions to conduct the requests. I'm also using Roxygen to handle documentation, etc. I'm importing httr functions as such: #' Get a page of data from the specified endpoint. #' @keywords internal #' @importFrom httr GET #' get_data <- function(url, headers, page_number) { # Add querystring for page url_with_page <- paste0(url, "?page=", page_number) message("Downloading: ", url_with_page) # Get API

attempt to apply non-function when using roxygenise(), can't find source of error

痴心易碎 提交于 2019-12-13 03:24:25
问题 I'm trying to use add documentation to my arbitrary Rcpp package using roxygen2, and I keep getting the same error message > roxygen2::roxygenise("anRpackage") First time using roxygen2. Upgrading automatically... Error in .f(.x[[i]], ...) : attempt to apply non-function In addition: Warning message: roxygen2 requires Encoding: UTF-8 I do not have ".f(.x[[i]])" anywhere in my source code, and I don't recognize the form ".f". Is this some kind of hidden function? How should I debug this error?

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