R packages are the best way to distribute R code and documentation, and, despite the impression that the official manual (Writing R Extensions) might give, they are really are rather simple to create.