1

Can anyone point me to R help files in plain text or man page format, greppable ?
By "help file" I mean either

  • the file of 1-line command summaries that ?? looks in
  • a tree of man pages, for man, man -k etc.

For example ??recycle is funny, but not useful; I'd much prefer grep -iw recycle or man -k recycle .

Sorry if this question is a duplicate -- it must be, but I haven't found it yet.

($R_HOME/doc/manual/*.html and *.pdf must have been generated, from what text ?)

(Why grep ? Because it's fast, simple, and familiar -- for me, who grew up when flipping between keyboard and mouse wasn't a problem: there was no mouse.)


Added: the .../*/man/*.Rd files in the src tar (thanks nicola) are latex.
how-do-i-convert-latex-to-plain-text-ascii lists several possibilities;
unfortunately, pandoc -f latex quits early on these Rd files.
Community
  • 1
  • 1
denis
  • 21,378
  • 10
  • 65
  • 88
  • Just extract the `.tar.gz` package file and you'll find the `man` directory where the `.Rd` files are stored. Those files generate the doc. – nicola May 26 '15 at 15:34

1 Answers1

0

Use R itself, a pkg::func at a time. R finds the help text somewhere and converts it to nearly-plain text somehow -- "where" and "how" are well-hidden but unimportant.

(In fact I had to use Rscript to get single help files:

# rhelp topic [package]: R help for one function  > stdout
# (sink(), help() geht nicht ?  in R 3.1.3  mac 10.8.3)

case $1 in
"" ) Rscript -e "help( package=${2-NULL} )" ;;
* )  Rscript -e "help( topic=\"$1\", package=${2-NULL} )"  # topic ":" "@" "[.data.frame"
esac  |

    # _\010U_\010s_\010a_\010g_\010e: -> Usage:
    # \010 is the single char ctl-H,  backspace
sed '
/^_/ s/_\010//g
'
denis
  • 21,378
  • 10
  • 65
  • 88