From 49a3368c497e6b0e0ae143ae6f4f1aaa408d5752 Mon Sep 17 00:00:00 2001 From: Nikolai Sellereite Date: Fri, 12 Apr 2019 15:07:28 +0200 Subject: [PATCH] Adds covr (#46) --- .circleci/config.yml | 5 ++++- .covrignore | 2 ++ DESCRIPTION | 3 ++- src/distance.cpp | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .covrignore diff --git a/.circleci/config.yml b/.circleci/config.yml index 4e32678dd..3307c7dff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,7 +41,10 @@ jobs: name: Move files command: mv ${RCHECK_DIR} /tmp/Rcheck when: always - + - run: + name: Code coverage + when: on_success + command: R -e 'covr::package_coverage()' - store_test_results: path: /tmp/Rcheck/tests/ when: always diff --git a/.covrignore b/.covrignore new file mode 100644 index 000000000..e1de100b7 --- /dev/null +++ b/.covrignore @@ -0,0 +1,2 @@ +R/global.R +R/zzz.R diff --git a/DESCRIPTION b/DESCRIPTION index 88ddabc03..4f6fc8797 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,7 +34,8 @@ Suggests: ranger, xgboost, testthat, - lintr + lintr, + covr LinkingTo: RcppArmadillo, Rcpp diff --git a/src/distance.cpp b/src/distance.cpp index 13d9e071f..1efc3bb82 100644 --- a/src/distance.cpp +++ b/src/distance.cpp @@ -8,7 +8,7 @@ using namespace Rcpp; //' Used to get the Euclidean distance as well by setting \code{mcov} = \code{diag(m)}. //' //' @param featureList List of vectors indicating all factor combinations that should be included in the computations. Assumes that the first one is empty. -//' @param mcov Matrix. The Sigma-matrix in the Mahalanobis distance formula (\code{cov(Xtrain_mat)}) gives Mahalanobis distance, +//' @param mcov Matrix. The Sigma-matrix in the Mahalanobis distance formula (\code{stats::cov(Xtrain_mat)}) gives Mahalanobis distance, //' \code{diag(m)} gives the Euclidean distance. //' @param S_scale_dist Logical indicating //'