[R] Where to put example files?

Roger Bivand Roger.Bivand at nhh.no
Tue Jan 4 13:09:23 CET 2005


On Tue, 4 Jan 2005, michael watson (IAH-C) wrote:

> I'm writing an R package which includes some text file parsing
> functions, and I want to include with my package some example files to
> be used with those functions.  My question is which directory should I
> put these example files in for the user to access?  I have tried demo,
> example, doc and sample but none seem to work or "fit".
> 

Try using a subdirectory to inst/ in the package source. For example, 
inst/shapes/sids.shp in package "maptools" can be accessed by:

system.file("shapes/sids.shp", package="maptools")[1]

See examples in the pixmap package.

Roger


> Thanks in advance
> Mick
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no




More information about the R-help mailing list