| Title: | Generalized Correlation and Related Measures |
|---|---|
| Description: | Generalized correlation and related measures for assessing nonlinear relationships between variables, including mixed-type data. For methodological background, see <https://r-suzuki.github.io/gcor/method.html>. |
| Authors: | Ryota Suzuki [aut, cre] |
| Maintainer: | Ryota Suzuki <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0.9000 |
| Built: | 2026-05-27 06:37:06 UTC |
| Source: | https://github.com/r-suzuki/gcor-r |
Estimate generalized correlation and related measures, which includes:
Generalized correlation measure (gcor)
Directed generalized correlation measure (dgcor)
Dissimilarity between variables (gdis)
gcor( x, y = NULL, data = NULL, dropNA = "none", k = NULL, max_levels = 100, simplify = TRUE ) dgcor( x, y = NULL, data = NULL, dropNA = "none", k = NULL, max_levels = 100, simplify = TRUE ) gdis(x, dropNA = "none", k = NULL, max_levels = 100, ...)gcor( x, y = NULL, data = NULL, dropNA = "none", k = NULL, max_levels = 100, simplify = TRUE ) dgcor( x, y = NULL, data = NULL, dropNA = "none", k = NULL, max_levels = 100, simplify = TRUE ) gdis(x, dropNA = "none", k = NULL, max_levels = 100, ...)
x |
a vector, matrix, data frame or formula. If formula, |
y |
|
data |
|
dropNA |
a character specifying how to handle missing values. It should be one of the following:
|
k |
|
max_levels |
an integer specifying the maximum number of levels allowed when converting non-numeric variables to factors. |
simplify |
a logical. If |
... |
additional arguments ( |
For gcor and dgcor, a numeric matrix is returned (or a vector if simplify = TRUE).
For gdis, an object of class "dist" is returned.
Suzuki, R. (2026). Method Overview of gcor. https://r-suzuki.github.io/gcor/method.html
# Generalized correlation measure gcor(iris) # Dependency of Species on other variables dgc <- dgcor(Species ~ ., data = iris) dotchart(sort(dgc), main = "Dependency of Species") # Clustering gd <- gdis(iris) hc <- hclust(gd, method = "ward.D2") plot(hc) # Multidimensional scaling mds <- cmdscale(gd, k = 2) plot(mds, type = "n", xlab = "", ylab = "", asp = 1, axes = FALSE, main = "cmdscale with gdis(iris)") text(mds[,1], mds[,2], rownames(mds))# Generalized correlation measure gcor(iris) # Dependency of Species on other variables dgc <- dgcor(Species ~ ., data = iris) dotchart(sort(dgc), main = "Dependency of Species") # Clustering gd <- gdis(iris) hc <- hclust(gd, method = "ward.D2") plot(hc) # Multidimensional scaling mds <- cmdscale(gd, k = 2) plot(mds, type = "n", xlab = "", ylab = "", asp = 1, axes = FALSE, main = "cmdscale with gdis(iris)") text(mds[,1], mds[,2], rownames(mds))