Commit 0b38f33
committed
Add R documentation
Contains the R base + recommended package help pages converted to HTML.
Equivalent to the fullrefman.pdf generated from source, which is also
called « The R Reference Index » on https://cran.r-project.org/manuals.html
Currently does not include reference manuals and miscellanea (FAQ, etc.)
Script building the documentation:
```bash
set -e
set -o pipefail
DEVDOCSROOT=/path/to/devdocs/docs/r
RSOURCEDIR=${TMPDIR:-/tmp}/R/latest
RBUILDDIR=${TMPDIR:-/tmp}/R/build
RLATEST=https://cran.r-project.org/src/base/R-latest.tar.gz
R="$RBUILDDIR/bin/R"
libdir="$RBUILDDIR/library"
docdir=$RBUILDDIR/doc
makevars="$RSOURCEDIR/share/make/vars.mk"
if [ ! -f "$R" ] ; then
if [ ! -d "$RSOURCEDIR" ]; then
mkdir -p "$RSOURCEDIR" && curl "$RLATEST" | tar -C "$RSOURCEDIR" -xzf - --strip-components=1
fi
[ -d "$RBUILDDIR" ] || mkdir -p "$RBUILDDIR"
[ -f "$RBUILDDIR/config.status" ] || (cd "$RBUILDDIR" && "$RSOURCEDIR/configure")
make -C "$RBUILDDIR" && make -C "$RBUILDDIR" docs
fi
mkdir -p "$DEVDOCSROOT/doc" && cp -r "$docdir"/* "$DEVDOCSROOT/doc/"
find "$libdir" -type d -name 'html' -printf '%P\n' | while read d; do
mkdir -p "$DEVDOCSROOT/library/$d"
cp -r "$libdir/$d"/* "$DEVDOCSROOT/library/$d/"
done
R_PKGS_BASE="`sed -n 's/^R_PKGS_BASE *= *//p' $makevars`"
R_PKGS_RECOMMENDED="`sed -n 's/^R_PKGS_RECOMMENDED *= *//p' $makevars`"
cat <<EOF | _R_HELP_LINKS_TO_TOPICS_=FALSE $R --vanilla --no-echo
links <- tools::findHTMLlinks()
for (pkg in c(`echo $R_PKGS_BASE $R_PKGS_RECOMMENDED | sed 's/\S\+/"&"/g;s/ /, /g'`)) {
Rd <- tools::Rd_db(pkg, lib.loc="$libdir")
if (!length(Rd)) {
message(paste("ERROR: no help files found for package", pkg))
} else {
message(paste0(pkg, "..."))
}
for(f in names(Rd)) {
out <- file.path("$DEVDOCSROOT/library", pkg, "html", sub("[Rr]d$", "html", basename(f)))
tools::Rd2HTML(Rd[[f]], out, package = "$pkg", defines = .Platform\$OS.type,
outputEncoding = "UTF-8", no_links = FALSE, dynamic = FALSE,
Links = links, stages = c("build", "install", "render"))
}
}
EOF
echo "DONE! Start at $DEVDOCSROOT/doc/html/index.html (or $DEVDOCSROOT/doc/html/packages.html)"
```1 parent cce7c49 commit 0b38f33
7 files changed
Lines changed: 130 additions & 0 deletions
File tree
- assets/javascripts/templates/pages
- lib/docs
- filters/r
- scrapers
- public/icons/docs/r
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
679 | 684 | | |
680 | 685 | | |
681 | 686 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
Loading
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments