I'm currently creating an R package, and my scripts require before any analysis is done that 1-2 bed files be loaded. Normally, I would run the scripts with the following:
library(data.table) session_bed = read.table("/path/name/to/bedfile.bed")
and then refer to
session_bed throughout the analysis.
However, in order to release this as an R package, I believe that these files must be downloaded at the time on the package installation.
(1) Normally, how are bed files distributed in R packages? Are these gzipped? Where are they placed?
According to http://r-pkgs.had.co.nz/data.html, all .bed files should be
inst/extdata I guess. However, it's not clear to me how to "link" to this data within the R package.
How have other packages dealt with this? (Is there a size limit?)
(2) In this case, should the function loading the bed file be executed about loading the R library,
library(package_name)? Is there more appropriate option?