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

From: Henrik Bengtsson <hb_at_stat.berkeley.edu>
Date: Thu, 14 Jan 2010 12:01:09 -0800


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



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 14 Jan 2010 - 20:04:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 14 Jan 2010 - 22:30:13 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive