Skip to content

Commit

Permalink
General comments for review #27
Browse files Browse the repository at this point in the history
export corrplot and update readme
  • Loading branch information
PHS-Meantrix committed Jan 9, 2025
1 parent 5f54645 commit 2af1634
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ export(ptest)
export(sil_acca)
importFrom(Rcpp,evalCpp)
importFrom(RcppArmadillo,armadillo_version)
importFrom(corrplot,corrplot)
useDynLib(corrp, .registration=TRUE)
1 change: 1 addition & 0 deletions R/acca.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#' @useDynLib corrp, .registration=TRUE
#' @importFrom Rcpp evalCpp
#' @importFrom RcppArmadillo armadillo_version
#' @importFrom corrplot corrplot

#' @title Average correlation clustering algorithm
#'
Expand Down
2 changes: 1 addition & 1 deletion R/corr_matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#'
#' iris_cor <- corrp(iris)
#' iris_m <- corr_matrix(iris_cor, isig = FALSE)
#' corrplot::corrplot(iris_m)
#' corrplot(iris_m)
#' @export
corr_matrix <- function(c, ...) {
UseMethod("corr_matrix", c)
Expand Down
2 changes: 1 addition & 1 deletion R/corrp.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
#' @examples
#' iris_c <- corrp(iris)
#' iris_m <- corr_matrix(iris_c, isig = FALSE)
#' corrplot::corrplot(iris_m)
#' corrplot(iris_m)
#'
#'
#' @export
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ remotes::install_github("meantrix/corrp@main")
`corrp` Next, we calculate the correlations for the data set iris using: Maximal Information Coefficient for numeric pair, the Power Predictive Score algorithm for numeric/categorical pair and Uncertainty coefficient for categorical pair.

```r
results = corrp::corrp(iris, cor.nn = 'mic',cor.nc = 'pps',cor.cc = 'uncoef', n.cores = 2 , verbose = FALSE)
# coorp with using iris using parallel processing
results = corrp::corrp(iris, cor.nn = 'mic', cor.nc = 'pps',cor.cc = 'uncoef', n.cores = 2 , verbose = FALSE)
# an sequential example with different correlation pair types
results_2 = corrp::corrp(mtcars, cor.nn = 'pps', cor.nc = 'lm', cor.cc = 'cramersV', verbose = FALSE)

head(results$data)
# infer infer.value stat stat.value isig msg varx vary
Expand All @@ -76,6 +79,16 @@ head(results$data)
# Predictive Power Score 0.5591864 F1_weighted 0.7028029 TRUE Sepal.Length Species
# Maximal Information Coefficient 0.2770503 P-value 0.0000000 TRUE Sepal.Width Sepal.Length

head(results_2$data)

# infer infer.value stat stat.value isig msg varx vary
# Predictive Power Score 1.0000000 <NA> NA TRUE mpg mpg
# Predictive Power Score 0.3861810 MAE 0.8899206 TRUE mpg cyl
# Predictive Power Score 0.3141056 MAE 74.7816795 TRUE mpg disp
# Predictive Power Score 0.2311418 MAE 42.3961506 TRUE mpg hp
# Predictive Power Score 0.1646116 MAE 0.3992651 TRUE mpg drat
# Predictive Power Score 0.2075760 MAE 0.5768637 TRUE mpg wt

```

`corr_matrix` Using the previous result we can create a correlation matrix as follows:
Expand Down
2 changes: 1 addition & 1 deletion man/corr_matrix.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/corrp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2af1634

Please sign in to comment.