Skip to content

Commit

Permalink
Remove \dontrun{} when not strictly required (#61)
Browse files Browse the repository at this point in the history
* add the examples to the functions documentations

* build documentation for show_tables() and visualise_table()

* Update CITATION.cff

* update function's examples

* fix linters

* add new lines

* remove unnecessary nolint

* use explicit URL

* update show_example_file documentation

* align argument in function documentation

* Automatic readme update

* add examples and remove dontrun{} when not needed in DHIS2 related functions

* add examples and remove dontrun{} when not needed in Fingertips related functions

* add examples and remove dontrun{} when not needed in REDCap related functions

* add examples and remove dontrun{} when not needed in server related functions

* add examples and remove dontrun{} when not needed in readepi related functions

* run devtools::document()

* remove README.html

* rearrange arguments in read_from_readcap example

* complete test example for dhis2_get_attributes_from_user

* Update _pkgdown.yml to account for read_from_fingertips

* update on dhis2_get_attributes_from_user()

* Update CITATION.cff

* remove examples in internal functions documentation - for functions without dontrun{}

* Update R/read_from_fingertips.R

remove @nord in the function documentation

Co-authored-by: Hugo Gruson <[email protected]>

---------

Co-authored-by: Karim-Mane <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Karim MANE <[email protected]>
Co-authored-by: Hugo Gruson <[email protected]>
  • Loading branch information
5 people authored Jan 31, 2024
1 parent 0eae01f commit 3d715e2
Show file tree
Hide file tree
Showing 39 changed files with 357 additions and 653 deletions.
60 changes: 30 additions & 30 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -55,34 +55,34 @@ references:
abstract: 'checkmate: Fast and Versatile Argument Checks'
notes: Imports
url: https://mllg.github.io/checkmate/
repository: https://packagemanager.posit.co/cran/latest/
repository: https://CRAN.R-project.org/package=checkmate
authors:
- family-names: Lang
given-names: Michel
email: [email protected]
orcid: https://orcid.org/0000-0001-9754-0393
year: '2023'
year: '2024'
- type: software
title: DBI
abstract: 'DBI: R Database Interface'
notes: Imports
url: https://dbi.r-dbi.org
repository: https://packagemanager.posit.co/cran/latest/
repository: https://CRAN.R-project.org/package=DBI
authors:
- name: R Special Interest Group on Databases (R-SIG-DB)
- family-names: Wickham
given-names: Hadley
- family-names: Müller
given-names: Kirill
email: [email protected]
email: [email protected]
orcid: https://orcid.org/0000-0002-1416-3412
year: '2023'
year: '2024'
- type: software
title: dplyr
abstract: 'dplyr: A Grammar of Data Manipulation'
notes: Imports
url: https://dplyr.tidyverse.org
repository: https://packagemanager.posit.co/cran/latest/
repository: https://CRAN.R-project.org/package=dplyr
authors:
- family-names: Wickham
given-names: Hadley
Expand All @@ -100,7 +100,7 @@ references:
given-names: Davis
email: [email protected]
orcid: https://orcid.org/0000-0003-4777-038X
year: '2023'
year: '2024'
- type: software
title: fingertipsR
abstract: 'fingertipsR: Fingertips Data for Public Health'
Expand All @@ -115,69 +115,69 @@ references:
email: [email protected]
- family-names: Flowers
given-names: Julian
year: '2023'
year: '2024'
version: '>= 1.0.10.9001'
- type: software
title: glue
abstract: 'glue: Interpreted String Literals'
notes: Imports
url: https://glue.tidyverse.org/
repository: https://packagemanager.posit.co/cran/latest/
repository: https://CRAN.R-project.org/package=glue
authors:
- family-names: Hester
given-names: Jim
orcid: https://orcid.org/0000-0002-2739-7082
- family-names: Bryan
given-names: Jennifer
email: jenny@rstudio.com
email: jenny@posit.co
orcid: https://orcid.org/0000-0002-6983-2759
year: '2023'
year: '2024'
- type: software
title: httr
abstract: 'httr: Tools for Working with URLs and HTTP'
notes: Imports
url: https://httr.r-lib.org/
repository: https://packagemanager.posit.co/cran/latest/
repository: https://CRAN.R-project.org/package=httr
authors:
- family-names: Wickham
given-names: Hadley
email: [email protected]
year: '2023'
year: '2024'
- type: software
title: magrittr
abstract: 'magrittr: A Forward-Pipe Operator for R'
notes: Imports
url: https://magrittr.tidyverse.org
repository: https://packagemanager.posit.co/cran/latest/
repository: https://CRAN.R-project.org/package=magrittr
authors:
- family-names: Bache
given-names: Stefan Milton
email: [email protected]
- family-names: Wickham
given-names: Hadley
email: [email protected]
year: '2023'
year: '2024'
- type: software
title: odbc
abstract: 'odbc: Connect to ODBC Compatible Databases (using the DBI Interface)'
notes: Imports
url: https://r-dbi.github.io/odbc/
repository: https://packagemanager.posit.co/cran/latest/
url: https://odbc.r-dbi.org
repository: https://CRAN.R-project.org/package=odbc
authors:
- family-names: Hester
given-names: Jim
- family-names: Wickham
given-names: Hadley
email: hadley@rstudio.com
email: hadley@posit.co
- family-names: Gjoneski
given-names: Oliver
year: '2023'
year: '2024'
- type: software
title: pool
abstract: 'pool: Object Pooling'
notes: Imports
url: http://rstudio.github.io/pool/
repository: https://packagemanager.posit.co/cran/latest/
repository: https://CRAN.R-project.org/package=pool
authors:
- family-names: Cheng
given-names: Joe
Expand All @@ -187,25 +187,25 @@ references:
- family-names: Wickham
given-names: Hadley
email: [email protected]
year: '2023'
year: '2024'
- type: software
title: REDCapR
abstract: 'REDCapR: Interaction Between R and REDCap'
notes: Imports
url: https://ouhscbbmc.github.io/REDCapR/
repository: https://packagemanager.posit.co/cran/latest/
repository: https://CRAN.R-project.org/package=REDCapR
authors:
- family-names: Beasley
given-names: Will
email: [email protected]
orcid: https://orcid.org/0000-0002-5613-5006
year: '2023'
year: '2024'
- type: software
title: RMySQL
abstract: 'RMySQL: Database Interface and ''MySQL'' Driver for R'
notes: Imports
url: https://downloads.mariadb.org/connector-c/
repository: https://packagemanager.posit.co/cran/latest/
repository: https://CRAN.R-project.org/package=RMySQL
authors:
- family-names: Ooms
given-names: Jeroen
Expand All @@ -220,19 +220,19 @@ references:
email: [email protected]
- family-names: Horner
given-names: Jeffrey
year: '2023'
year: '2024'
- type: software
title: httptest
abstract: 'httptest: A Test Environment for HTTP Requests'
notes: Suggests
url: https://enpiar.com/r/httptest/
repository: https://packagemanager.posit.co/cran/latest/
repository: https://CRAN.R-project.org/package=httptest
authors:
- family-names: Richardson
given-names: Neal
email: [email protected]
orcid: https://orcid.org/0009-0002-7992-3520
year: '2023'
year: '2024'
- type: software
title: knitr
abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R'
Expand All @@ -244,7 +244,7 @@ references:
given-names: Yihui
email: [email protected]
orcid: https://orcid.org/0000-0003-0645-5666
year: '2023'
year: '2024'
- type: software
title: rmarkdown
abstract: 'rmarkdown: Dynamic Documents for R'
Expand Down Expand Up @@ -287,7 +287,7 @@ references:
given-names: Richard
email: [email protected]
orcid: https://orcid.org/0000-0003-3925-190X
year: '2023'
year: '2024'
- type: software
title: testthat
abstract: 'testthat: Unit Testing for R'
Expand All @@ -298,7 +298,7 @@ references:
- family-names: Wickham
given-names: Hadley
email: [email protected]
year: '2023'
year: '2024'
version: '>= 3.0.0'
identifiers:
- type: url
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Remotes:
rOpenSci/fingertipsR
Config/Needs/website: epiverse-trace/epiversetheme
Config/testthat/edition: 3
SystemRequirements: odbc, libmariadbclient-dev
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
20 changes: 14 additions & 6 deletions R/check_dhis2_attributes-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@
#' @return an object of class `data.frame` that contains the information of
#' interest.
#' @keywords internal

#' @examples
#' \dontrun{
#' response <- dhis2_make_api_request(
#' base_url = file.path("https:/", "play.dhis2.org", "dev"),
#' user_name = "admin",
#' password = "district",
#' which = "dataElements"
#' )
#' }
#'
dhis2_make_api_request <- function(base_url,
user_name,
password,
Expand Down Expand Up @@ -59,15 +68,14 @@ dhis2_make_api_request <- function(base_url,
#' @examples
#' \dontrun{
#' result <- dhis2_get_relevant_attributes(
#' base_url = "https://play.dhis2.org/dev/",
#' user_name = "admin",
#' password = "district",
#' base_url = "https://play.dhis2.org/dev/",
#' user_name = "admin",
#' password = "district",
#' attribute_id = "pBOMPrpg1QX,BfMAe6Itzgt",
#' which = "dataSets"
#' which = "dataSets"
#' )
#' }
#' @keywords internal

dhis2_get_relevant_attributes <- function(base_url,
user_name,
password,
Expand Down
16 changes: 11 additions & 5 deletions R/read_from_dhis2-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@
#' @return a message if the dhis2_login was successful,
#' throws an error otherwise.
#'
#' @return a message if the login was successfull, thows an error otherwise.
#' @return a message if the login was successful, throws an error otherwise.
#'
#' @keywords internal
#'
#' @examples
#' \dontrun{
#' dhis2_login(
#' base_url = file.path("https:/", "play.dhis2.org", "dev"),
#' user_name = "admin",
#' password = "district"
#' )
#' }
dhis2_login <- function(base_url,
user_name,
password) {
Expand Down Expand Up @@ -43,7 +50,7 @@ dhis2_login <- function(base_url,
#' results <- dhis2_subset_fields(
#' data = readepi(
#' credentials_file = system.file("extdata", "test.ini",
#' package = "readepi"),
#' package = "readepi"),
#' data_source = "https://play.dhis2.org/dev",
#' dataset = "pBOMPrpg1QX,BfMAe6Itzgt",
#' organisation_unit = "DiszpKrYNg8",
Expand Down Expand Up @@ -99,8 +106,7 @@ dhis2_subset_fields <- function(data,
#' result <- dhis2_subset_records(
#' data = readepi(
#' credentials_file = system.file("extdata", "test.ini",
#' package = "readepi"
#' ),
#' package = "readepi"),
#' data_source = "https://play.dhis2.org/dev",
#' dataset = "pBOMPrpg1QX",
#' organisation_unit = "DiszpKrYNg8",
Expand Down
1 change: 0 additions & 1 deletion R/read_from_dhis2.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#' @returns a `list` of 1 element of type `data frame`.
#' @keywords internal
#'
#'
#' @examples
#' \dontrun{
#' data <- read_from_dhis2(
Expand Down
15 changes: 13 additions & 2 deletions R/read_from_fingertips-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,18 @@ fingertips_get_id_from_dm_name <- function(metadata =
#' @return a `list` of 2 elements of type `character` and `numeric`. These are
#' the `profile name` and their correspondent indexes.
#' @keywords internal
#' @examples
#' \dontrun{
#' res <- fingertips_get_profile_name(
#' profile_id = 19L,
#' profile_name = "Public Health Outcomes Framework",
#' metadata = list(
#' indicator_profile_domain = fingertipsR::indicators(),
#' indicator_ids_names = fingertipsR::indicators_unique(),
#' area_type = fingertipsR::area_types()
#' )
#' )
#' }
#'
fingertips_get_profile_name <- function(metadata =
list(indicator_profile_domain =
Expand Down Expand Up @@ -282,8 +294,7 @@ fingertips_get_profile_name <- function(metadata =
profile_id)
} else if (!is.null(profile_name) && is.null(profile_id)) {
profile_name <- unlist(strsplit(profile_name, ",", fixed = TRUE))
idx <- which(
metadata[["indicator_profile_domain"]][["ProfileName"]] ==
idx <- which(metadata[["indicator_profile_domain"]][["ProfileName"]] ==
profile_name)
}

Expand Down
2 changes: 2 additions & 0 deletions R/read_from_fingertips.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#' @return a `list` of 1 element of type `data.frame`. This contains the
#' imported dataset of interest.
#'
#' @keywords internal
#'
#' @examples
#' \dontrun{
#' data <- read_from_fingertips(indicator_id = 90362, area_type_id = 202)
Expand Down
Loading

0 comments on commit 3d715e2

Please sign in to comment.