summaryrefslogtreecommitdiff
path: root/math/R/files/R
blob: 9b6eedb5a3fa1075b64658c994ceb9bdb0d3424b (plain) (blame)
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
#!/bin/sh
# Shell wrapper for R executable.

RHOME=PREFIX/share/R
export RHOME

ARG=$1
case ${ARG} in
    RHOME)
	echo ${RHOME}; exit 0 ;;
    CMD)
	shift; PATH=$PATH:$RHOME/cmd:$RHOME/etc exec $* ;;
    SHLIB|COMPILE|INSTALL|REMOVE)
	shift; exec sh ${RHOME}/etc/${ARG} $* ;;
    -d|--debugger)
	exec $2 ${RHOME}/bin/R.binary ;;
    -h|--help|-\?)
        echo "Usage:  R [OPTIONS] [< INFILE] [> OUTFILE]"
        echo ""
        echo "Options:"
        echo "  --save                     Do save data sets at the end of the session."
        echo "  --no-save                  Don't save them."
        echo "  --restore                  Do restore previously saved data sets at startup."
        echo "  --no-restore               Don't restore them."
        echo "  --no-readline              Don't use readline for command-line editing."
        echo "  --no-site-file             Don't read the site-wide Rprofile."
        echo "  --no-init-file             Don't read the .Rprofile or ~/.Rprofile files."
        echo "  -v N                       Set the vector heap size to N megabytes."
        echo "  -n N                       Set the number of cons cells to N."
        echo "  -h, --help, -?             Print short help message and exit."
        echo "  -q, --quiet                Make R run as quietly as possible."
        echo "  -V, --version              Print version info and exit."
        echo "  -d NAME, --debugger NAME   Run R through debugger NAME."
	exit 0 ;;
esac	

# Default Printer Paper Size
# Choose one of the following
# R_PAPERSIZE="a4"
# R_PAPERSIZE="letter"
# R_PAPERSIZE="none"
R_PAPERSIZE=DEFAULTPAPER
export R_PAPERSIZE

# Default Print Command
# Choose one of the following
# R_PRINTCMD="lpr"
# R_PRINTCMD="lp"
R_PRINTCMD=lpr
export R_PRINTCMD

exec ${RHOME}/bin/R.binary  $*