knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
R interface to the wdm C++ library, which provides efficient implementations of weighted dependence measures and related independence tests:
All measures are computed in O(n log n) time, where n is the number of observations.
For a detailed description of the functionality, see the API documentation.
install.packages("wdm")
# install.packages("devtools") install_submodule_git <- function(x, ...) { install_dir <- tempfile() system(paste("git clone --recursive", shQuote(x), shQuote(install_dir))) devtools::install(install_dir, ...) } install_submodule_git("https://github.com/tnagler/wdm-r")
This repo contains wdm as a submodule. For a full clone use
git clone --recurse-submodules <repo-address>
library(wdm)
x <- rnorm(100) y <- rpois(100, 1) # all but Hoeffding's D can handle ties w <- runif(100) wdm(x, y, method = "kendall") # unweighted wdm(x, y, method = "kendall", weights = w) # weighted
x <- matrix(rnorm(100 * 3), 100, 3) wdm(x, method = "spearman") # unweighted wdm(x, method = "spearman", weights = w) # weighted
x <- rnorm(100) y <- rpois(100, 1) # all but Hoeffding's D can handle ties w <- runif(100) indep_test(x, y, method = "kendall") # unweighted indep_test(x, y, method = "kendall", weights = w) # weighted
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.