When I install my package or run it (library(...)) i would like to see it loading a particular data inside the package as environment variable for the execution. How can i do that?
Asked
Active
Viewed 316 times
0
-
Sorry, I don't understand your question. Can you please elaborate? – Roland Mar 19 '15 at 09:18
-
Once your package is loaded with `library`, you can use `data` to load into your workspace the data that ships with the library. Is that what you're asking? – Dominic Comtois Mar 19 '15 at 09:31
-
Maybe it's a possible solution, but a colleague of mine used a function Internal.R to load the data on attach as GlobalEnv and I was wondering how to do the same – Garini Mar 19 '15 at 17:07
1 Answers
0
Create a .RData
file using save
and put it in the /data/ folder of your package.
The in the DESCRIPTION file make sure it contains LazyData: true
so that the data doesn;t take any space until you request it.
Everything is also detailed on http://r-pkgs.had.co.nz/data.html

RockScience
- 17,932
- 26
- 89
- 125