Skip to content

trud: Query the 'NHS TRUD API' (full submission) #705

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

Open
12 of 29 tasks
rmgpanw opened this issue May 8, 2025 · 30 comments
Open
12 of 29 tasks

trud: Query the 'NHS TRUD API' (full submission) #705

rmgpanw opened this issue May 8, 2025 · 30 comments

Comments

@rmgpanw
Copy link

rmgpanw commented May 8, 2025

Submitting Author Name: Alasdair Warwick
Submitting Author Github Handle: @rmgpanw
Other Package Authors Github handles: (comma separated, delete if none) @abolvera, @cyu12, @rnluben
Repository: https://github.com/rmgpanw/trud/
Submission type: Standard
Editor: @emilyriederer
Reviewers: @AleKoure, @jonclayden

Due date for @AleKoure: 2025-06-18

Due date for @jonclayden: 2025-06-18
Archive: TBD
Version accepted: TBD
Language: en


  • Paste the full DESCRIPTION file inside a code block below:
Package: trud
Title: Query the 'NHS TRUD API'
Version: 0.1.0.9000
Authors@R: c(
    person(given = "Alasdair",
           family = "Warwick",
           role = c("aut", "cre", "cph"),
           email = "alasdair.warwick.19@ucl.ac.uk",
           comment = c(ORCID = "0000-0002-0800-2890")),
    person("Robert", "Luben", role = "aut",
           comment = c(ORCID = "0000-0002-5088-6343")),
    person("Abraham", "Olvera-Barrios", role = "aut",
           comment = c(ORCID = "0000-0002-3305-4465")),
    person("Chuin Ying", "Ung", role = "aut",
           comment = c(ORCID = "0000-0001-8487-4589"))
    )
Description: Provides a convenient R interface to the 'National Health Service 
    NHS Technology Reference Update Distribution (TRUD) API', allowing users 
    to list available releases for their subscribed items, retrieve metadata, 
    and download release files. For more information on the API, see 
    <https://isd.digital.nhs.uk/trud/users/guest/filters/0/api>.
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Depends: R (>= 4.2.0)
Imports: 
    cli,
    dplyr,
    httr2,
    purrr,
    rlang,
    rvest,
    stringr,
    tibble
URL: https://rmgpanw.github.io/trud/,
    https://github.com/rmgpanw/trud
BugReports: https://github.com/rmgpanw/trud/issues
Suggests: 
    knitr,
    rmarkdown,
    spelling,
    testthat (>= 3.0.0),
    withr
Config/testthat/edition: 3
Language: en-US
VignetteBuilder: knitr

Scope

  • Please indicate which category or categories from our package fit policies or statistical package categories this package falls under. (Please check one or more appropriate boxes below):

    Data Lifecycle Packages

    • data retrieval
    • data extraction
    • data munging
    • data deposition
    • data validation and testing
    • workflow automation
    • version control
    • citation management and bibliometrics
    • scientific software wrappers
    • field and lab reproducibility tools
    • database software bindings
    • geospatial data
    • text analysis
  • Explain how and why the package falls under these categories (briefly, 1-2 sentences). Please note any areas you are unsure of:

trud wraps the NHS TRUD API, which enables account holders to automate the download of technology reference files from NHS England.

  • Who is the target audience and what are scientific applications of this package?

The technology reference files from NHS England are widely used by researchers (both within and outside the UK) working with electronic health records data. The available items include various clinical coding terminologies such as ICD, Read, prescription codes and the SNOMED CT ontology (which is updated with new available releases every few months). While trud is a relatively small package, it provides a helpful aid to researchers working with these release items, greatly simplifying the process of automated updates to support downstream analyses.

There are no other similar R packages that I am aware of.

Not applicable

  • If you made a pre-submission inquiry, please paste the link to the corresponding issue, forum post, or other discussion, or @tag the editor you contacted.

#689

  • Explain reasons for any pkgcheck items which your package is unable to pass.

Please note that all pkgcheck checks are passing for me locally, however the pkgcheck GitHub Actions currently hangs (being investigated at ropensci-review-tools/pkgcheck#235)

Technical checks

Confirm each of the following by checking the box.

This package:

Publication options

  • Do you intend for this package to go on CRAN?

trud 0.1.0 is available on CRAN (accepted mid-2024)

  • Do you intend for this package to go on Bioconductor?

  • Do you wish to submit an Applications Article about your package to Methods in Ecology and Evolution? If so:

MEE Options
  • The package is novel and will be of interest to the broad readership of the journal.
  • The manuscript describing the package is no longer than 3000 words.
  • You intend to archive the code for the package in a long-term repository which meets the requirements of the journal (see MEE's Policy on Publishing Code)
  • (Scope: Do consider MEE's Aims and Scope for your manuscript. We make no guarantee that your manuscript will be within MEE scope.)
  • (Although not required, we strongly recommend having a full manuscript prepared when you submit here.)
  • (Please do not submit your package separately to Methods in Ecology and Evolution)

Code of conduct

@mpadge
Copy link
Member

mpadge commented May 9, 2025

@rmgpanw You've used the pre-submission template here, instead of the one for full submissions. Can you please:

  1. click "New Issue" -> "Submit software for review" and copy the templated text somewhere
  2. Fill fields by copying across what you've got in current pre-submission template
  3. Edit your initial comment by replacing current version will equivalent full-submission version.

The bot checks may not be automatically triggered, so you might also need to manually call @ropensci-review-bot check package (as a separate issue comment). Thanks!

@rmgpanw
Copy link
Author

rmgpanw commented May 9, 2025

Apologies @mpadge, hopefully I've corrected this now!

@rmgpanw
Copy link
Author

rmgpanw commented May 9, 2025

@ropensci-review-bot check package

@ropensci-review-bot
Copy link
Collaborator

Thanks, about to send the query.

@ropensci-review-bot
Copy link
Collaborator

🚀

Editor check started

👋

@ropensci-review-bot
Copy link
Collaborator

Checks for trud (v0.1.0.9000)

git hash: aa883f7f

  • ✔️ Package is already on CRAN.
  • ✔️ has a 'codemeta.json' file.
  • ✔️ has a 'contributing' file.
  • ✔️ uses 'roxygen2'.
  • ✔️ 'DESCRIPTION' has a URL field.
  • ✔️ 'DESCRIPTION' has a BugReports field.
  • ✔️ Package has at least one HTML vignette
  • ✔️ All functions have examples.
  • ✔️ Package has continuous integration checks.
  • ✖️ Package coverage failed
  • ✖️ R CMD check found 1 error.
  • ✔️ R CMD check found no warnings.

Important: All failing checks above must be addressed prior to proceeding

Package License: MIT + file LICENSE


1. Package Dependencies

Details of Package Dependency Usage (click to open)

The table below tallies all function calls to all packages ('ncalls'), both internal (r-base + recommended, along with the package itself), and external (imported and suggested packages). 'NA' values indicate packages to which no identified calls to R functions could be found. Note that these results are generated by an automated code-tagging system which may not be entirely accurate.

type package ncalls
internal base 29
internal trud 17
internal utils 2
internal methods 1
internal stats 1
imports rvest 3
imports httr2 2
imports purrr 2
imports stringr 2
imports dplyr 1
imports rlang 1
imports tibble 1
imports cli NA
suggests knitr NA
suggests rmarkdown NA
suggests spelling NA
suggests testthat NA
suggests withr NA
linking_to NA NA

Click below for tallies of functions used in each package. Locations of each call within this package may be generated locally by running 's <- pkgstats::pkgstats(<path/to/repo>)', and examining the 'external_calls' table.

base

c (13), class (2), message (2), paste0 (2), url (2), as.integer (1), body (1), call (1), environment (1), file.path (1), Sys.setenv (1), tryCatch (1), with (1)

trud

get_item_metadata (3), get_trud_items_html (2), request_download_item (2), request_item_metadata (2), trud_error_message (2), trud_items (2), download_item (1), get_subscribed_metadata (1), get_trud_api_key (1), req_user_agent_trud (1)

rvest

html_attr (1), html_elements (1), html_text (1)

httr2

req_error (1), req_perform (1)

purrr

pluck (2)

stringr

str_glue (2)

utils

page (2)

dplyr

mutate (1)

methods

as (1)

rlang

caller_env (1)

stats

df (1)

tibble

tibble (1)

NOTE: Some imported packages appear to have no associated function calls; please ensure with author that these 'Imports' are listed appropriately.


2. Statistical Properties

This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.

Details of statistical properties (click to open)

The package has:

  • code in R (100% in 6 files) and
  • 4 authors
  • 1 vignette
  • no internal data file
  • 8 imported packages
  • 4 exported functions (median 14 lines of code)
  • 26 non-exported functions in R (median 11 lines of code)

Statistical properties of package structure as distributional percentiles in relation to all current CRAN packages
The following terminology is used:

  • loc = "Lines of Code"
  • fn = "function"
  • exp/not_exp = exported / not exported

All parameters are explained as tooltips in the locally-rendered HTML version of this report generated by the checks_to_markdown() function

The final measure (fn_call_network_size) is the total number of calls between functions (in R), or more abstract relationships between code objects in other languages. Values are flagged as "noteworthy" when they lie in the upper or lower 5th percentile.

measure value percentile noteworthy
files_R 6 37.1
files_inst 1 94.8
files_vignettes 1 61.7
files_tests 7 81.3
loc_R 283 30.0
loc_inst 12 17.3
loc_vignettes 40 6.1
loc_tests 279 58.5
num_vignettes 1 58.7
n_fns_r 30 39.7
n_fns_r_exported 4 20.1
n_fns_r_not_exported 26 47.3
n_fns_per_file_r 3 50.0
num_params_per_fn 3 29.3
loc_per_fn_r 11 32.7
loc_per_fn_r_exp 14 33.4
loc_per_fn_r_not_exp 11 35.7
rel_whitespace_R 19 34.2
rel_whitespace_inst 8 15.6
rel_whitespace_vignettes 40 9.4
rel_whitespace_tests 18 53.9
doclines_per_fn_exp 24 23.5
doclines_per_fn_not_exp 0 0.0 TRUE
fn_call_network_size 18 43.3

2a. Network visualisation

Click to see the interactive network visualisation of calls between objects in package


3. goodpractice and other checks

Details of goodpractice checks (click to open)

3a. Continuous Integration Badges

pkgdown.yaml
R-CMD-check.yaml

GitHub Workflow Results

id name conclusion sha run_number date
14912366508 Draft PDF success aa883f 6 2025-05-08
14912511223 pages build and deployment success 0c3012 34 2025-05-08
14912366515 pkgcheck cancelled aa883f 10 2025-05-08
14912366495 pkgdown success aa883f 35 2025-05-08
14912366507 R-CMD-check success aa883f 25 2025-05-08
14912366493 test-coverage success aa883f 30 2025-05-08

3b. goodpractice results

R CMD check with rcmdcheck

R CMD check generated the following error:

  1. checking tests ...
    Running ‘spelling.R’
    Comparing ‘spelling.Rout’ to ‘spelling.Rout.save’ ... OK
    Running ‘testthat.R’
    ERROR
    Running the tests in ‘tests/testthat.R’ failed.
    Last 13 lines of output:
    Error in get_subscribed_metadata(): x Can't find NHS TRUD API key
    i Set your NHS TRUD API key as an environment variable using Sys.setenv(TRUD_API_KEY='<<your-key>>'), or preferably use a .Renviron file
    i To get an API key, first sign up for a NHS TRUD account at https://isd.digital.nhs.uk/trud/users/guest/filters/0/account/form
    i To find Your API key, log in and visit your account profile page (https://isd.digital.nhs.uk/trud/users/authenticated/filters/0/account/manage).
    Backtrace:
    1. ├─testthat::with_mocked_bindings(...) at test-get_subscribed_metadata.R:2:3
    2. └─trud::get_subscribed_metadata() at test-get_subscribed_metadata.R:14:7
    3. └─trud:::get_trud_api_key(TRUD_API_KEY)
    4. └─cli::cli_abort(...)
      
    5.   └─rlang::abort(...)
      

[ FAIL 6 | WARN 0 | SKIP 5 | PASS 14 ]
Error: Test failures
Execution halted

R CMD check generated the following test_fail:

  1. This file is part of the standard setup for testthat.

It is recommended that you do not modify it.

Where should you do additional test configuration?

Learn more about the roles of various files in:

* https://r-pkgs.org/testing-design.html#sec-tests-files-overview

* https://testthat.r-lib.org/articles/special-files.html

library(testthat)
library(trud)

test_check("trud")
[ FAIL 6 | WARN 0 | SKIP 5 | PASS 14 ]

══ Skipped tests (5) ═══════════════════════════════════════════════════════════
• identical(Sys.getenv("TRUD_API_KEY"), "") is TRUE (5):
'test-get_item_metadata.R:27:3', 'test-get_item_metadata.R:45:5',
'test-get_item_metadata.R:77:3', 'test-get_subscribed_metadata.R:28:3',
'test-trud_items.R:36:3'

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-download_item.R:2:3'): Expected errors raised for invalid release arg with download_item() ──
<missing_api_key/rlang_error/error/condition>
Error in download_item(394, release = 1): x Can't find NHS TRUD API key
i Set your NHS TRUD API key as an environment variable using Sys.setenv(TRUD_API_KEY='<<your-key>>'), or preferably use a .Renviron file
i To get an API key, first sign up for a NHS TRUD account at https://isd.digital.nhs.uk/trud/users/guest/filters/0/account/form
i To find Your API key, log in and visit your account profile page (https://isd.digital.nhs.uk/trud/users/authenticated/filters/0/account/manage).
Backtrace:

  1. ├─testthat::expect_error(download_item(394, release = 1), "Argument release must be a string") at test-download_item.R:2:3
  2. │ └─testthat:::expect_condition_matching(...)
  3. │ └─testthat:::quasi_capture(...)
  4. │ ├─testthat (local) .capture(...)
  5. │ │ └─base::withCallingHandlers(...)
  6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  7. └─trud::download_item(394, release = 1)
  8. └─trud:::get_trud_api_key(TRUD_API_KEY)
  9. └─cli::cli_abort(...)
    
  10.   └─rlang::abort(...)
    

── Error ('test-download_item.R:37:7'): Warning raised if file to be downloaded already exists locally ──
<missing_api_key/rlang_error/error/condition>
Error in download_item(394, release = "item1", directory = tempdir()): x Can't find NHS TRUD API key
i Set your NHS TRUD API key as an environment variable using Sys.setenv(TRUD_API_KEY='<<your-key>>'), or preferably use a .Renviron file
i To get an API key, first sign up for a NHS TRUD account at https://isd.digital.nhs.uk/trud/users/guest/filters/0/account/form
i To find Your API key, log in and visit your account profile page (https://isd.digital.nhs.uk/trud/users/authenticated/filters/0/account/manage).
Backtrace:

  1. ├─testthat::with_mocked_bindings(...) at test-download_item.R:27:3
  2. ├─testthat::expect_warning(...) at test-download_item.R:37:7
  3. │ └─testthat:::expect_condition_matching(...)
  4. │ └─testthat:::quasi_capture(...)
  5. │ ├─testthat (local) .capture(...)
  6. │ │ └─base::withCallingHandlers(...)
  7. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  8. └─trud::download_item(394, release = "item1", directory = tempdir())
  9. └─trud:::get_trud_api_key(TRUD_API_KEY)
  10. └─cli::cli_abort(...)
    
  11.   └─rlang::abort(...)
    

── Error ('test-download_item.R:64:7'): download_item() works ────────────────
<missing_api_key/rlang_error/error/condition>
Error in download_item(394, release = "item1", directory = tempdir()): x Can't find NHS TRUD API key
i Set your NHS TRUD API key as an environment variable using Sys.setenv(TRUD_API_KEY='<<your-key>>'), or preferably use a .Renviron file
i To get an API key, first sign up for a NHS TRUD account at https://isd.digital.nhs.uk/trud/users/guest/filters/0/account/form
i To find Your API key, log in and visit your account profile page (https://isd.digital.nhs.uk/trud/users/authenticated/filters/0/account/manage).
Backtrace:

  1. ├─testthat::with_mocked_bindings(...) at test-download_item.R:47:3
  2. ├─testthat::expect_equal(...) at test-download_item.R:64:7
  3. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
  4. │ └─rlang::eval_bare(expr, quo_get_env(quo))
  5. └─trud::download_item(394, release = "item1", directory = tempdir())
  6. └─trud:::get_trud_api_key(TRUD_API_KEY)
  7. └─cli::cli_abort(...)
    
  8.   └─rlang::abort(...)
    

── Error ('test-get_item_metadata.R:2:3'): Error raised with invalid latest_only arg value for get_item_metadata() ──
<missing_api_key/rlang_error/error/condition>
Error in get_item_metadata(394, latest_only = "TRUE"): x Can't find NHS TRUD API key
i Set your NHS TRUD API key as an environment variable using Sys.setenv(TRUD_API_KEY='<<your-key>>'), or preferably use a .Renviron file
i To get an API key, first sign up for a NHS TRUD account at https://isd.digital.nhs.uk/trud/users/guest/filters/0/account/form
i To find Your API key, log in and visit your account profile page (https://isd.digital.nhs.uk/trud/users/authenticated/filters/0/account/manage).
Backtrace:

  1. ├─testthat::expect_error(...) at test-get_item_metadata.R:2:3
  2. │ └─testthat:::expect_condition_matching(...)
  3. │ └─testthat:::quasi_capture(...)
  4. │ ├─testthat (local) .capture(...)
  5. │ │ └─base::withCallingHandlers(...)
  6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  7. └─trud::get_item_metadata(394, latest_only = "TRUE")
  8. └─trud:::get_trud_api_key(TRUD_API_KEY)
  9. └─cli::cli_abort(...)
    
  10.   └─rlang::abort(...)
    

── Error ('test-get_item_metadata.R:18:7'): get_item_metadata() runs with mocked API response ──
<missing_api_key/rlang_error/error/condition>
Error in get_item_metadata(394): x Can't find NHS TRUD API key
i Set your NHS TRUD API key as an environment variable using Sys.setenv(TRUD_API_KEY='<<your-key>>'), or preferably use a .Renviron file
i To get an API key, first sign up for a NHS TRUD account at https://isd.digital.nhs.uk/trud/users/guest/filters/0/account/form
i To find Your API key, log in and visit your account profile page (https://isd.digital.nhs.uk/trud/users/authenticated/filters/0/account/manage).
Backtrace:

  1. ├─testthat::with_mocked_bindings(...) at test-get_item_metadata.R:9:3
  2. └─trud::get_item_metadata(394) at test-get_item_metadata.R:18:7
  3. └─trud:::get_trud_api_key(TRUD_API_KEY)
  4. └─cli::cli_abort(...)
    
  5.   └─rlang::abort(...)
    

── Error ('test-get_subscribed_metadata.R:14:7'): get_subscribed_metadata() runs as expected ──
<missing_api_key/rlang_error/error/condition>
Error in get_subscribed_metadata(): x Can't find NHS TRUD API key
i Set your NHS TRUD API key as an environment variable using Sys.setenv(TRUD_API_KEY='<<your-key>>'), or preferably use a .Renviron file
i To get an API key, first sign up for a NHS TRUD account at https://isd.digital.nhs.uk/trud/users/guest/filters/0/account/form
i To find Your API key, log in and visit your account profile page (https://isd.digital.nhs.uk/trud/users/authenticated/filters/0/account/manage).
Backtrace:

  1. ├─testthat::with_mocked_bindings(...) at test-get_subscribed_metadata.R:2:3
  2. └─trud::get_subscribed_metadata() at test-get_subscribed_metadata.R:14:7
  3. └─trud:::get_trud_api_key(TRUD_API_KEY)
  4. └─cli::cli_abort(...)
    
  5.   └─rlang::abort(...)
    

[ FAIL 6 | WARN 0 | SKIP 5 | PASS 14 ]
Error: Test failures
Execution halted

R CMD check generated the following check_fail:

  1. rcmdcheck_tests_pass

Test coverage with covr

ERROR: Test Coverage Failed

Cyclocomplexity with cyclocomp

No functions have cyclocomplexity >= 15

Static code analyses with lintr

lintr found the following 46 potential issues:

message number of times
Avoid library() and require() calls in packages 1
Lines should not be more than 80 characters. This line is 100 characters. 1
Lines should not be more than 80 characters. This line is 105 characters. 1
Lines should not be more than 80 characters. This line is 108 characters. 1
Lines should not be more than 80 characters. This line is 111 characters. 1
Lines should not be more than 80 characters. This line is 112 characters. 2
Lines should not be more than 80 characters. This line is 113 characters. 3
Lines should not be more than 80 characters. This line is 115 characters. 1
Lines should not be more than 80 characters. This line is 117 characters. 2
Lines should not be more than 80 characters. This line is 118 characters. 1
Lines should not be more than 80 characters. This line is 147 characters. 1
Lines should not be more than 80 characters. This line is 165 characters. 2
Lines should not be more than 80 characters. This line is 81 characters. 3
Lines should not be more than 80 characters. This line is 82 characters. 2
Lines should not be more than 80 characters. This line is 83 characters. 4
Lines should not be more than 80 characters. This line is 84 characters. 2
Lines should not be more than 80 characters. This line is 85 characters. 6
Lines should not be more than 80 characters. This line is 86 characters. 2
Lines should not be more than 80 characters. This line is 87 characters. 1
Lines should not be more than 80 characters. This line is 88 characters. 2
Lines should not be more than 80 characters. This line is 89 characters. 1
Lines should not be more than 80 characters. This line is 90 characters. 3
Lines should not be more than 80 characters. This line is 93 characters. 1
Lines should not be more than 80 characters. This line is 97 characters. 2


Package Versions

package version
pkgstats 0.2.0.54
pkgcheck 0.1.2.126


Editor-in-Chief Instructions:

Processing may not proceed until the items marked with ✖️ have been resolved.

@rmgpanw
Copy link
Author

rmgpanw commented May 9, 2025

@ropensci-review-bot check package

@ropensci-review-bot
Copy link
Collaborator

Thanks, about to send the query.

@ropensci-review-bot
Copy link
Collaborator

🚀

Editor check started

👋

@ropensci-review-bot
Copy link
Collaborator

Checks for trud (v0.1.0.9000)

git hash: 969f5d1c

  • ✔️ Package is already on CRAN.
  • ✔️ has a 'codemeta.json' file.
  • ✔️ has a 'contributing' file.
  • ✔️ uses 'roxygen2'.
  • ✔️ 'DESCRIPTION' has a URL field.
  • ✔️ 'DESCRIPTION' has a BugReports field.
  • ✔️ Package has at least one HTML vignette
  • ✔️ All functions have examples.
  • ✔️ Package has continuous integration checks.
  • ✔️ Package coverage is 91.4%.
  • ✔️ R CMD check found no errors.
  • ✔️ R CMD check found no warnings.

Package License: MIT + file LICENSE


1. Package Dependencies

Details of Package Dependency Usage (click to open)

The table below tallies all function calls to all packages ('ncalls'), both internal (r-base + recommended, along with the package itself), and external (imported and suggested packages). 'NA' values indicate packages to which no identified calls to R functions could be found. Note that these results are generated by an automated code-tagging system which may not be entirely accurate.

type package ncalls
internal base 29
internal trud 17
internal utils 2
internal methods 1
internal stats 1
imports rvest 3
imports httr2 2
imports purrr 2
imports stringr 2
imports dplyr 1
imports rlang 1
imports tibble 1
imports cli NA
suggests knitr NA
suggests rmarkdown NA
suggests spelling NA
suggests testthat NA
suggests withr NA
linking_to NA NA

Click below for tallies of functions used in each package. Locations of each call within this package may be generated locally by running 's <- pkgstats::pkgstats(<path/to/repo>)', and examining the 'external_calls' table.

base

c (13), class (2), message (2), paste0 (2), url (2), as.integer (1), body (1), call (1), environment (1), file.path (1), Sys.setenv (1), tryCatch (1), with (1)

trud

get_item_metadata (3), get_trud_items_html (2), request_download_item (2), request_item_metadata (2), trud_error_message (2), trud_items (2), download_item (1), get_subscribed_metadata (1), get_trud_api_key (1), req_user_agent_trud (1)

rvest

html_attr (1), html_elements (1), html_text (1)

httr2

req_error (1), req_perform (1)

purrr

pluck (2)

stringr

str_glue (2)

utils

page (2)

dplyr

mutate (1)

methods

as (1)

rlang

caller_env (1)

stats

df (1)

tibble

tibble (1)

NOTE: Some imported packages appear to have no associated function calls; please ensure with author that these 'Imports' are listed appropriately.


2. Statistical Properties

This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.

Details of statistical properties (click to open)

The package has:

  • code in R (100% in 6 files) and
  • 4 authors
  • 1 vignette
  • no internal data file
  • 8 imported packages
  • 4 exported functions (median 14 lines of code)
  • 26 non-exported functions in R (median 11 lines of code)

Statistical properties of package structure as distributional percentiles in relation to all current CRAN packages
The following terminology is used:

  • loc = "Lines of Code"
  • fn = "function"
  • exp/not_exp = exported / not exported

All parameters are explained as tooltips in the locally-rendered HTML version of this report generated by the checks_to_markdown() function

The final measure (fn_call_network_size) is the total number of calls between functions (in R), or more abstract relationships between code objects in other languages. Values are flagged as "noteworthy" when they lie in the upper or lower 5th percentile.

measure value percentile noteworthy
files_R 6 37.1
files_inst 1 94.8
files_vignettes 1 61.7
files_tests 7 81.3
loc_R 283 30.0
loc_inst 12 17.3
loc_vignettes 40 6.1
loc_tests 290 59.4
num_vignettes 1 58.7
n_fns_r 30 39.7
n_fns_r_exported 4 20.1
n_fns_r_not_exported 26 47.3
n_fns_per_file_r 3 50.0
num_params_per_fn 3 29.3
loc_per_fn_r 11 32.7
loc_per_fn_r_exp 14 33.4
loc_per_fn_r_not_exp 11 35.7
rel_whitespace_R 19 34.2
rel_whitespace_inst 8 15.6
rel_whitespace_vignettes 40 9.4
rel_whitespace_tests 17 53.9
doclines_per_fn_exp 24 23.5
doclines_per_fn_not_exp 0 0.0 TRUE
fn_call_network_size 18 43.3

2a. Network visualisation

Click to see the interactive network visualisation of calls between objects in package


3. goodpractice and other checks

Details of goodpractice checks (click to open)

3a. Continuous Integration Badges

pkgdown.yaml
R-CMD-check.yaml

GitHub Workflow Results

id name conclusion sha run_number date
14924645040 Draft PDF success 969f5d 7 2025-05-09
14912511223 pages build and deployment success 0c3012 34 2025-05-08
14924645045 pkgcheck NA 969f5d 11 2025-05-09
14924645044 pkgdown NA 969f5d 36 2025-05-09
14924645043 R-CMD-check NA 969f5d 26 2025-05-09
14924645060 test-coverage NA 969f5d 31 2025-05-09

3b. goodpractice results

R CMD check with rcmdcheck

rcmdcheck found no errors, warnings, or notes

Test coverage with covr

Package coverage: 91.44

Cyclocomplexity with cyclocomp

No functions have cyclocomplexity >= 15

Static code analyses with lintr

lintr found the following 46 potential issues:

message number of times
Avoid library() and require() calls in packages 1
Lines should not be more than 80 characters. This line is 100 characters. 1
Lines should not be more than 80 characters. This line is 105 characters. 1
Lines should not be more than 80 characters. This line is 108 characters. 1
Lines should not be more than 80 characters. This line is 111 characters. 1
Lines should not be more than 80 characters. This line is 112 characters. 2
Lines should not be more than 80 characters. This line is 113 characters. 3
Lines should not be more than 80 characters. This line is 115 characters. 1
Lines should not be more than 80 characters. This line is 117 characters. 2
Lines should not be more than 80 characters. This line is 118 characters. 1
Lines should not be more than 80 characters. This line is 147 characters. 1
Lines should not be more than 80 characters. This line is 165 characters. 2
Lines should not be more than 80 characters. This line is 81 characters. 3
Lines should not be more than 80 characters. This line is 82 characters. 2
Lines should not be more than 80 characters. This line is 83 characters. 4
Lines should not be more than 80 characters. This line is 84 characters. 2
Lines should not be more than 80 characters. This line is 85 characters. 6
Lines should not be more than 80 characters. This line is 86 characters. 2
Lines should not be more than 80 characters. This line is 87 characters. 1
Lines should not be more than 80 characters. This line is 88 characters. 2
Lines should not be more than 80 characters. This line is 89 characters. 1
Lines should not be more than 80 characters. This line is 90 characters. 3
Lines should not be more than 80 characters. This line is 93 characters. 1
Lines should not be more than 80 characters. This line is 97 characters. 2


Package Versions

package version
pkgstats 0.2.0.54
pkgcheck 0.1.2.126


Editor-in-Chief Instructions:

This package is in top shape and may be passed on to a handling editor

@mpadge
Copy link
Member

mpadge commented May 14, 2025

Thanks for submitting @rmgpanw, and great to see that you've got the tests working. I note only one aspect of the {pkgcheck} results here:

This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.

And clicking on the statistical properties section shows that is just that you have no documentation lines at all for non-exported functions. Documenting all functions both exported and internal greatly helps others to understand, and thereby contribute, to your package. You just need to add a # @noRd tag to the end of internal function docs to prevent {roxygen2} from outputting documentation for those. See this section of our Dev Guide for more details. We'll proceed with review regardless, but do note that documentation of internal functions is also very helpful for reviewers, so please keep both the yet-to-be-assigned editor, and subsequent reviewers informed of your intentions and status in that regard.

Note also that the statistical properties provide immediate context for your statement that,

trud is a relatively small package

In Lines-of-Code, the standard and most direct measure of package size, it is in the 30th percentile, which is below average but definitely not too small, so rest assured, size is not an issue here. But thanks for pointing that out to us!

Other than that, everything has been previously checked and approved in the pre-submission issue #689, so we're good to proceed here. We'll try to find a handling editor asap. You'll see here when that's been arranged.

@rmgpanw
Copy link
Author

rmgpanw commented May 14, 2025

Thank you for the helpful feedback, as always @mpadge. I have now added some documentation for the non-exported functions in commit f48ca4d. Looking forward to making any further improvements!

@mpadge
Copy link
Member

mpadge commented May 20, 2025

@ropensci-review-bot assign @emilyriederer as editor

@ropensci-review-bot
Copy link
Collaborator

Assigned! @emilyriederer is now the editor

@emilyriederer
Copy link

@ropensci-review-bot check package

@ropensci-review-bot
Copy link
Collaborator

Thanks, about to send the query.

@ropensci-review-bot
Copy link
Collaborator

🚀

Editor check started

👋

@ropensci-review-bot
Copy link
Collaborator

Checks for trud (v0.1.0.9000)

git hash: f48ca4d1

  • ✔️ Package is already on CRAN.
  • ✔️ has a 'codemeta.json' file.
  • ✔️ has a 'contributing' file.
  • ✔️ uses 'roxygen2'.
  • ✔️ 'DESCRIPTION' has a URL field.
  • ✔️ 'DESCRIPTION' has a BugReports field.
  • ✔️ Package has at least one HTML vignette
  • ✔️ All functions have examples.
  • ✔️ Package has continuous integration checks.
  • ✔️ Package coverage is 91.4%.
  • ✔️ R CMD check found no errors.
  • ✔️ R CMD check found no warnings.

Package License: MIT + file LICENSE


1. Package Dependencies

Details of Package Dependency Usage (click to open)

The table below tallies all function calls to all packages ('ncalls'), both internal (r-base + recommended, along with the package itself), and external (imported and suggested packages). 'NA' values indicate packages to which no identified calls to R functions could be found. Note that these results are generated by an automated code-tagging system which may not be entirely accurate.

type package ncalls
internal base 29
internal trud 17
internal utils 2
internal methods 1
internal stats 1
imports rvest 3
imports httr2 2
imports purrr 2
imports stringr 2
imports dplyr 1
imports rlang 1
imports tibble 1
imports cli NA
suggests knitr NA
suggests rmarkdown NA
suggests spelling NA
suggests testthat NA
suggests withr NA
linking_to NA NA

Click below for tallies of functions used in each package. Locations of each call within this package may be generated locally by running 's <- pkgstats::pkgstats(<path/to/repo>)', and examining the 'external_calls' table.

base

c (13), class (2), message (2), paste0 (2), url (2), as.integer (1), body (1), call (1), environment (1), file.path (1), Sys.setenv (1), tryCatch (1), with (1)

trud

get_item_metadata (3), get_trud_items_html (2), request_download_item (2), request_item_metadata (2), trud_error_message (2), trud_items (2), download_item (1), get_subscribed_metadata (1), get_trud_api_key (1), req_user_agent_trud (1)

rvest

html_attr (1), html_elements (1), html_text (1)

httr2

req_error (1), req_perform (1)

purrr

pluck (2)

stringr

str_glue (2)

utils

page (2)

dplyr

mutate (1)

methods

as (1)

rlang

caller_env (1)

stats

df (1)

tibble

tibble (1)

NOTE: Some imported packages appear to have no associated function calls; please ensure with author that these 'Imports' are listed appropriately.


2. Statistical Properties

This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.

Details of statistical properties (click to open)

The package has:

  • code in R (100% in 6 files) and
  • 4 authors
  • 1 vignette
  • no internal data file
  • 8 imported packages
  • 4 exported functions (median 14 lines of code)
  • 26 non-exported functions in R (median 11 lines of code)

Statistical properties of package structure as distributional percentiles in relation to all current CRAN packages
The following terminology is used:

  • loc = "Lines of Code"
  • fn = "function"
  • exp/not_exp = exported / not exported

All parameters are explained as tooltips in the locally-rendered HTML version of this report generated by the checks_to_markdown() function

The final measure (fn_call_network_size) is the total number of calls between functions (in R), or more abstract relationships between code objects in other languages. Values are flagged as "noteworthy" when they lie in the upper or lower 5th percentile.

measure value percentile noteworthy
files_R 6 37.1
files_inst 1 94.6
files_vignettes 1 61.7
files_tests 7 81.3
loc_R 283 29.9
loc_inst 12 16.9
loc_vignettes 40 6.1
loc_tests 290 59.3
num_vignettes 1 58.6
n_fns_r 30 39.6
n_fns_r_exported 4 20.1
n_fns_r_not_exported 26 47.3
n_fns_per_file_r 3 50.0
num_params_per_fn 3 29.2
loc_per_fn_r 11 32.7
loc_per_fn_r_exp 14 33.3
loc_per_fn_r_not_exp 11 35.7
rel_whitespace_R 19 34.1
rel_whitespace_inst 8 15.4
rel_whitespace_vignettes 40 9.4
rel_whitespace_tests 17 53.8
doclines_per_fn_exp 24 23.4
doclines_per_fn_not_exp 0 0.0 TRUE
fn_call_network_size 18 43.3

2a. Network visualisation

Click to see the interactive network visualisation of calls between objects in package


3. goodpractice and other checks

Details of goodpractice checks (click to open)

3a. Continuous Integration Badges

pkgdown.yaml
R-CMD-check.yaml

GitHub Workflow Results

id name conclusion sha run_number date
15022557534 Draft PDF success f48ca4 8 2025-05-14
15022748529 pages build and deployment success 7578fb 36 2025-05-14
15022557548 pkgcheck success f48ca4 12 2025-05-14
15022557528 pkgdown success f48ca4 37 2025-05-14
15022557537 R-CMD-check success f48ca4 27 2025-05-14
15022557561 test-coverage success f48ca4 32 2025-05-14

3b. goodpractice results

R CMD check with rcmdcheck

rcmdcheck found no errors, warnings, or notes

Test coverage with covr

Package coverage: 91.44

Cyclocomplexity with cyclocomp

No functions have cyclocomplexity >= 15

Static code analyses with lintr

lintr found the following 46 potential issues:

message number of times
Avoid library() and require() calls in packages 1
Lines should not be more than 80 characters. This line is 100 characters. 1
Lines should not be more than 80 characters. This line is 105 characters. 1
Lines should not be more than 80 characters. This line is 108 characters. 1
Lines should not be more than 80 characters. This line is 111 characters. 1
Lines should not be more than 80 characters. This line is 112 characters. 2
Lines should not be more than 80 characters. This line is 113 characters. 3
Lines should not be more than 80 characters. This line is 115 characters. 1
Lines should not be more than 80 characters. This line is 117 characters. 2
Lines should not be more than 80 characters. This line is 118 characters. 1
Lines should not be more than 80 characters. This line is 147 characters. 1
Lines should not be more than 80 characters. This line is 165 characters. 2
Lines should not be more than 80 characters. This line is 81 characters. 3
Lines should not be more than 80 characters. This line is 82 characters. 2
Lines should not be more than 80 characters. This line is 83 characters. 4
Lines should not be more than 80 characters. This line is 84 characters. 2
Lines should not be more than 80 characters. This line is 85 characters. 6
Lines should not be more than 80 characters. This line is 86 characters. 2
Lines should not be more than 80 characters. This line is 87 characters. 1
Lines should not be more than 80 characters. This line is 88 characters. 2
Lines should not be more than 80 characters. This line is 89 characters. 1
Lines should not be more than 80 characters. This line is 90 characters. 3
Lines should not be more than 80 characters. This line is 93 characters. 1
Lines should not be more than 80 characters. This line is 97 characters. 2


Package Versions

package version
pkgstats 0.2.0.54
pkgcheck 0.1.2.132


Editor-in-Chief Instructions:

This package is in top shape and may be passed on to a handling editor

@emilyriederer
Copy link

Hi @rmgpanw ! I will be the handling editor for this package.

Overall, the package looks to be in good shape to begin a review.

I note you are still not passing the check for documenting non-exported functions. From your commit, it appears you added the necessary R files but may not have rerun roxygenize (no changes to the Rd files)?

I'll proceed to look for reviewers as this should not impact their ability to engage with the code, but this might be useful to add as you are able.

@emilyriederer
Copy link

@ropensci-review-bot seeking reviewers

@ropensci-review-bot
Copy link
Collaborator

Please add this badge to the README of your package repository:

[![Status at rOpenSci Software Peer Review](https://badges.ropensci.org/705_status.svg)](https://github.com/ropensci/software-review/issues/705)

Furthermore, if your package does not have a NEWS.md file yet, please create one to capture the changes made during the review process. See https://devguide.ropensci.org/releasing.html#news

@rmgpanw
Copy link
Author

rmgpanw commented May 26, 2025

Hi @emilyriederer thanks for proceeding with the review! I have now added the rOpenSci status badge to the README.

Regarding documentation for non-exported functions, I have tagged these with @noRd (as per #705 (comment)) for now but happy of course to remove this if outputting documentation for any internal functions would be helpful.

@emilyriederer
Copy link

@ropensci-review-bot assign @AleKoure as reviewer

@ropensci-review-bot
Copy link
Collaborator

@AleKoure added to the reviewers list. Review due date is 2025-06-18. Thanks @AleKoure for accepting to review! Please refer to our reviewer guide.

rOpenSci’s community is our best asset. We aim for reviews to be open, non-adversarial, and focused on improving software quality. Be respectful and kind! See our reviewers guide and code of conduct for more.

@ropensci-review-bot
Copy link
Collaborator

@AleKoure: If you haven't done so, please fill this form for us to update our reviewers records.

@emilyriederer
Copy link

@ropensci-review-bot assign @jonclayden as reviewer

@ropensci-review-bot
Copy link
Collaborator

@jonclayden added to the reviewers list. Review due date is 2025-06-18. Thanks @jonclayden for accepting to review! Please refer to our reviewer guide.

rOpenSci’s community is our best asset. We aim for reviews to be open, non-adversarial, and focused on improving software quality. Be respectful and kind! See our reviewers guide and code of conduct for more.

@ropensci-review-bot
Copy link
Collaborator

@jonclayden: If you haven't done so, please fill this form for us to update our reviewers records.

@emilyriederer
Copy link

@rmgpanw -- Thank you for the explanation! My apologies, that's my oversight. That's good as-is.

@emilyriederer
Copy link

@rmgpanw -- I'm happy to introduce our two reviewers @jonclayden and @AleKoure. Both have backgrounds in API extraction and healthcare, so I'm grateful to bring their expertise into the review process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants