R Scripts: Templates, Examples of Analyses using
RStudio Demonstrations | Contents Directory
This is for use with the R function
getRs in the R
Hmisc package for listing available scripts, downloading a selected script, and opening it in the RStudio script editor window.
The special file
contents.md lists all the available files and short descriptions for them. It should not be edited, as it is auto-generated by
contents.md is used when
getRs is called with no arguments, to give the user a list of available scripts and their descriptions.
Rmarkdown scripts included here use a template that makes the result part of a reproducible research process by documenting the versions of R and attached packages at the end of the report. They make use of the
knitrSet function. When running Rmarkdown, call
knitrSet gets rid of ## at the start of R output lines, and makes it easy to specify things like figure sizes in
knitr chunk headers. It also causes annoying messages such as those generated from attaching R packages to be put in a separate file
messages.txt rather than in the report.
contents.md is generated from titles, major and minor categories, and types (R, R Markdown) that are at the top of each script. R Markdown scripts must have suffix
Rmd and have the following information between lines containing
--- and after the
minor (optional). Scripts that fall under multiple categories have those category descriptions separated by semicolons. See
descriptives.Rmd for an example. Regular R scripts must have suffix
r and have the following in the top lines of the script (again,
minor is optional):
# title: Title of Script with Purpose, etc. # major: major category 1; major category 2 ... # minor: minor category 1; minor category 2 ...
introda.r for an example.
Some possible values for major categories are listed below.
|introduction||Introduction to R|
|ABD||Problems from Analysis of Biological Data, 2nd edition, by Whitlock and Schluter|
Some possible values for minor categories are listed below.
|ordinary least squares||Linear Model|
To request the addition of new categories open an issue for this GitHub project.