jeromyanglim / learning_r

assorted notes to self while learning R
1 stars 0 forks source link

Rd to Roxygen #23

Closed jeromyanglim closed 12 years ago

jeromyanglim commented 12 years ago

If I have some existing Rd files, how can I quickly convert them to Roxygen?

jeromyanglim commented 12 years ago

Yihui's package seemed to work well http://yihui.name/en/2010/12/rd2roxygen-convert-rd-to-roxygen-documentation/

install.packages('Rd2roxygen')
library('Rd2roxygen')

Then with the working directory in the directory containing the package directory, assuming my package was called mypackage

Rd2roxygen('mypackage')

It then provided output on each replacement, like this:

##------ Tue Oct  2 20:58:10 2012 ------##
parsed: adjoint.Rd
looking for the object 'adjoint' in:
  functions.r: line 38
ElementaryLinearAlgebra/R/functions.r updated

All the R functions in the R directory of the package file was updated with Roxygen comments.