[R] new R package. How to hide data file

james.foadi at diamond.ac.uk james.foadi at diamond.ac.uk
Mon Jan 18 13:43:32 CET 2010


Dear R community,
I'm in the process of writing a package.

One of the functions reads a whole ascii file, full of data:

> SYMINFO <- scan("/file/full/of/data.txt",what="character",sep="\n",quiet=TRUE)

SYMINFO is now an array character with roughly 14000 elements.

I thought the best way to use this file in the package was to list it, together with the rest of
useful functions, in the list= field of package.skeleton. This way, a "SYMINFO.rda" is created in 
the data directory of the new package. It can, then, be used by all functons needing it through
a 

data(SYMINFO)

line. I have created and installed the package and things work.

But I would like to make SYMINFO invisible to users. If I call SYMINFO as .SYMINFO, the functions needing
this bit of data do not work anymore, even if I replaced 

data(SYMINFO)

with

data(.SYMINFO)


Does anyone have ideas why this is happening? Would you handle the whole process differently?


Kind regards,

J

Dr James Foadi PhD
Membrane Protein Laboratory (MPL)
Diamond Light Source Ltd
Diamond House
Harewell Science and Innovation Campus
Chilton, Didcot
Oxfordshire OX11 0DE

Email    :  james.foadi at diamond.ac.uk
Alt Email:  j.foadi at imperial.ac.uk


-- 
This e-mail and any attachments may contain confidential...{{dropped:8}}



More information about the R-help mailing list