-
Notifications
You must be signed in to change notification settings - Fork 1
/
RcppExports.R
70 lines (60 loc) · 2.5 KB
/
RcppExports.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
pairwiseComparisons <- function(entries, n_cores, include_self = FALSE) {
.Call('_ICIKendallTau_pairwiseComparisons', PACKAGE = 'ICIKendallTau', entries, n_cores, include_self)
}
sortedIndex <- function(x) {
.Call('_ICIKendallTau_sortedIndex', PACKAGE = 'ICIKendallTau', x)
}
compare_self <- function(x) {
.Call('_ICIKendallTau_compare_self', PACKAGE = 'ICIKendallTau', x)
}
compare_both <- function(x, y) {
.Call('_ICIKendallTau_compare_both', PACKAGE = 'ICIKendallTau', x, y)
}
which_notzero <- function(x) {
.Call('_ICIKendallTau_which_notzero', PACKAGE = 'ICIKendallTau', x)
}
kendall_discordant <- function(x, y) {
.Call('_ICIKendallTau_kendall_discordant', PACKAGE = 'ICIKendallTau', x, y)
}
count_rank_tie <- function(ranks) {
.Call('_ICIKendallTau_count_rank_tie', PACKAGE = 'ICIKendallTau', ranks)
}
#' Calculates ici-kendall-tau
#'
#' @param x numeric vector
#' @param y numeric vector
#' @param perspective should we consider the "local" or "global" perspective?
#' @param alternative what is the alternative for the p-value test?
#' @param continuity logical: if true, a continuity correction is used
#' @param output used to control reporting of values for debugging
#'
#' @details Calculates the information-content-informed Kendall-tau correlation measure.
#' This correlation is based on concordant and discordant ranked pairs, like Kendall-tau,
#' but also includes missing values (as NA). Missing values are assumed to be *primarily* due
#' to lack of detection due to instrumental sensitivity, and therefore encode *some* information.
#'
#' For more details see the ICI-Kendall-tau vignette:
#'
#' \code{browseVignettes("ICIKendallTau")}
#'
#' @examples
#' x = sort(rnorm(100))
#' y = x + 1
#' y2 = y
#' y2[1:10] = NA
#' ici_kt(x, y)
#' ici_kt(x, y2, "global")
#' ici_kt(x, y2)
#'
#' @importFrom Rcpp sourceCpp
#' @export
#' @useDynLib ICIKendallTau
#' @return kendall tau correlation, p-value, max-correlation
ici_kt <- function(x, y, perspective = "local", alternative = "two.sided", continuity = FALSE, output = "simple") {
.Call('_ICIKendallTau_ici_kt', PACKAGE = 'ICIKendallTau', x, y, perspective, alternative, continuity, output)
}
ici_kt_pairs <- function(x, y, perspective = "local", alternative = "two.sided", output = "simple") {
.Call('_ICIKendallTau_ici_kt_pairs', PACKAGE = 'ICIKendallTau', x, y, perspective, alternative, output)
}