Description Usage Arguments Details Value See Also Examples

View source: R/sperrorest_misc.R

`dataset_distance`

calculates Euclidean nearest-neighbour distances
between two point datasets and summarizes these distances using some
function, by default the mean.

1 2 | ```
dataset_distance(d1, d2, x_name = "x", y_name = "y", fun = mean,
method = "euclidean", ...)
``` |

`d1` |
a |

`d2` |
see |

`x_name` |
name of column in |

`y_name` |
same for y coordinates |

`fun` |
function to be applied to the vector of nearest-neighbor
distances of |

`method` |
type of distance metric to be used; only |

`...` |
additional arguments to |

Nearest-neighbour distances are calculated for each point in
`d1`

, resulting in a vector of length `nrow(d1)`

, and `fun`

is applied to this vector.

depends on `fun`

; typically (e.g., `mean`

) a numeric vector
of length 1

add.distance

1 2 | ```
df <- data.frame(x = rnorm(100), y = rnorm(100))
dataset_distance(df, df) # == 0
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.