A <- data.frame("chr1", c(1, 10, 20, 30), c(12, 13, 28, 40))
positions <- sample(1:40,30)
x <- data.frame("chr1", positions, positions, rnorm(30,4,1))
meanInRegions(A, x)
x <- GRanges(seqnames=x[,1],ranges=IRanges(x[,2],end=x[,2]),mcols=x[,3])
meanInRegions(A, x)
Run the code above in your browser using DataLab