-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mayer79/release_candidate
release candidate ready
- Loading branch information
Showing
94 changed files
with
513 additions
and
2,517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
^\.Rproj\.user$ | ||
^LICENSE\.md$ | ||
^cran-comments\.md$ | ||
^doc$ | ||
^Meta$ | ||
^confintr\.Rproj$ | ||
^packaging.R$ | ||
[.]Rproj$ | ||
^backlog$ | ||
^cran-comments.md$ | ||
^logo.png$ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ | |
.Ruserdata | ||
doc | ||
Meta | ||
inst/doc | ||
/doc/ | ||
/Meta/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,37 @@ | ||
Type: Package | ||
Package: confintr | ||
Title: Confidence Intervals | ||
Version: 0.1.1 | ||
Date: 2020-06-29 | ||
Version: 0.1.2 | ||
Date: 2022-01-28 | ||
Authors@R: | ||
person(given = "Michael", | ||
family = "Mayer", | ||
role = c("aut", "cre"), | ||
email = "mayermichael79@gmail.com") | ||
Maintainer: Michael Mayer <mayermichael79@gmail.com> | ||
Description: Calculates classic and/or bootstrap confidence | ||
intervals for many parameters such as the population mean, variance, | ||
interquartile range (IQR), median absolute deviation (MAD), skewness, | ||
kurtosis, Cramer's V, odds ratio, R-squared, quantiles (incl. median), | ||
Description: Calculates classic and/or bootstrap confidence intervals for | ||
many parameters such as the population mean, variance, interquartile | ||
range (IQR), median absolute deviation (MAD), skewness, kurtosis, | ||
Cramer's V, odds ratio, R-squared, quantiles (incl. median), | ||
proportions, different types of correlation measures, difference in | ||
means, quantiles and medians. Many of the classic confidence intervals | ||
are described in Smithson, M. (2003, ISBN: 978-0761924999). Bootstrap | ||
confidence intervals are calculated with the R package 'boot'. Both | ||
one- and two-sided intervals are supported. | ||
License: GPL(>= 2) | ||
URL: https://github.com/mayer79/confintr | ||
BugReports: https://github.com/mayer79/confintr/issues | ||
License: GPL (>= 2) | ||
Depends: | ||
R (>= 3.1.0) | ||
VignetteBuilder: | ||
knitr | ||
Encoding: UTF-8 | ||
LazyData: true | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.1.0 | ||
Imports: | ||
stats, | ||
boot | ||
RoxygenNote: 7.1.1 | ||
URL: https://github.com/mayer79/confintr | ||
BugReports: https://github.com/mayer79/confintr/issues | ||
Suggests: | ||
knitr, | ||
rmarkdown, | ||
testthat | ||
knitr, | ||
testthat (>= 3.0.0) | ||
VignetteBuilder: knitr | ||
Config/testthat/edition: 3 | ||
Imports: | ||
boot, | ||
stats |
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
library(survival) | ||
n <- 100 | ||
y <- sample(0:1, n, T) | ||
x <- runif(n) | ||
S <- Surv(rexp(n), sample(0:1, n, TRUE, prob = c(0.1, 0.9))) | ||
|
||
conc_measure <- function(x, y, what = "AUC") { | ||
|
||
conc <- survival::concordance(y ~ x) | ||
|
||
if (what == "AUC") { | ||
stopifnot(all(y == 1 | y == 0)) | ||
out <- conc$concordance | ||
} else if (what == "SomersD") { | ||
out <- conc$concordance * 2 - 1 | ||
} else if (what == "HarrellsC") { | ||
stopifnot(is.Surv(y)) | ||
out <- conc$concordance | ||
} | ||
out | ||
} | ||
|
||
conc_measure(x, S, "HarrellsC") | ||
Hmisc::rcorr.cens(x, S) | ||
|
||
MetricsWeighted::AUC(y, x) | ||
|
||
# AUC: y binary and default timewt | ||
# Harrell's c-statistic: y survival | ||
# (Somers' d + 1) / 2: y continuous | ||
# var: somer / 4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
## Resubmission | ||
This is mainly a maintenance release: | ||
|
||
- Resubmission reason: forgot rmarkdown package in suggests. | ||
- removing testthat::context() | ||
- getting rid of CRAN note on LazyData | ||
- improving the way how the package itself is being generated. | ||
|
||
- Fixed wrong "VignetteIndexEntry". | ||
## Checks | ||
|
||
- Added confidence intervals for the odds ratio via stats::fisher.test. | ||
### Local check seems fine | ||
|
||
`devtools::check()` result: | ||
|
||
WARNING | ||
'qpdf' is needed for checks on size reduction of PDFs | ||
|
||
0 errors √ | 1 warning x | 0 notes √ | ||
|
||
### Online checks seem fine as well: | ||
|
||
- check_win_devel() | ||
- check_rhub() | ||
|
||
checking for detritus in the temp directory ... NOTE | ||
Found the following files/directories: | ||
'lastMiKTeXException' | ||
|
||
0 errors √ | 0 warnings √ | 1 note x |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,88 @@ | ||
#===================================================================================== | ||
# BUILD THE PACKAGE | ||
#===================================================================================== | ||
#============================================================================= | ||
# Put together the package | ||
#============================================================================= | ||
|
||
if (FALSE) { | ||
library(boot) | ||
lapply(list.files("R", full.names = TRUE), source) | ||
} | ||
# WORKFLOW: UPDATE EXISTING PACKAGE | ||
# 1) Modify package content and documentation. | ||
# 2) Increase package number in "use_description" below. | ||
# 3) Go through this script and carefully answer "no" if a "use_*" function | ||
# asks to overwrite the existing files. Or just skip that function call. | ||
|
||
library(usethis) | ||
library(devtools) | ||
|
||
# Create a new package | ||
dir.create(file.path("release")) | ||
pkg <- file.path("release", "confintr") | ||
|
||
create_package( | ||
pkg, | ||
# Sketch of description file | ||
use_description( | ||
fields = list( | ||
Title = "Confidence Intervals", | ||
Type = "Package", | ||
Version = "0.1.1", | ||
Version = "0.1.2", | ||
Date = Sys.Date(), | ||
Description = "Calculates classic and/or bootstrap confidence intervals for many parameters such as the population mean, variance, interquartile range (IQR), median absolute deviation (MAD), skewness, kurtosis, Cramer's V, odds ratio, R-squared, quantiles (incl. median), proportions, different types of correlation measures, difference in means, quantiles and medians. Many of the classic confidence intervals are described in Smithson, M. (2003, ISBN: 978-0761924999). Bootstrap confidence intervals are calculated with the R package 'boot'. Both one- and two-sided intervals are supported.", | ||
`Authors@R` = "person('Michael', 'Mayer', email = 'mayermichael79@gmail.com', role = c('aut', 'cre'))", | ||
URL = "https://github.com/mayer79/confintr", | ||
BugReports = "https://github.com/mayer79/confintr/issues", | ||
Depends = "R (>= 3.1.0)", | ||
VignetteBuilder = "knitr", | ||
License = "GPL(>= 2)", | ||
LazyData = NULL, | ||
Maintainer = "Michael Mayer <mayermichael79@gmail.com>"), | ||
open = FALSE) | ||
Maintainer = "Michael Mayer <mayermichael79@gmail.com>" | ||
), | ||
roxygen = TRUE | ||
) | ||
|
||
use_gpl_license(2) | ||
use_github_links() # use this if this project is on github | ||
|
||
file.copy(file.path(pkg, "DESCRIPTION"), to = getwd(), overwrite = TRUE) | ||
# Use package has no option to look for pkg, so we first copy description from pkg, modify it and move back | ||
# Your files that do not belong to the package itself (others are added by "use_* function") | ||
use_build_ignore(c("^packaging.R$", "[.]Rproj$", "^backlog$", | ||
"^cran-comments.md$", "^logo.png$"), escape = FALSE) | ||
|
||
# Required external packages | ||
use_package("stats", "Imports") | ||
use_package("boot", "Imports") | ||
use_package("knitr", "Suggests") | ||
use_package("rmarkdown", "Suggests") | ||
use_package("testthat", "Suggests") | ||
|
||
# Set up other files ------------------------------------------------- | ||
# use_readme_md() | ||
# use_news_md() | ||
# use_cran_comments() | ||
# use_testthat() | ||
|
||
# Copy readme etc. | ||
file.copy(c("NEWS.md", "README.md", "cran-comments.md", "DESCRIPTION", ".Rbuildignore"), | ||
pkg, overwrite = TRUE) | ||
|
||
# Copy R scripts and document them | ||
if (!dir.exists(file.path(pkg, "R"))) { | ||
dir.create(file.path(pkg, "R")) | ||
} | ||
file.copy(list.files("R", full.names = TRUE), file.path(pkg, "R"), overwrite = TRUE) | ||
devtools::document(pkg) | ||
|
||
# Tests | ||
if (!dir.exists(file.path(pkg, "tests"))) { | ||
dir.create(file.path(pkg, "tests")) | ||
} | ||
file.copy("tests", pkg, recursive = TRUE) | ||
# test(pkg) | ||
# If your code uses the pipe operator %>% | ||
# use_pipe() | ||
|
||
# If your package contains data. Google how to document | ||
# use_data() | ||
|
||
# Add short docu in Markdown (without running R code) | ||
use_readme_md() | ||
|
||
# Longer docu in RMarkdown (with running R code). Often quite similar to readme. | ||
use_vignette("confintr") | ||
|
||
# If you want to add unit tests | ||
use_testthat() | ||
# use_test("test-cor.R") | ||
|
||
# On top of NEWS.md, describe changes made to the package | ||
use_news_md() | ||
|
||
# Add logo | ||
use_logo("logo.png") | ||
dir.create(file.path(pkg, "man", "figures")) | ||
file.copy(file.path("man", "figures", "logo.png"), | ||
file.path(pkg, "man", "figures", "logo.png")) | ||
|
||
if (TRUE) { | ||
# Copy vignette | ||
# use_vignette(name = "confintr", title = "confintr") | ||
dir.create(file.path(pkg, "vignettes")) | ||
dir.create(file.path(pkg, "doc")) | ||
dir.create(file.path(pkg, "Meta")) | ||
file.copy(list.files("vignettes", full.names = TRUE), | ||
file.path(pkg, "vignettes"), overwrite = TRUE) | ||
|
||
devtools::build_vignettes(pkg) | ||
} | ||
|
||
# Check | ||
check(pkg, manual = TRUE) | ||
# If package goes to CRAN: infos (check results etc.) for CRAN | ||
use_cran_comments() | ||
|
||
# Create | ||
build(pkg) | ||
|
||
# Install | ||
install(pkg) | ||
#============================================================================= | ||
# Finish package building (can use fresh session) | ||
#============================================================================= | ||
|
||
check_win_devel(pkg) | ||
library(devtools) | ||
|
||
document() | ||
test() | ||
build_vignettes() | ||
check(manual = TRUE, cran = TRUE) | ||
build() | ||
# build(binary = TRUE) | ||
install() | ||
|
||
check_rhub(pkg) | ||
# Run only if package is public(!) and should go to CRAN | ||
if (FALSE) { | ||
check_win_devel() | ||
check_rhub() | ||
|
||
devtools::release(pkg) | ||
# Wait until above checks are passed without relevant notes/warnings | ||
# then submit to CRAN | ||
release() | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.