Yes file.path()
R> file.path("usr", "local", "lib") [1] "usr/local/lib" R>
There is also equally useful system.path() for files in a package:
R> system.file("extdata", "date_time_zonespec.csv", package="RcppBDT") [1] "/usr/local/lib/R/site-library/RcppBDT/extdata/date_time_zonespec.csv" R>
which will receive the extdata/date_time_zonespec.csv regardless
- where is the package installed and
- OS
which is very convenient. Finally, there are
R> .Platform$file.sep [1] "/" R>
if you insist on doing it manually.
Dirk Eddelbuettel Oct 28 '12 at 15:21 2012-10-28 15:21
source share