R-alpha: $RHOME/cmd/filename script

Friedrich Leisch (Friedrich.Leisch@ci.tuwien.ac.at)
Fri, 8 Nov 1996 12:47:17 +0100


Date: Fri, 8 Nov 1996 12:47:17 +0100
Message-Id: <199611081147.MAA14463@galadriel.ci.tuwien.ac.at>
From: Friedrich Leisch <Friedrich.Leisch@ci.tuwien.ac.at>
To: R-testers@stat.math.ethz.ch
Subject: R-alpha: $RHOME/cmd/filename script


I have patched the $RHOME/cmd/filename to allow for a user
R-hierarchy, e.g., R looks also in ~/lib/R/library for files when
using library(...).

This was just a quick and dirty hack, I don't even know exactly all occasions
where filename is used. Anyway, I think there should be the
possibility for a transparent way how R looks for various kinnds of
files:
	libraries
	data
	???

It might be handy to have a variable like

	RLIB=~/lib/R:/usr/lib/R:/yet/another/R

and R searches all the corresponding hierarchies when looking for
files.

Opinions?

Greetings,
Fritz

--------8<--------8<--------8<--------8<--------8<--------

#!/bin/sh
# R filename script patched by Friedrich Leisch

for file in $HOME/lib/R/$1/$2 $RHOME/$1/$2; do
    if [ -r $file ]
    then
	echo $file
	break
    fi
done

if [ ! -r $file ]
then
    echo
fi

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-