I'm trying to execute a pretty simple operation but I haven't figured it out. I'm trying to get the average interval length of all intervals in a particular BED file I have imported in R. This BED file contains no overlapping intervals. This is what the file looks like:
GRanges object with 12917252 ranges and 3 metadata columns:
seqnames ranges strand | name score thick
<Rle> <IRanges> <Rle> | <character> <numeric> <IRanges>
[1] chr1 [10524, 10551] + | 1:10524-10551 122 [10538, 10538]
[2] chr1 [11236, 11258] + | 1:11236-11258 43 [11247, 11247]
[3] chr1 [11456, 11474] + | 1:11456-11474 47 [11465, 11465]
[4] chr1 [12054, 12099] + | 1:12054-12099 206 [12077, 12077]
[5] chr1 [12276, 12330] + | 1:12276-12330 249 [12303, 12303]
Any operation would apply to the ranges
column