How to release an R package with several bed files? 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?
You can store it in data/ subfolder. If one of your functions need this bed file, you can include importing it in your function.

Here are some examples how to get the data from data/ subfolder.

There are probably more ways to do this, this is just one way.