Alternative to system.file

Usage

package.file(...)

Arguments

...
arguments to be passed to system.file

Value

Path returned by system.file.

Description

The function works as system.file, but takes care when the package is a local folder.

Details

The use case is when some data file or direcotry is needed to be loaded, and it is placed in inst/ directory of the package.

Examples

mibddir <- package.file("extdata", "solarOutput", "solarMibds", package = "solarius") mibddir
[1] "/home/andrey/git/ugcd/solarius/inst/extdata/solarOutput/solarMibds"
list.files(mibddir)
[1] "mibd.2.0.gz" "mibd.2.1.gz" "mibd.2.2.gz" "mibd.2.3.gz" "mibd.2.4.gz" [6] "mibd.2.5.gz" "mibd.5.0.gz" "mibd.5.1.gz" "mibd.5.2.gz" "mibd.5.3.gz" [11] "mibd.5.4.gz" "mibd.5.5.gz"