This helper function can be particularly useful for visualizing heatmap patterns of a numeric matrix with values that are extremely similar.

precise_features(data, outcome, method = "chi", trees = 500, runs = 50,
  cv = 1, repeats = 1, parallel = FALSE, verbose = FALSE)

Arguments

data

A square, numeric dataframe, matrix or tibble.

outcome

The value to replace the current diagonal with. Options include "min", "max", "mean", "median", "mode" and "geometric".

Value

A square, numeric matrix with new diagonal.

Details

Unless replace = "geometric", missing values will not be removed.

References

Muchmore, B., Muchmore P. and Alarcón-Riquelme ME. (2018). Optimal Distance Matrix Construction with PreciseDist and PreciseGraph.

Andrew Bray, Chester Ismay, Ben Baumer and Mine Cetinkaya-Rundel (2018). infer: Tidy Statistical Inference. R package version 0.1.1. https://CRAN.R-project.org/package=infer

Examples

test_matrix <- replicate(10, rnorm(10)) test_result_1 <- test_matrix %>% precise_diagonal()
#> Error in precise_diagonal(.): could not find function "precise_diagonal"
test_result_2 <- test_matrix %>% precise_diagonal(replace = "geometric")
#> Error in precise_diagonal(., replace = "geometric"): could not find function "precise_diagonal"
test_result_3 <- test_matrix %>% precise_diagonal(replace = 0)
#> Error in precise_diagonal(., replace = 0): could not find function "precise_diagonal"