Skip to content

Commit eeef5f6

Browse files
author
Jack O. Wasey
committed
remove unused code for lint checking in CI [ci skip]
export all S3 internal functions, as recommended.
1 parent a0b40a0 commit eeef5f6

File tree

12 files changed

+40
-32
lines changed

12 files changed

+40
-32
lines changed

NAMESPACE

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ S3method(expand_minor,icd9)
2929
S3method(expand_range,character)
3030
S3method(expand_range,icd10cm)
3131
S3method(expand_range,icd9)
32+
S3method(expand_range_major,default)
33+
S3method(expand_range_major,icd10cm)
3234
S3method(expand_range_major,icd9)
3335
S3method(explain,default)
3436
S3method(explain,icd10)
@@ -52,13 +54,21 @@ S3method(get_invalid,comorbidity_map)
5254
S3method(get_invalid,default)
5355
S3method(get_invalid,icd10)
5456
S3method(get_invalid,icd9)
57+
S3method(get_major,icd10)
58+
S3method(get_major,icd9)
5559
S3method(get_valid,character)
5660
S3method(get_valid,icd10)
5761
S3method(get_valid,icd10cm)
5862
S3method(get_valid,icd9)
63+
S3method(get_visit_name,data.frame)
64+
S3method(get_visit_name,matrix)
5965
S3method(guess_version,character)
6066
S3method(guess_version,data.frame)
6167
S3method(guess_version,factor)
68+
S3method(guess_version,icd10)
69+
S3method(guess_version,icd10cm)
70+
S3method(guess_version,icd9)
71+
S3method(guess_version,icd9cm)
6272
S3method(is_billable,default)
6373
S3method(is_billable,icd10)
6474
S3method(is_billable,icd10cm)
@@ -68,6 +78,10 @@ S3method(is_defined,default)
6878
S3method(is_defined,icd10)
6979
S3method(is_defined,icd10cm)
7080
S3method(is_defined,icd9)
81+
S3method(is_major,default)
82+
S3method(is_major,icd10)
83+
S3method(is_major,icd10cm)
84+
S3method(is_major,icd9)
7185
S3method(is_valid,comorbidity_map)
7286
S3method(is_valid,default)
7387
S3method(is_valid,icd10)

R/RcppExports.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ icd9_decimal_to_short_cpp <- function(x) {
237237
#' digits of numeric or V code, or first four digits of E code. This is the
238238
#' part before the decimal, when a decimal point is used.
239239
#' @keywords internal manip
240+
#' @export
240241
get_major.icd9 <- function(x, short_code) {
241242
.Call(`_icd_icd9GetMajor`, x, short_code)
242243
}

R/comorbid.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ comorbid_quan_deyo <- function(x, ...)
490490
icd10 = icd10_comorbid_quan_deyo), ...)
491491

492492
#' @describeIn comorbid Calculate comorbidities using Charlson categories
493-
#' according to Quan/Deyo ICD categories. Synonymouse with
493+
#' according to Quan/Deyo ICD categories. Synonymous with
494494
#' \code{link{comorbid_quan_deyo}} in this release.
495495
#' @export
496496
comorbid_charlson <- function(...)

R/guess.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,20 @@
3434
guess_version <- function(x, short_code, ...)
3535
UseMethod("guess_version")
3636

37+
#' @keywords internal
38+
#' @export
3739
guess_version.icd9 <- function(x, short_code, ...) "icd9" #nocov
40+
41+
#' @keywords internal
42+
#' @export
3843
guess_version.icd9cm <- function(x, short_code, ...) "icd9cm" #nocov
44+
45+
#' @keywords internal
46+
#' @export
3947
guess_version.icd10 <- function(x, short_code, ...) "icd10" #nocov
48+
49+
#' @keywords internal
50+
#' @export
4051
guess_version.icd10cm <- function(x, short_code, ...) "icd10cm" #nocov
4152

4253
#' @describeIn guess_version Guess version of ICD codes in a factor

R/ranges.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ expand_range_major <- function(start, end) {
140140
#' @describeIn expand_range_major Expand range of top-level, 'major' codes
141141
#' of unknown type
142142
#' @keywords internal
143+
#' @export
143144
expand_range_major.default <- function(start, end) {
144145
icd_ver <- guess_pair_version(start, end, short_code = TRUE)
145146
if (icd_ver == "icd9")
@@ -150,6 +151,7 @@ expand_range_major.default <- function(start, end) {
150151

151152
#' @describeIn expand_range_major Expand range of top-level ICD-10 codes
152153
#' @keywords internal
154+
#' @export
153155
expand_range_major.icd10cm <- function(start, end) {
154156

155157
# codes may have alphabetic characters in 3rd position, so can't just do

R/util.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ get_visit_name <- function(x, visit_name = NULL) {
201201
.visit_name_guesses <- c("visit.?Id", "patcom", "encounter.?id", "enc.?id",
202202
"in.*enc", "out.*enc", "encounter", "visit", "enc")
203203

204+
#' @keywords internal
205+
#' @export
204206
get_visit_name.data.frame <- function(x, visit_name = NULL) {
205207
assert_data_frame(x, min.cols = 1, col.names = "named")
206208

@@ -221,6 +223,8 @@ get_visit_name.data.frame <- function(x, visit_name = NULL) {
221223
visit_name
222224
}
223225

226+
#' @keywords internal
227+
#' @export
224228
get_visit_name.matrix <- function(x, visit_name = NULL) {
225229
stop("matrices of comorbidity data are expected to be of logical type, and have row names corresponding to the visit or patient.")
226230
}

R/valid.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ get_major <- function(x) {
479479
#' can re-use C++ ICD-9 version: just grabbing the first three characters,
480480
#' after all, and this is much easier in ICD-10 then ICD-9
481481
#' @keywords internal
482+
#' @export
482483
get_major.icd10 <- function(x) {
483484
substr(trim(x), 1L, 3L)
484485
}
@@ -492,6 +493,7 @@ is_major <- function(x) {
492493

493494
#' @describeIn is_major Default method which guesses version
494495
#' @keywords internal
496+
#' @export
495497
is_major.default <- function(x) {
496498
switch(
497499
guess_version(x),
@@ -505,6 +507,7 @@ is_major.default <- function(x) {
505507

506508
#' @describeIn is_major check whether a code is an ICD-10 major
507509
#' @keywords internal
510+
#' @export
508511
is_major.icd10 <- function(x) {
509512
assert_character(x)
510513
# if not know whether ICD-10-CM, then use broader definition
@@ -515,13 +518,15 @@ is_major.icd10 <- function(x) {
515518
#' Currently uses \code{stringr} which uses \code{stringi} which should be
516519
#' quite fast, but does suffer from handling Unicode, locales, etc.
517520
#' @keywords internal
521+
#' @export
518522
is_major.icd10cm <- function(x) {
519523
assert_character(x)
520524
grepl(re_just_ws(re_icd10cm_major), trim(x), perl = TRUE)
521525
}
522526

523527
#' @describeIn is_major check whether a code is an ICD-9 major
524528
#' @keywords internal
529+
#' @export
525530
is_major.icd9 <- function(x) {
526531
x <- trim(x)
527532
nchar(x) - icd9_is_e(x) < 4

R/zzz.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ release_questions <- function() {
5252
"Does every file have correct licence information?",
5353
"Is spelling correct everywhere? E.g. aspell_package_Rd_files('.')",
5454
# code quality:
55-
"Has the development branch been merged/rebased into master?",
5655
"Are you happy with the code coverage?",
5756
"Is every SEXP PROTECT()ed and UNPROTECT()ed, when appropriate?",
5857
"Are all public S3 classes all exported? use devtools::missing_s3()",
@@ -76,7 +75,6 @@ release_questions <- function() {
7675
"Have all unnecessary files been ignored in built archive? Especially
7776
thinking of autoconfigure stuff. Look in the final built archive
7877
before submitting to CRAN?",
79-
"Has .*_alt\\.[Rr]$ been reactivated in .Rbuildignore?",
8078
# not CRAN
8179
"Are github pages site refreshed from latest documentation?",
8280
NULL

appveyor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ before_build:
2323
- ls -aR
2424
- rm .Rinstignore # do install everything for testing
2525
- sed -i'' -e '/.*[Dd]ata.*/d' .Rbuildignore # do include data for testing, some data not in github though
26-
- sed -i'' -e '/\.lintr/d' .Rbuildignore
2726
- Rscript -e "install.packages('Rcpp', repos = 'https://cloud.r-project.org/'); Rcpp::compileAttributes()" # make sure Rcpp generated code is made, if not checked in to repo
2827

2928
build_script:

man/comorbid.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/convert.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ CV icd9DecimalToShort(
272272
//' digits of numeric or V code, or first four digits of E code. This is the
273273
//' part before the decimal, when a decimal point is used.
274274
//' @keywords internal manip
275+
//' @export
275276
//[[Rcpp::export(name="get_major.icd9")]]
276277
CV icd9GetMajor(const CV x, const bool short_code) {
277278
if (short_code) {

tests-deprecated/test-lints.R

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)