Skip to content

Commit a545ebb

Browse files
authored
Merge pull request #7 from abichat/dev
v0.1.0
2 parents 2322cbb + 0c77e0c commit a545ebb

File tree

13 files changed

+102
-133
lines changed

13 files changed

+102
-133
lines changed
Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
2-
push:
3-
branches:
4-
- dev
54
pull_request:
65
branches:
76
- dev
@@ -10,16 +9,20 @@ name: R-CMD-check-dev
109

1110
jobs:
1211
R-CMD-check:
13-
if: "!contains(github.event.head_commit.message, 'skip ci')"
14-
runs-on: macOS-latest
12+
runs-on: ubuntu-latest
13+
env:
14+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
15+
R_KEEP_PKG_SOURCE: yes
1516
steps:
1617
- uses: actions/checkout@v2
17-
- uses: r-lib/actions/setup-r@master
18-
- name: Install dependencies
19-
run: |
20-
install.packages(c("remotes", "rcmdcheck"))
21-
remotes::install_deps(dependencies = TRUE)
22-
shell: Rscript {0}
23-
- name: Check
24-
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
25-
shell: Rscript {0}
18+
19+
- uses: r-lib/actions/setup-r@v2
20+
with:
21+
use-public-rspm: true
22+
23+
- uses: r-lib/actions/setup-r-dependencies@v2
24+
with:
25+
extra-packages: any::rcmdcheck
26+
needs: check
27+
28+
- uses: r-lib/actions/check-r-package@v2

.github/workflows/R-CMD-check.yaml

Lines changed: 19 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
35
branches:
46
- master
5-
pull_request:
6-
branches:
7-
- master
7+
- dev
88

99
name: R-CMD-check
1010

1111
jobs:
1212
R-CMD-check:
13-
if: "!contains(github.event.head_commit.message, 'skip ci')"
1413
runs-on: ${{ matrix.config.os }}
1514

1615
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
@@ -19,63 +18,32 @@ jobs:
1918
fail-fast: false
2019
matrix:
2120
config:
21+
- {os: macOS-latest, r: 'release'}
2222
- {os: windows-latest, r: 'release'}
23-
- {os: macOS-latest, r: 'release'}
24-
- {os: macOS-latest, r: 'devel'}
25-
- {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
23+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
24+
- {os: ubuntu-latest, r: 'release'}
25+
- {os: ubuntu-latest, r: 'oldrel-1'}
2626

2727
env:
28-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
29-
RSPM: ${{ matrix.config.rspm }}
28+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
29+
R_KEEP_PKG_SOURCE: yes
3030

3131
steps:
3232
- uses: actions/checkout@v2
3333

34-
- uses: r-lib/actions/setup-r@master
34+
- uses: r-lib/actions/setup-pandoc@v2
35+
36+
- uses: r-lib/actions/setup-r@v2
3537
with:
3638
r-version: ${{ matrix.config.r }}
39+
http-user-agent: ${{ matrix.config.http-user-agent }}
40+
use-public-rspm: true
3741

38-
- uses: r-lib/actions/setup-pandoc@master
39-
40-
- name: Query dependencies
41-
run: |
42-
install.packages('remotes')
43-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
44-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
45-
shell: Rscript {0}
46-
47-
- name: Cache R packages
48-
if: runner.os != 'Windows'
49-
uses: actions/cache@v1
42+
- uses: r-lib/actions/setup-r-dependencies@v2
5043
with:
51-
path: ${{ env.R_LIBS_USER }}
52-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
53-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
54-
55-
- name: Install system dependencies
56-
if: runner.os == 'Linux'
57-
env:
58-
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
59-
run: |
60-
Rscript -e "remotes::install_github('r-hub/sysreqs')"
61-
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
62-
sudo -s eval "$sysreqs"
63-
64-
- name: Install dependencies
65-
run: |
66-
remotes::install_deps(dependencies = TRUE)
67-
remotes::install_cran("rcmdcheck")
68-
shell: Rscript {0}
69-
70-
- name: Check
71-
env:
72-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
73-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
74-
shell: Rscript {0}
44+
extra-packages: any::rcmdcheck
45+
needs: check
7546

76-
- name: Upload check results
77-
if: failure()
78-
uses: actions/upload-artifact@master
47+
- uses: r-lib/actions/check-r-package@v2
7948
with:
80-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
81-
path: check
49+
upload-snapshots: true

.github/workflows/pkgdown.yaml

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,46 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
35
branches: master
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
411

512
name: pkgdown
613

714
jobs:
815
pkgdown:
9-
runs-on: macOS-latest
16+
runs-on: ubuntu-latest
17+
# Only restrict concurrency for non-PR jobs
18+
concurrency:
19+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
20+
env:
21+
GITHUB_PAT: ${{ secrets.GH_TOKEN }}
1022
steps:
1123
- uses: actions/checkout@v2
1224

13-
- uses: r-lib/actions/setup-r@master
25+
- uses: r-lib/actions/setup-pandoc@v2
1426

15-
- uses: r-lib/actions/setup-pandoc@master
16-
17-
- name: Query dependencies
18-
run: |
19-
install.packages('remotes')
20-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
21-
shell: Rscript {0}
27+
- uses: r-lib/actions/setup-r@v2
28+
with:
29+
use-public-rspm: true
2230

23-
- name: Cache R packages
24-
uses: actions/cache@v1
31+
- uses: r-lib/actions/setup-r-dependencies@v2
2532
with:
26-
path: ${{ env.R_LIBS_USER }}
27-
key: macOS-r-3.6-${{ hashFiles('depends.Rds') }}
28-
restore-keys: macOS-r-3.6-
33+
extra-packages: any::pkgdown, local::.
34+
needs: website
2935

30-
- name: Install dependencies
31-
run: |
32-
install.packages("remotes")
33-
remotes::install_deps(dependencies = TRUE)
34-
remotes::install_dev("pkgdown")
36+
- name: Build site
37+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
3538
shell: Rscript {0}
3639

37-
- name: Install package
38-
run: R CMD INSTALL .
39-
40-
- name: Deploy package
41-
run: pkgdown::deploy_to_branch(new_process = FALSE)
42-
shell: Rscript {0}
40+
- name: Deploy to GitHub pages 🚀
41+
if: github.event_name != 'pull_request'
42+
uses: JamesIves/[email protected]
43+
with:
44+
clean: false
45+
branch: gh-pages
46+
folder: docs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.Rhistory
22
.RData
33
.Rproj.user
4+
.DS_Store

DESCRIPTION

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
Package: evabic
22
Title: Evaluation of Binary Classifiers
3-
Version: 0.0.4
3+
Version: 0.1.0
44
Authors@R:
5-
person(given = "Antoine",
6-
family = "Bichat",
7-
role = c("aut", "cre"),
8-
email = "[email protected]",
5+
person("Antoine", "Bichat", , "[email protected]", role = c("aut", "cre"),
96
comment = c(ORCID = "0000-0001-6599-7081"))
10-
Description: Evaluates the performance of binary classifiers.
11-
Computes confusion measures (TP, TN, FP, FN), derived measures (TPR,
12-
FDR, accuracy, F1, DOR, ..), and area under the curve. Outputs are
13-
well suited for nested dataframes.
7+
Description: Evaluates the performance of binary classifiers. Computes
8+
confusion measures (TP, TN, FP, FN), derived measures (TPR, FDR,
9+
accuracy, F1, DOR, ..), and area under the curve. Outputs are well
10+
suited for nested dataframes.
1411
License: GPL-3
15-
URL: https://abichat.github.io/evabic,
16-
https://github.com/abichat/evabic
12+
URL: https://abichat.github.io/evabic, https://github.com/abichat/evabic
1713
BugReports: https://github.com/abichat/evabic/issues
1814
Suggests:
1915
testthat (>= 2.1.0)
2016
Encoding: UTF-8
2117
Language: en-US
22-
LazyData: true
2318
Roxygen: list(markdown = TRUE)
24-
RoxygenNote: 7.1.0
19+
RoxygenNote: 7.2.1

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# evabic 0.1.0
2+
3+
* Doc update to fix HTML5 issues for CRAN check.
4+
5+
* Considered as stable.
6+
17
# evabic 0.0.4
28

39
* Clear error message when using `nl2c()` with a unnamed logical vector.

R/measures.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#' Available measures in \code{evabic}
44
#'
55
#' @details
6-
#' \if{html}{\figure{confusionmatrix.png}{options: width="50\%" align="middle"}}
6+
#' \if{html}{\figure{confusionmatrix.png}{options: width="50\%"
7+
#' style="float:middle"}}
78
#' \if{latex}{\figure{confusionmatrix.png}{options: width=15cm}}
89
#' \describe{
910
#' \item{TP}{True Positive}

README.Rmd

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ knitr::opts_chunk$set(
1313
)
1414
```
1515

16-
# evabic <a href='https://abichat.github.io/evabic'><img src='man/figures/logo.png' align="right" height="139" /></a>
16+
# evabic <a href='https://abichat.github.io/evabic'><img src='man/figures/logo.png' style="float:right" height="139" /></a>
1717

1818
```{r, echo = FALSE}
1919
version <- as.vector(read.dcf('DESCRIPTION')[, 'Version'])
@@ -22,12 +22,10 @@ version <- gsub('-', '.', version)
2222

2323
<!-- badges: start -->
2424
[![license](https://img.shields.io/badge/license-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
25-
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
25+
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
2626
[![packageversion](https://img.shields.io/badge/package%20version-`r version`-orange.svg)](https://github.com/abichat/evabic/blob/master/DESCRIPTION)
2727
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/evabic)](https://cran.r-project.org/package=evabic)
28-
[![Codecov test coverage](https://codecov.io/gh/abichat/evabic/branch/master/graph/badge.svg)](https://codecov.io/gh/abichat/evabic?branch=master)
29-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c32dcc4c1c3f40a5950e1c10ea6dfb18)](https://www.codacy.com/app/abichat/evabic?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=abichat/evabic&amp;utm_campaign=Badge_Grade)
30-
[![R build status](https://github.com/abichat/evabic/workflows/R-CMD-check/badge.svg)](https://github.com/abichat/evabic/actions)
28+
[![R-CMD-check](https://github.com/abichat/evabic/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/abichat/evabic/actions/workflows/R-CMD-check.yaml)
3129
[![Documentation](https://img.shields.io/badge/documentation-pkgdown-E91E63.svg)](https://abichat.github.io/evabic/)
3230
[![last-commit](https://img.shields.io/github/last-commit/abichat/evabic.svg)](https://github.com/abichat/evabic/commits/master)
3331
<!-- badges: end -->

README.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11

22
<!-- README.md is generated from README.Rmd. Please edit that file -->
33

4-
# evabic <a href='https://abichat.github.io/evabic'><img src='man/figures/logo.png' align="right" height="139" /></a>
4+
# evabic <a href='https://abichat.github.io/evabic'><img src='man/figures/logo.png' style="float:right" height="139" /></a>
55

66
<!-- badges: start -->
77

88
[![license](https://img.shields.io/badge/license-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
9-
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
10-
[![packageversion](https://img.shields.io/badge/package%20version-0.0.4-orange.svg)](https://github.com/abichat/evabic/blob/master/DESCRIPTION)
11-
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/evabic)](https://cran.r-project.org/package=evabic)
12-
[![Codecov test
13-
coverage](https://codecov.io/gh/abichat/evabic/branch/master/graph/badge.svg)](https://codecov.io/gh/abichat/evabic?branch=master)
14-
[![Codacy
15-
Badge](https://api.codacy.com/project/badge/Grade/c32dcc4c1c3f40a5950e1c10ea6dfb18)](https://www.codacy.com/app/abichat/evabic?utm_source=github.com&utm_medium=referral&utm_content=abichat/evabic&utm_campaign=Badge_Grade)
16-
[![R build
17-
status](https://github.com/abichat/evabic/workflows/R-CMD-check/badge.svg)](https://github.com/abichat/evabic/actions)
9+
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
10+
[![packageversion](https://img.shields.io/badge/package%20version-0.1.0-orange.svg)](https://github.com/abichat/evabic/blob/master/DESCRIPTION)
11+
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/evabic)](https://cran.r-project.org/package=evabic)
12+
[![R-CMD-check](https://github.com/abichat/evabic/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/abichat/evabic/actions/workflows/R-CMD-check.yaml)
1813
[![Documentation](https://img.shields.io/badge/documentation-pkgdown-E91E63.svg)](https://abichat.github.io/evabic/)
1914
[![last-commit](https://img.shields.io/github/last-commit/abichat/evabic.svg)](https://github.com/abichat/evabic/commits/master)
2015
<!-- badges: end -->
@@ -44,16 +39,14 @@ False Discovery Rate, Accuracy, F1…
4439

4540
``` r
4641
evabic::ebc_allmeasures
47-
#> [1] "TP" "FP" "FN" "TN" "TPR" "TNR" "PPV" "NPV" "FNR" "FPR" "FDR" "FOR"
48-
#> [13] "ACC" "BACC" "F1" "PLR" "NLR" "DOR"
42+
#> [1] "TP" "FP" "FN" "TN" "TPR" "TNR" "PPV" "NPV" "FNR" "FPR" "FDR"
43+
#> [12] "FOR" "ACC" "BACC" "F1" "PLR" "NLR" "DOR"
4944
```
5045

5146
All measures are computed from the confusion matrix:
5247

5348
<center>
54-
5549
<img src="man/figures/confusionmatrix.png" width="50%"/>
56-
5750
</center>
5851

5952
## Example
@@ -116,8 +109,10 @@ summary(model)
116109
#> F-statistic: 69.99 on 7 and 42 DF, p-value: < 2.2e-16
117110
pvalues <- summary(model)$coefficients[-1, 4]
118111
pvalues
119-
#> X1 X2 X3 X4 X5 X6 X7
120-
#> 0.004366456 0.829771754 0.003469737 0.491828466 0.581608670 0.887948400 0.449664443
112+
#> X1 X2 X3 X4 X5 X6
113+
#> 0.004366456 0.829771754 0.003469737 0.491828466 0.581608670 0.887948400
114+
#> X7
115+
#> 0.449664443
121116
detected_var <- names(pvalues[pvalues < 0.05])
122117
detected_var
123118
#> [1] "X1" "X3"
@@ -161,8 +156,7 @@ ebc_tidy(detected = pvalues < 0.05, true = predictors, m = 7,
161156

162157
With `ebc_tidy_by_threshold()`, you can ask for the evolution of
163158
measures according to a moving threshold if you provide the vector of
164-
p-values (or any
165-
score).
159+
p-values (or any score).
166160

167161
``` r
168162
df_measures <- ebc_tidy_by_threshold(detection_values = pvalues, true = predictors, m = 7,
@@ -179,8 +173,7 @@ df_measures
179173
#> 8 Inf 1.0000000 1.00 0.5714286 0.4285714 0.5000000 0.6000000
180174
```
181175

182-
This makes it easy to plot various-threshold curves like ROC
183-
curve.
176+
This makes it easy to plot various-threshold curves like ROC curve.
184177

185178
``` r
186179
plot(df_measures$FPR, df_measures$TPR, type = "b", xlab = "FPR", ylab = "TPR")

dev_history.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ library(testthat)
4747
load_all()
4848

4949
document()
50-
attachment::att_to_description()
50+
attachment::att_amend_desc()
5151
use_tidy_description()
5252

5353
# covr::package_coverage()

0 commit comments

Comments
 (0)