Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Roxygenize a single R script file? [duplicate]

Tags:

r

roxygen2

I know how to roxygenise a package and the functions in it. But what if we are writing a single R script file (.R file) and we need to document it?

For example, I need to document this customPow function:

customPow <- function(x,y){
return(x^(y))
 }

I don't need to build a whole package for documenting this tiny simple function which would be an over-kill. How to roxygenise this function?

like image 521
j1897 Avatar asked Dec 12 '25 20:12

j1897


1 Answers

The klmr/modules package has been replaced by the CRAN box package by the same author.


The klmr/modules package on github can do that -- note that this is not the same package as the modules package on CRAN even though it has the same name.

For an example, see Using an R Markdown Document as a source for functions

like image 58
G. Grothendieck Avatar answered Dec 15 '25 11:12

G. Grothendieck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!