REDCapRITS moved to Suggests

This commit is contained in:
AG Damsbo 2022-12-21 08:06:05 +01:00
parent 891a8e246d
commit 48120cad4b
3 changed files with 13 additions and 7 deletions

View File

@ -13,21 +13,23 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
LazyData: true
Suggests:
REDCapRITS (>= 0.2.2.1),
remotes,
spelling,
testthat (>= 3.0.0)
Language: en-US
Config/testthat/edition: 3
Imports:
cli,
dplyr,
ggplot2,
gtsummary,
MASS,
rankinPlot,
REDCapR,
REDCapRITS (>= 0.2.2),
stats,
tidyr
Depends:
R (>= 2.10)
Remotes:
Remotes:
agdamsbo/REDCapRITS/R

View File

@ -14,8 +14,6 @@ export(read_redcap_tables)
export(source_lines)
import(ggplot2)
importFrom(MASS,polr)
importFrom(REDCapR,redcap_read)
importFrom(REDCapRITS,REDCap_split)
importFrom(dplyr,mutate)
importFrom(dplyr,select)
importFrom(gtsummary,add_overall)

View File

@ -12,9 +12,6 @@
#'
#' @return list of instruments
#' @export
#'
#' @importFrom REDCapR redcap_read
#' @importFrom REDCapRITS REDCap_split
#'
#' @examples
#' # Examples will be provided later
@ -26,6 +23,15 @@ read_redcap_tables <- function(uri,
forms=NULL,
generics=c("record_id", "redcap_event_name", "redcap_repeat_instrument", "redcap_repeat_instance")){
if (requireNamespace("REDCapRITS", quietly = FALSE)) {
cli::cli_abort(
c("x" = "The package REDCapRITS is not installed.",
"i" = "Please install REDCapRITS by running \"remotes::install_github('agdamsbo/REDCapRITS/R')\".")
)
}
# Notes to self: Based on the metadata, this functionality could be introduced without using the REDCapRITS package.. To be tried..
d <- REDCapR::redcap_read (redcap_uri = uri,