Skip to content

Commit

Permalink
chore: response to CRAN checks
Browse files Browse the repository at this point in the history
  • Loading branch information
simpar1471 committed Nov 21, 2024
1 parent d43a03b commit f3949bc
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 25 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
^data-raw$
^vignettes/articles$
^cran-comments\.md$
^CRAN-SUBMISSION$
11 changes: 6 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
Type: Package
Package: matchedcc
Title: 'Stata'-Like Matched Case-Control Analysis
Version: 0.1.0
Version: 0.1.1
Date: 2024-11-19
Authors@R:
person(c("Simon", "R"), "Parker", email = "simon.parker24@ucl.ac.uk",
person(c("Simon", "R"), "Parker", email = "simon.parker.24@ucl.ac.uk",
role = c("aut", "cre", "cph"),
comment = c(ORCID = "0009-0003-8214-4496"))
Maintainer: Simon R Parker <simon.parker24@ucl.ac.uk>
Maintainer: Simon R Parker <simon.parker.24@ucl.ac.uk>
Description: Calculate multiple statistics with confidence intervals for matched
case-control data including risk difference, risk ratio, relative
difference, and the odds ratio. Results are equivalent to those from
'Stata', and you can choose how to format your input data.
'Stata', and you can choose how to format your input data. Methods used are
those described on page 56 the 'Stata' documentation for "Epitab - Tables
for Epidemologists" <https://www.stata.com/manuals/repitab.pdf>.
License: GPL (>= 3)
Encoding: UTF-8
RoxygenNote: 7.3.2
Expand All @@ -37,4 +39,3 @@ Suggests:
RStata
LazyData: true
Config/Needs/website: rmarkdown
VignetteBuilder: knitr
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# matchedcc 0.1.1

* CRAN resubmission.

# matchedcc 0.1.0

* Added `mcc()` and `mcci()`, which facilitate Stata-like analysis of matched
Expand Down
2 changes: 1 addition & 1 deletion R/data.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# matchedcc: Stata-like matched case-control analysis
# Copyright (C) 2024 Simon Parker
# Copyright (C) 2024 Simon Parker
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion R/mcc.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# matchedcc: Stata-like matched case-control analysis
# Copyright (C) 2024 Simon Parker
# Copyright (C) 2024 Simon Parker
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![R-CMD-check](https://github.com/simpar1471/matchedcc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/simpar1471/matchedcc/actions/workflows/R-CMD-check.yaml)
[![CRAN
status](https://www.r-pkg.org/badges/version/matchedcc)](https://CRAN.R-project.org/package=matchedcc)
[![codecov](https://codecov.io/gh/simpar1471/matchedcc/graph/badge.svg?token=OJSHMFFGXN)](https://codecov.io/gh/simpar1471/matchedcc)
[![codecov](https://codecov.io/gh/simpar1471/matchedcc/graph/badge.svg?token=OJSHMFFGXN)](https://app.codecov.io/gh/simpar1471/matchedcc)
<!-- badges: end -->

The aim of **matchedcc** is to provide epidemiologists using R with
Expand Down
8 changes: 8 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Resubmission
This is a resubmission. In this version I have:

* Added link to DESCRIPTION for a description of the implemented methods.
* Removed `installed.packages()` from code in `tests/testdata/run-stata-mcc.R`.
* Removed installation of 'RStata' package in `tests/testdata/run-stata-mcc.R`.


## R CMD check results

0 errors | 0 warnings | 1 note
Expand Down
32 changes: 15 additions & 17 deletions tests/testdata/run-stata-mcc.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@

# The code does NOT work unless being run in interactive mode, as
# `capture.output()` captures more than just the RStata call.

if (interactive()) {
if (!"RStata" %in% installed.packages()) {
devtools::install_cran("RStata")
}
try({
testthat::skip_if_not_installed("RStata")

options("RStata.StataPath" = "\"C:\\Program Files\\Stata18\\StataSE-64\"")
options("RStata.StataVersion" = 18)
options("RStata.StataPath" = "\"C:\\Program Files\\Stata18\\StataSE-64\"")
options("RStata.StataVersion" = 18)

n_commands <- 1000
commands <- withr::with_seed(2800, {
n_commands <- 1000
commands <- withr::with_seed(2800, {
idxs <- 1:4
samples_vec <- 1L:1000L
conf_level_vec <- seq(10, 99.99, 0.01)
Expand All @@ -25,14 +23,14 @@ if (interactive()) {
FUN.VALUE = integer(length = 1)
)
conf_level <- sample(conf_level_vec, size = 1, replace = FALSE)
glue::glue(
"mcci {paste(samples, collapse = \" \")}, level({conf_level})"
)
glue::glue("mcci {paste(samples, collapse = \" \")}, level({conf_level})")
})
})
})

stata_testers <- utils::capture.output(
RStata::stata(commands, stata.echo = TRUE)
)
readr::write_lines(stata_testers, file = "tests/testdata/stata-output.log")
}
stata_testers <- utils::capture.output(
RStata::stata(commands, stata.echo = TRUE)
)

readr::write_lines(stata_testers, file = "tests/testdata/stata-output.log")
})
}

0 comments on commit f3949bc

Please sign in to comment.