Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible/advisable to skip roxygen in favor of roxygen2? [closed]

I've recently been pointed towards Roxygen to solve my documentation woes/laziness. But then there's this shiny Roxygen2 which, in my understanding, is somewhat its own thing. Hadley's package tools require the use of Roxygen2, but there doesn't seem to be much by way of a walk-through anywhere.

Given that I'm starting from scratch in the learning process:

  1. Is there a use case, for a new user, that favors Roxygen instead of Roxygen2, or is Roxygen2 better in all ways?

  2. If so what resources are out there for learning it (preferably those which don't rely on prior knowledge of Roxygen)?

  3. Is Roxygen2 backwards-compatible with Roxygen (such that time invested in learning and writing Roxygen would carry over)?

like image 993
Ari B. Friedman Avatar asked Aug 06 '11 22:08

Ari B. Friedman


People also ask

What is Roxygen?

roxygen2 allows you to write specially formatted R comments that generate R documentation files ( man/*. Rd ) and a NAMESPACE file. roxygen2 is used by over 8,000 CRAN packages. Install the latest version of roxygen2 with: install.packages("roxygen2")

What is .RD File in R?

R objects are documented in files written in “R documentation” (Rd) format, a simple markup language much of which closely resembles (La)TeX, which can be processed into a variety of formats, including LaTeX, HTML and plain text.


2 Answers

There's no reason to prefer roxygen to roxygen2 if starting from scratch. We're working on an introductory article for r news.

like image 117
hadley Avatar answered Nov 15 '22 21:11

hadley


I switched my build scripts to call roxygen2 instead of roxygen, and everything worked as before, except that now I get a nice, auto-generated NAMESPACE file.

So learning roxygen means that you are learning the basics of roxygen2. I'm sure I'm not using all the new features, but for the basics roxygen2 works just like roxygen.

I'd also add that install_github() in the devtools package (also on github) is absolutely great. For packages that are not CRAN-worthy, github is a great way to go.

like image 20
kmm Avatar answered Nov 15 '22 23:11

kmm