meanDistance {regioneR} | R Documentation

## Mean Distance

### Description

Computes the mean distance of regions in A to the nearest element in B

### Usage

    meanDistance(A, B, ...)

### Arguments

`A` | a region set in any of the accepted formats by `toGRanges` (`GenomicRanges`, `data.frame`, etc...)
`B` | a region set in any of the accepted formats by `toGRanges` (`GenomicRanges`, `data.frame`, etc...)
`...` | any additional parameter needed

### Value

The mean of the distances of each region in A to the nearest region in B.

### Note

If a region in A is in a chromosome where no B region is, it will be ignored and removed from the mean computation.

### Examples

    A <- data.frame("chr1", c(1, 10, 20, 30), c(12, 13, 28, 40))

    B <- data.frame("chr1", 25, 35)

    meanDistance(A, B)

[Package regioneR version 1.16.5 Index]