package.file: Alternative to system.file

Description Usage Arguments Details Value Examples

View source: R/data.lib.R

Description

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

Usage

1

Arguments

...

arguments to be passed to system.file

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.

Value

Path returned by system.file.

Examples

1
2
3
4
mibddir <- package.file("extdata", "solarOutput", "solarMibds", package = "solarius")
mibddir

list.files(mibddir)

Example output

[1] "/usr/local/lib/R/site-library/solarius/extdata/solarOutput/solarMibds"
 [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"

solarius documentation built on May 2, 2019, 2:43 a.m.