R package example - loading CSV file


New Member

I'm new to R so am hoping that this is a trivial question. I am creating an R package, pkge, and in the man/ subdirectory I have a documentation file, pkge.Rd. In this file there is an example (\examples{...}) script. This script needs to be able to load the content of a sample CSV file.

How do I do this? Where should this CSV file be placed, and how do I reference it? I obviously can't provide a 'full path' to it since I won't know where the user has placed the package...

Thanks in advance for the help.


Ambassador to the humans
Is the reading of the csv vital to what you're doing or do you just want to get the data loaded in? If it's the latter you could just include it as a dataset in your package.