[R] Loading text file from data folder of package

Andrew Liu Andrew.T.Liu at williams.edu
Wed Jul 7 15:20:14 CEST 2010


Hello,

I am creating a package and in my vignette I would like to load a text 
file from the data folder of the package. Currently, I am doing the 
following:

filepath <- paste(.libPaths(), "pkgname", "data", "sample.txt", sep = "/")
file(filepath)

Is there a better way of doing this?

Thanks,
Andrew



More information about the R-help mailing list