From hb at stat.berkeley.edu  Thu Jan 14 21:01:09 2010
From: hb at stat.berkeley.edu (Henrik Bengtsson)
Date: Thu, 14 Jan 2010 12:01:09 -0800
Subject: [Rd] Wishlist: system.file(... package) throw an error if package
	not installed/path not found
Message-ID: <59d7961d1001141201t577e6196l24a654bea6e06136@mail.gmail.com>

Currently, system.file() on a non-existing package returns an empty string:

path <- system.file(package="foo");
print(path);
[1] ""

The same goes for non-existing paths in existing package directories:

path <- system.file("foo", package="base");
print(path);
[1] ""

Is there a rationale for this, or is it just for historical reasons?
Is the empty string "" used in R to represent a "missing" file?  (e.g.
file.exists("") == FALSE).

I would like to suggest that an error is thrown instead, so that it is
caught as soon as possible and not down stream.

/Henrik



[Rd] Wishlist: system.file(... package) throw an error if package not installed/path not found
Henrik Bengtsson