Skip to content
Prev 849 / 63424 Next

library/data

Official R speak actually is `package' for what you call `library'.
No.  You can have data of any kind ther.  However, currently data() only
works for R objects, i.e., files with R code and names ending in `.R'.
Within soon, this should be extended so that e.g. `.tab' is using for
tables (and we still have to determine how to treat headers ...).
No, they are not loaded automatically.  Currently, there is (still) no
way to attach a directory.  This will change eventually.

If you build a package for use with R and there is no reason to store
data in a specific format, you might as well try to dump() your object
and put the result of that into the data dir of the pkg (thus you'd have
sourceable R code etc.)  If you want to distribute something in some
other format, e.g. `file.of', then `file.R' should contain the R code
for reading the contents of `file.of' into R.
Not quite.  There is a function called system.file() which does
something similar:

R> system.file("R/base")
[1] "/usr/local/lib/R/library/base/R/base"
R> system.file("data/index.doc")
[1] "/usr/local/lib/R/library/base/data/index.doc"
[1] "/usr/local/lib/R/library/base/data/index.doc"

Would it be important to know the location of a package?

-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._