Compute average values of a variable according to neighborhoods.

meanNeighbors(x, y, ...)

Arguments

x

Object of class "neighborhood".

y

Vector of numeric values.

...

Not used.

See also

Author

Thomas Alexander Gerds <tag@biostat.ku.dk>

Examples


meanNeighbors(x=1:10,y=c(1,10,100,1000,1001,1001,1001,1002,1002,1002))
#>    uniqueX  averageY
#> 1        1  277.7500
#> 2        2  422.4000
#> 3        3  518.8333
#> 4        4  587.7143
#> 5        5  730.7143
#> 6        6  872.4286
#> 7        7 1001.2857
#> 8        8 1001.5000
#> 9        9 1001.6000
#> 10      10 1001.7500