Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include examples in r check #228

Merged
merged 6 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: CodelistGenerator
Title: Identify Relevant Clinical Codes and Evaluate Their Use
Version: 3.2.0.900
Version: 3.2.1
Authors@R: c(
person("Edward", "Burn", email = "[email protected]",
role = c("aut", "cre"),
Expand Down
2 changes: 1 addition & 1 deletion R/codesFromConceptSet.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef("database")
#' x <- codesFromConceptSet(cdm = cdm,
#' path = system.file(package = "CodelistGenerator",
Expand Down
8 changes: 4 additions & 4 deletions R/codesInUse.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef("database")
#' codes <- getCandidateCodes(cdm = cdm,
#' keywords = "arthritis",
Expand Down Expand Up @@ -96,7 +96,7 @@ subsetToCodesInUse <- function(x,
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef("database")
#' codes <- getCandidateCodes(cdm = cdm,
#' keywords = "arthritis",
Expand Down Expand Up @@ -141,7 +141,7 @@ restrictToCodesInUse <- function(x,
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef("database")
#' x <- codesInUse(cdm = cdm)
#' x
Expand Down Expand Up @@ -175,7 +175,7 @@ codesInUse <- function(cdm,
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef("database")
#' x <- sourceCodesInUse(cdm = cdm)
#' x
Expand Down
3 changes: 1 addition & 2 deletions R/compareCodelists.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' codes1 <- getCandidateCodes(
#' cdm = cdm,
Expand All @@ -42,7 +42,6 @@
#' codelist1 = codes1,
#' codelist2 = codes2
#' )
#' CDMConnector::cdmDisconnect(cdm)
#' }
compareCodelists <- function(codelist1,
codelist2) {
Expand Down
8 changes: 3 additions & 5 deletions R/drugCodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' getATCCodes(cdm = cdm, level = "ATC 1st")
#' CDMConnector::cdmDisconnect(cdm)
#' }
getATCCodes <- function(cdm,
level = c("ATC 1st"),
Expand Down Expand Up @@ -192,7 +191,7 @@ getATCCodes <- function(cdm,
#' "codeine"), would result in a list of length two with the descendant
#' concepts for these two particular drug ingredients.
#' @param nameStyle Name style to apply to returned list. Can be one of
#' "{concept_code}_{concept_name}", "{concept_code}", or "{concept_name}".
#' `"{concept_code}_{concept_name}"`, `"{concept_code}"`, or `"{concept_name}"`.
#' @param doseForm Only descendants codes with the specified dose form
#' will be returned. If NULL, descendant codes will be returned regardless
#' of dose form.
Expand All @@ -214,11 +213,10 @@ getATCCodes <- function(cdm,
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' getDrugIngredientCodes(cdm = cdm, name = "Adalimumab",
#' nameStyle = "{concept_name}")
#' CDMConnector::cdmDisconnect(cdm)
#'}
getDrugIngredientCodes <- function(cdm,
name = NULL,
Expand Down
3 changes: 1 addition & 2 deletions R/getCandidateCodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- CodelistGenerator::mockVocabRef()
#' CodelistGenerator::getCandidateCodes(
#' cdm = cdm,
#' keywords = "osteoarthritis"
#' )
#' CDMConnector::cdmDisconnect(cdm)
#' }
getCandidateCodes <- function(cdm,
keywords,
Expand Down
3 changes: 1 addition & 2 deletions R/getICD10StandardCodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' getICD10StandardCodes(cdm = cdm, level = c(
#' "ICD10 Chapter",
#' "ICD10 SubChapter"
#' ))
#' CDMConnector::cdmDisconnect(cdm)
#' }
getICD10StandardCodes <- function(cdm,
level = c(
Expand Down
3 changes: 1 addition & 2 deletions R/getMappings.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- CodelistGenerator::mockVocabRef()
#' codes <- CodelistGenerator::getCandidateCodes(
#' cdm = cdm,
Expand All @@ -36,7 +36,6 @@
#' candidateCodelist = codes,
#' nonStandardVocabularies = "READ"
#')
#'CDMConnector::cdmDisconnect(cdm)
#'}
getMappings <- function(candidateCodelist,
cdm = NULL,
Expand Down
6 changes: 3 additions & 3 deletions R/helperFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' availableIngredients(cdm)
#'}
Expand Down Expand Up @@ -53,7 +53,7 @@ availableIngredients <- function(cdm) {
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' availableATC(cdm)
#'}
Expand Down Expand Up @@ -97,7 +97,7 @@ availableATC <- function(cdm,
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' availableICD10(cdm)
#'}
Expand Down
3 changes: 1 addition & 2 deletions R/mockVocabRef.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' cdm
#' CDMConnector::cdmDisconnect(cdm)
#' }
mockVocabRef <- function(backend = "data_frame") {
errorMessage <- checkmate::makeAssertCollection()
Expand Down
2 changes: 1 addition & 1 deletion R/summariseAchillesCodeUse.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef("database")
#' oa <- getCandidateCodes(cdm = cdm, keywords = "osteoarthritis")
#' result_achilles <- summariseAchillesCodeUse(list(oa = oa$concept_id), cdm = cdm)
Expand Down
2 changes: 1 addition & 1 deletion R/summariseOrphanCodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef("database")
#' codes <- getCandidateCodes(cdm = cdm,
#' keywords = "Musculoskeletal disorder",
Expand Down
12 changes: 3 additions & 9 deletions R/tableAchillesCodeUse.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef("database")
#' oa <- getCandidateCodes(cdm = cdm, keywords = "osteoarthritis")
#' result_achilles <- summariseAchillesCodeUse(list(oa = oa$concept_id), cdm = cdm)
Expand Down Expand Up @@ -137,21 +137,15 @@ tableAchillesCodeUse <- function(result,
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef("database")
#' codes <- getCandidateCodes(cdm = cdm,
#' keywords = "Musculoskeletal disorder",
#' domains = "Condition",
#' includeDescendants = FALSE)
#'
#' orphan_codes <- summariseOrphanCodes(x = list("msk" = codes$concept_id),
#' cdm = cdm,
#' domains = "Condition",
#' standardConcept = "Standard",
#' searchInSynonyms = FALSE,
#' searchNonStandard = FALSE,
#' includeDescendants = TRUE,
#' includeAncestor = FALSE)
#' cdm = cdm)
#'
#' tableOrphanCodes(orphan_codes)
#'
Expand Down
21 changes: 7 additions & 14 deletions R/vocabUtilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' getVocabVersion(cdm = cdm)
#' CDMConnector::cdmDisconnect(cdm)
#' }
getVocabVersion <- function(cdm) {
errorMessage <- checkmate::makeAssertCollection()
Expand Down Expand Up @@ -59,10 +58,9 @@ getVocabVersion <- function(cdm) {
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' getDomains(cdm = cdm)
#' CDMConnector::cdmDisconnect(cdm)
#' }
getDomains <- function(cdm,
standardConcept = "Standard") {
Expand Down Expand Up @@ -131,10 +129,9 @@ getDomains <- function(cdm,
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' getVocabularies(cdm = cdm)
#' CDMConnector::cdmDisconnect(cdm)
#' }

getVocabularies <- function(cdm) {
Expand Down Expand Up @@ -171,10 +168,9 @@ getVocabularies <- function(cdm) {
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' getConceptClassId(cdm = cdm, domain = "drug")
#' CDMConnector::cdmDisconnect(cdm)
#' }
getConceptClassId <- function(cdm,
standardConcept = "Standard",
Expand Down Expand Up @@ -254,10 +250,9 @@ getConceptClassId <- function(cdm,
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' getDoseForm(cdm = cdm)
#' CDMConnector::cdmDisconnect(cdm)
#' }

getDoseForm <- function(cdm) {
Expand Down Expand Up @@ -313,10 +308,9 @@ getDoseForm <- function(cdm) {
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' getDescendants(cdm = cdm, conceptId = 1)
#' CDMConnector::cdmDisconnect(cdm)
#' }

getDescendants <- function(cdm,
Expand Down Expand Up @@ -562,10 +556,9 @@ addIngredientCount <- function(cdm, concepts) {
#' @export
#'
#' @examples
#' \dontrun{
#' \donttest{
#' cdm <- mockVocabRef()
#' getRelationshipId(cdm = cdm)
#' CDMConnector::cdmDisconnect(cdm)
#' }
getRelationshipId <- function(cdm,
standardConcept1 = "standard",
Expand Down
2 changes: 1 addition & 1 deletion man/availableATC.Rd

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

2 changes: 1 addition & 1 deletion man/availableICD10.Rd

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

2 changes: 1 addition & 1 deletion man/availableIngredients.Rd

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

2 changes: 1 addition & 1 deletion man/codesFromConceptSet.Rd

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

2 changes: 1 addition & 1 deletion man/codesInUse.Rd

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

3 changes: 1 addition & 2 deletions man/compareCodelists.Rd

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

3 changes: 1 addition & 2 deletions man/getATCCodes.Rd

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

Loading
Loading