roxygen2

Possible to create Rd help files for objects not in a package?

ぃ、小莉子 提交于 2019-11-27 01:42:34
问题 I am using Rstudio to streamline Sweave and R for data analyses that I will share with other analysts. In order to make the coding of variables crystal clear, it would be great to have something like a help file so they can call ?myData and get a helpful file, if they need. I like the Rd markdown and think it actually has great potential to document analytic datasets, including an overall summary, a variable by variable breakdown, and an example of how to run some exploratory analyses. It's

How to not run an example using roxygen2?

家住魔仙堡 提交于 2019-11-27 01:17:12
问题 I'm writing a geocoding function right now that relies on having a Bing Maps Key. Obviously I'd rather not publish mine, and the examples fail without one. How do I include an example for users to run manually, but not have it executed during R CMD check ? 回答1: Use \dontrun{} #'@examples #'\dontrun{ #'geocode("3817 Spruce St, Philadelphia, PA 19104") #'geocode("Philadelphia, PA") #'dat <- data.frame(value=runif(3),address=c("3817 Spruce St, Philadelphia, PA 19104","Philadelphia, PA",

How to properly document S4 class slots using Roxygen2?

我只是一个虾纸丫 提交于 2019-11-26 18:48:47
问题 For documenting classes with roxygen(2), specifying a title and description/details appears to be the same as for functions, methods, data, etc. However, slots and inheritance are their own sort of animal. What is the best practice -- current or planned -- for documenting S4 classes in roxygen2? Due Diligence: I found mention of an @slot tag in early descriptions of roxygen. A 2008 R-forge mailing list post seems to indicate that this is dead, and there is no support for @slot in roxygen: Is

Exporting non-S3-methods with dots in the name using roxygen2 v4

我的未来我决定 提交于 2019-11-26 16:16:02
问题 Since roxygen2 version 4.0.0 , the @S3method tag has been deprecated in favour of using @export . The package now tries to detect if a function is an S3 method, and automatically adds the line S3method(function,class) to the NAMESPACE file if it think it is one. The problem is that if a function is not an S3 method but its name contains a . then roxygen sometimes makes a mistake and adds the line when it shouldn't. Is there a way to tell roxygen that a function is not an S3 method? As

Importing two functions with same name using roxygen2

∥☆過路亽.° 提交于 2019-11-26 12:28:28
问题 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

Roxygen2 - how to properly document S3 methods

青春壹個敷衍的年華 提交于 2019-11-26 10:26:54
问题 I\'ve read the Roxygen2 PDF as well as this site and I\'m lost about the difference between @method @S3method @export and how you use these to properly document S3 methods. I worked up the follow example for discussion: 1. How would I properly document these? 2. How do I emulate documentation of ?print and other generic functions that show the use cases for all class-specific implimentations (i.e. the way ?print shows usage for \'factor\', \'table\',\'function\') 3. From the wiki page: \"All