n_density | R Documentation |
n_density
takes the n
most strongly correlated neighbors of a target vector and their correlation coefficients to calculate a mean correlation
coefficient. The higher the value of this coefficient, the denser the neighborhood.
n_density(vec, neighbors, n = 8)
vec |
The vector for which the neighbor density is to be calculated. This is either a vector saved as object or a row of the |
neighbors |
The potential neighbors, usually given as data frame or matrix. |
n |
The number of neighbors wanted as output. Defaults to |
D. Schmitz
### a vector saved as object & a matrix of neighbors vector <- runif(50, 0, 10) data("gdsm_mat") n_density(vec = vector, neighbors = gdsm_mat) n_density(vec = vector, neighbors = gdsm_mat, n = 4) ### a vector specified by its name & its matrix of neighbors data("gdsm_mat") n_density(vec = "var12", neighbors = gdsm_mat) n_density(vec = "var12", neighbors = gdsm_mat, n = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.