README.md

Rtemplate

Rtemplate provides a folder structure and some template files to render an empty RStudio project as an R package project.

The content is geared towards my personal needs. If you want to use it, and use it on a periodic basis, you should probably fork the repo, then add, delete, or tinker with the files in the data-raw/template depending on your situation, and finally run the (internal) function prepare_zip to renew the core zip file inst/extdata/template.zip before (re)installing the package.

I encourage every $R$ user to write packages (or at least start writing $R$ scripts as RStudio projects, ready to be enhanced as $R$ packages), there are many reasons to do that: - to distribute $R$ code and documentation, from colleagues to anyone throughout the official CRAN repository or any git hub website. - to keep track of all the $R$ functions that you write and hopefully reuse - to distribute shiny apps to be deployed on your own Shiny server website or to be run by other RStudio IDE users - to share (relatively small) data with some added functionality on them

R Package Worflow

Other git commands that could be useful are the following: - git reset HEAD~1 --soft remove the last commit, without modifying the files, in case you did not push yet - ...

As a curiosity, to calculate the total count of lines of R code in a package, run the following command from inside its project: git ls-files | grep 'R/.*\.R$' | xargs wc -l

It's good style to allows for sub folders inside the inst folder to avoid confusion with other files, but you should at all cost avoid reserved names like:

build, data, demo, exec, help, html, inst, libs, Meta, man, po, R, src, tests, tools, vignettes.

In general, try to use a sub folder extdata to store as is files you don't know how to organize.

Finally, if files are related to a specific programming language use the name of that language as sub folder.

Keep also in mind that...



lvalnegri/Rtemplate documentation built on April 2, 2024, 12:01 p.m.