roxygen

R CMD roxygen not recognized

丶灬走出姿态 提交于 2019-12-06 21:49:21
问题 I just tried out Roxygen package. Within R, I can run through the example in the Roxygen Vignette. But In command line, R CMD roxygen is not recognized as a valid command. When I run R CMD --help , I can see all INSTALL, check, ...sweave..., config... command items but not roxygen. can anyone help me out of this? is there addtional installation steps required other than install.packages("roxygen") ? I use windows 32 with R 2.12.0 and working Rtools environments. Thanks. 回答1: If I recall, you

Inline package overview documentation using roxygen

爱⌒轻易说出口 提交于 2019-12-06 12:09:45
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 get made into a .Rd file (unless I add a function definition also named after the package). An example of

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

两盒软妹~` 提交于 2019-12-04 22:26:47
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: 'sep' Code: "\n" Docs: " " The problem seems to me that caused by writing to the Rd file (writing to

adding useDynLib through Roxygen [closed]

我与影子孤独终老i 提交于 2019-12-04 16:45:31
问题 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 6 years ago . I am converting my packages to use roxygen documentation, through the roxygen2 package. Now my package does not load and I think that is is because of the missing useDynLib(mypackage) call missing from the NAMESPACE file. How do I get this generated? 来源: https://stackoverflow.com/questions/8407615/adding

Are there best/recommended practices to follow when renaming functions in a new version of a package?

守給你的承諾、 提交于 2019-12-04 07:33:18
问题 I'm updating an old package and shortening a bunch of really long function names. How do I let a user know the the old function has been deprecated? I document everything with roxygen2 so I'm wondering if #' @alias is what I should use? Thoughts? 回答1: Even though you are just shortening function names, I would still treat it with the same fanfare as any change to the public API of the package: with deprecation/defunct stages to the old functions as the new functions are brought in. In the

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

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

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

怎甘沉沦 提交于 2019-12-02 06:20:42
问题 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

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

落爺英雄遲暮 提交于 2019-12-01 23:29:23
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 question is: What is the correct way of documenting the print method for my new class using Roxygen? And

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

痞子三分冷 提交于 2019-12-01 16:44:58
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 approach for both learning roxygen and for converting packages currently in development to R packages.