Skip to content

Commit

Permalink
remove unused code for lint checking in CI [ci skip]
Browse files Browse the repository at this point in the history
export all S3 internal functions, as recommended.
  • Loading branch information
Jack O. Wasey committed May 1, 2018
1 parent a0b40a0 commit eeef5f6
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 32 deletions.
14 changes: 14 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ S3method(expand_minor,icd9)
S3method(expand_range,character)
S3method(expand_range,icd10cm)
S3method(expand_range,icd9)
S3method(expand_range_major,default)
S3method(expand_range_major,icd10cm)
S3method(expand_range_major,icd9)
S3method(explain,default)
S3method(explain,icd10)
Expand All @@ -52,13 +54,21 @@ S3method(get_invalid,comorbidity_map)
S3method(get_invalid,default)
S3method(get_invalid,icd10)
S3method(get_invalid,icd9)
S3method(get_major,icd10)
S3method(get_major,icd9)
S3method(get_valid,character)
S3method(get_valid,icd10)
S3method(get_valid,icd10cm)
S3method(get_valid,icd9)
S3method(get_visit_name,data.frame)
S3method(get_visit_name,matrix)
S3method(guess_version,character)
S3method(guess_version,data.frame)
S3method(guess_version,factor)
S3method(guess_version,icd10)
S3method(guess_version,icd10cm)
S3method(guess_version,icd9)
S3method(guess_version,icd9cm)
S3method(is_billable,default)
S3method(is_billable,icd10)
S3method(is_billable,icd10cm)
Expand All @@ -68,6 +78,10 @@ S3method(is_defined,default)
S3method(is_defined,icd10)
S3method(is_defined,icd10cm)
S3method(is_defined,icd9)
S3method(is_major,default)
S3method(is_major,icd10)
S3method(is_major,icd10cm)
S3method(is_major,icd9)
S3method(is_valid,comorbidity_map)
S3method(is_valid,default)
S3method(is_valid,icd10)
Expand Down
1 change: 1 addition & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ icd9_decimal_to_short_cpp <- function(x) {
#' digits of numeric or V code, or first four digits of E code. This is the
#' part before the decimal, when a decimal point is used.
#' @keywords internal manip
#' @export
get_major.icd9 <- function(x, short_code) {
.Call(`_icd_icd9GetMajor`, x, short_code)
}
Expand Down
2 changes: 1 addition & 1 deletion R/comorbid.R
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ comorbid_quan_deyo <- function(x, ...)
icd10 = icd10_comorbid_quan_deyo), ...)

#' @describeIn comorbid Calculate comorbidities using Charlson categories
#' according to Quan/Deyo ICD categories. Synonymouse with
#' according to Quan/Deyo ICD categories. Synonymous with
#' \code{link{comorbid_quan_deyo}} in this release.
#' @export
comorbid_charlson <- function(...)
Expand Down
11 changes: 11 additions & 0 deletions R/guess.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,20 @@
guess_version <- function(x, short_code, ...)
UseMethod("guess_version")

#' @keywords internal
#' @export
guess_version.icd9 <- function(x, short_code, ...) "icd9" #nocov

#' @keywords internal
#' @export
guess_version.icd9cm <- function(x, short_code, ...) "icd9cm" #nocov

#' @keywords internal
#' @export
guess_version.icd10 <- function(x, short_code, ...) "icd10" #nocov

#' @keywords internal
#' @export
guess_version.icd10cm <- function(x, short_code, ...) "icd10cm" #nocov

#' @describeIn guess_version Guess version of ICD codes in a factor
Expand Down
2 changes: 2 additions & 0 deletions R/ranges.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ expand_range_major <- function(start, end) {
#' @describeIn expand_range_major Expand range of top-level, 'major' codes
#' of unknown type
#' @keywords internal
#' @export
expand_range_major.default <- function(start, end) {
icd_ver <- guess_pair_version(start, end, short_code = TRUE)
if (icd_ver == "icd9")
Expand All @@ -150,6 +151,7 @@ expand_range_major.default <- function(start, end) {

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

# codes may have alphabetic characters in 3rd position, so can't just do
Expand Down
4 changes: 4 additions & 0 deletions R/util.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ get_visit_name <- function(x, visit_name = NULL) {
.visit_name_guesses <- c("visit.?Id", "patcom", "encounter.?id", "enc.?id",
"in.*enc", "out.*enc", "encounter", "visit", "enc")

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

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

#' @keywords internal
#' @export
get_visit_name.matrix <- function(x, visit_name = NULL) {
stop("matrices of comorbidity data are expected to be of logical type, and have row names corresponding to the visit or patient.")
}
Expand Down
5 changes: 5 additions & 0 deletions R/valid.R
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ get_major <- function(x) {
#' can re-use C++ ICD-9 version: just grabbing the first three characters,
#' after all, and this is much easier in ICD-10 then ICD-9
#' @keywords internal
#' @export
get_major.icd10 <- function(x) {
substr(trim(x), 1L, 3L)
}
Expand All @@ -492,6 +493,7 @@ is_major <- function(x) {

#' @describeIn is_major Default method which guesses version
#' @keywords internal
#' @export
is_major.default <- function(x) {
switch(
guess_version(x),
Expand All @@ -505,6 +507,7 @@ is_major.default <- function(x) {

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

#' @describeIn is_major check whether a code is an ICD-9 major
#' @keywords internal
#' @export
is_major.icd9 <- function(x) {
x <- trim(x)
nchar(x) - icd9_is_e(x) < 4
Expand Down
2 changes: 0 additions & 2 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ release_questions <- function() {
"Does every file have correct licence information?",
"Is spelling correct everywhere? E.g. aspell_package_Rd_files('.')",
# code quality:
"Has the development branch been merged/rebased into master?",
"Are you happy with the code coverage?",
"Is every SEXP PROTECT()ed and UNPROTECT()ed, when appropriate?",
"Are all public S3 classes all exported? use devtools::missing_s3()",
Expand All @@ -76,7 +75,6 @@ release_questions <- function() {
"Have all unnecessary files been ignored in built archive? Especially
thinking of autoconfigure stuff. Look in the final built archive
before submitting to CRAN?",
"Has .*_alt\\.[Rr]$ been reactivated in .Rbuildignore?",
# not CRAN
"Are github pages site refreshed from latest documentation?",
NULL
Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ before_build:
- ls -aR
- rm .Rinstignore # do install everything for testing
- sed -i'' -e '/.*[Dd]ata.*/d' .Rbuildignore # do include data for testing, some data not in github though
- sed -i'' -e '/\.lintr/d' .Rbuildignore
- 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

build_script:
Expand Down
2 changes: 1 addition & 1 deletion man/comorbid.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ CV icd9DecimalToShort(
//' digits of numeric or V code, or first four digits of E code. This is the
//' part before the decimal, when a decimal point is used.
//' @keywords internal manip
//' @export
//[[Rcpp::export(name="get_major.icd9")]]
CV icd9GetMajor(const CV x, const bool short_code) {
if (short_code) {
Expand Down
27 changes: 0 additions & 27 deletions tests-deprecated/test-lints.R

This file was deleted.

0 comments on commit eeef5f6

Please sign in to comment.