Documenting code can be a bit of a pain. Yet, the older (and wiser?) I get, the more I realise how important it is. When I was younger I said 'documentation is for people without talent'. Well, I am clearly loosing my talent, as I sometimes struggle to understand what I programmed years ago. Thus, anything that soothes the pain of writing and maintaining documentation must be good and should help me to better understand my 'old me' in the future.
Ideally I want my R code and documentation in as few files as possible. A good start to achieve this is using roxygen2, an R package which has been around for some time. It allows me to tie R code together with the documentation in the same file and helps considerably in maintaining R packages.
The roxyPackage by Meik Michalke goes a step further, building on roxygen2. Meik presented his package at the Cologne R user group meeting a few weeks ago and I was intrigued by it. As I said in my notes to the meeting, with roxyPackage I can create a package from a single file of R code and documentation.
Here is an example of one R file to build a package using roxyPackage. For my toy example I wrote a doughnut plot function in R, something which is clearly missing ;)
I took the basic pie chart function and amended it to plot another white disc in the middle. On top of the function code I wrote the help file documentation using the roxygen2 syntax.
Read more »
Blog Archive
-
▼
2013
(214)
-
▼
March
(23)
- Our Canary Died
- Landslides: Does homeowners insurance cover that?
- "Wait a minute -- I thought insurance companies ca...
- Report: Claims cost of individual health insurance...
- Tacoma man arrested for insurance fraud
- ChainLadder 0.1.5-6 released on CRAN
- Q: "My homeowners insurer sent an inspector to loo...
- Submit a talk for the first R in Insurance conference
- Job opening: Deputy insurance commissioner for leg...
- Insurance questions: "What's an `examination under...
- "An accident drove up my insurance rates, but I wa...
- googleVis 0.4.2 with support for shiny released on...
- "I got the check for my car repair, but it doesn't...
- Disappointed
- Jury convicts Spokane man of fraud in case of $200...
- Hearing: Proposed acquisition of Western United Li...
- How to use optim in R
- "My agent said I had `full coverage' but won't pay...
- What does insurance have to do with climate change?
- Create an R package from a single R file with roxy...
- "Why do I have to do the insurance company's work ...
- What you can do when your health insurer says no
- Large health insurer surpluses could help ease pre...
-
▼
March
(23)
Popular Posts
-
Before we get started, this is the one hundredth post of this blog. It started in February 2009 as one of my leadership tasks as president o...
-
Earlier this month, the Washington Healthplanfinder (our state's health insurance exchange) opened its toll-free hotline to start answe...
-
I broke the news to Evelyn. My aunt, Jean Davis, died early Saturday morning. It was my duty to call all of her friends, make the final arra...
-
<$BlogPageTitle$> <$BlogItemBody$>
-
Version 0.1.6 of the ChainLadder package has been released and is already available from CRAN . The new version adds the function CLFMdelta...
-
<$BlogPageTitle$> <$BlogItemBody$>