diff --git a/DESCRIPTION b/DESCRIPTION index 3739c9f..a802cf6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,8 +13,10 @@ Authors@R: role = c("aut", "cre"), email = "luca.belmonte@efsa.europa.eu", comment = c(ORCID = "0000-0002-7977-9170"))) -Description: Provides tools for dataset operations as well as utilities - designed to preserve data history within EFSA's ad hoc data collections. +Description: Provides tools for dataset operations and utilities designed to + preserve data history within EFSA's ad hoc data collections. It also + imports packages developed by EFSA that provide additional support for data + collection activities. License: EUPL-1.2 URL: https://openefsa.github.io/EFSATools/ BugReports: https://github.com/openefsa/EFSATools/issues @@ -26,7 +28,9 @@ Imports: glue (>= 1.7.0), rlang (>= 1.1.4), stringr (>= 1.5.1), - tidyr (>= 1.3.1) + tidyr (>= 1.3.1), + eppoFindeR (>= 2.0.0), + distilleR (>= 1.0.0) Suggests: devtools (>= 2.4.5), tibble (>= 3.3.0), @@ -35,7 +39,8 @@ Suggests: rmarkdown (>= 2.0), testthat (>= 3.0.0), usethis (>= 2.2.3), - roxygen2 (>= 7.2.1) + roxygen2 (>= 7.2.1), + cli (>= 3.6.5) Encoding: UTF-8 LazyData: true RoxygenNote: 7.3.3 diff --git a/NAMESPACE b/NAMESPACE index 23beaea..2d9d35f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,6 +5,8 @@ export(SSCD2) export(dropEmpty) export(enrich) export(removeReplicatedColumns) +import(distilleR) +import(eppoFindeR) importFrom(checkmate,assert_data_frame) importFrom(checkmate,assert_names) importFrom(checkmate,assert_string) diff --git a/R/EFSATools-package.R b/R/EFSATools-package.R index a65cf64..ad6d79a 100644 --- a/R/EFSATools-package.R +++ b/R/EFSATools-package.R @@ -2,5 +2,7 @@ "_PACKAGE" ## usethis namespace: start +#' @import eppoFindeR +#' @import distilleR ## usethis namespace: end NULL diff --git a/R/attach.R b/R/attach.R new file mode 100644 index 0000000..90e6c47 --- /dev/null +++ b/R/attach.R @@ -0,0 +1,64 @@ +core <- c( + "eppoFindeR", + "distilleR" +) + +.coreUnloaded <- function() { + search_ <- paste0("package:", core) + + return(core[!search_ %in% search()]) +} + +# Attach the package from the same package library it was loaded from before. +.sameLibrary <- function(pkg) { + loc_ <- if (pkg %in% loadedNamespaces()) dirname( + getNamespaceInfo(pkg, "path")) + + library(pkg, lib.loc = loc_, character.only = TRUE, warn.conflicts = FALSE) +} + +.efsaToolsAttach <- function() { + toLoad_ <- .coreUnloaded() + + suppressPackageStartupMessages( + lapply(toLoad_, .sameLibrary) + ) + + invisible(toLoad_) +} + +.efsaToolsAttachMessage <- function(toLoad) { + if (length(toLoad) == 0) { + return(NULL) + } + + header_ <- cli::rule( + left = cli::style_bold("Attaching core EFSATools packages"), + right = paste0("EFSATools ", .packageVersionStr("EFSATools")) + ) + + toLoad <- sort(toLoad) + versions_ <- vapply(toLoad, .packageVersionStr, character(1)) + + packages_ <- paste0( + cli::col_green(cli::symbol$tick), + ' ', + cli::col_blue(format(toLoad)), + ' ', + cli::ansi_align(versions_, max(cli::ansi_nchar(versions_))) + ) + + if (length(packages_) %% 2 == 1) { + packages_ <- append(packages_, '') + } + col1_ <- seq_len(length(packages_) / 2) + info_ <- paste0(packages_[col1_], " ", packages_[-col1_]) + + paste0(header_, '\n', paste(info_, collapse = '\n')) +} + +.packageVersionStr <- function(pkg) { + v_ <- as.character(utils::packageVersion(pkg)) + + return(v_) +} diff --git a/R/utils.R b/R/utils.R new file mode 100644 index 0000000..d846699 --- /dev/null +++ b/R/utils.R @@ -0,0 +1,7 @@ +.informStartup <- function(msg, ...) { + if (is.null(msg)) { + return() + } + + rlang::inform(msg, ..., class = "packageStartupMessage") +} diff --git a/R/zzz.R b/R/zzz.R new file mode 100644 index 0000000..7d9e5b0 --- /dev/null +++ b/R/zzz.R @@ -0,0 +1,4 @@ +.onAttach <- function(...) { + attached_ <- .efsaToolsAttach() + .informStartup(.efsaToolsAttachMessage(attached_)) +} diff --git a/README.md b/README.md index 1f0d8bf..0ad5425 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,18 @@ The **EFSATools** package brings together all the functions developed for EFSA's The package is intended for researchers, analysts, and practitioners who require convenient programmatic access to data collection utilities. +During installation, the following packages developed by EFSA are also installed: +- **eppoFindeR** - [Website](https://openefsa.github.io/eppoFindeR/) | [CRAN](https://cran.r-project.org/package=eppoFindeR). +- **distilleR** - [Website](https://openefsa.github.io/distilleR/) | [CRAN](https://cran.r-project.org/package=distilleR). + +These packages are not required to use **EFSATools**, but are included for convenience and can be used directly in the code if needed, for example: + +```r +eppoTaxons <- eppoFindeR::taxons() +# and/or +distillerToken <- distilleR::getAuthenticationToken() +``` + ## Installation ### From CRAN diff --git a/man/EFSATools-package.Rd b/man/EFSATools-package.Rd index 30f4937..c86bab1 100644 --- a/man/EFSATools-package.Rd +++ b/man/EFSATools-package.Rd @@ -8,7 +8,7 @@ \description{ \if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} -Provides tools for dataset operations as well as utilities designed to preserve data history within EFSA's ad hoc data collections. +Provides tools for dataset operations and utilities designed to preserve data history within EFSA's ad hoc data collections. It also imports packages developed by EFSA that provide additional support for data collection activities. } \seealso{ Useful links: diff --git a/renv.lock b/renv.lock index ababfa0..462dd67 100644 --- a/renv.lock +++ b/renv.lock @@ -89,6 +89,16 @@ ], "Hash": "d4335fe7207f1c01ab8c41762f5840d4" }, + "RColorBrewer": { + "Package": "RColorBrewer", + "Version": "1.1-3", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R" + ], + "Hash": "45f0398006e83a5b10b72a90663d8d8c" + }, "Rcpp": { "Package": "Rcpp", "Version": "1.1.0", @@ -100,6 +110,17 @@ ], "Hash": "0d3d8867aa41b0d9ad113b50c169ecb2" }, + "S7": { + "Package": "S7", + "Version": "0.2.2", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "utils" + ], + "Hash": "6a72e94a8c9be4ef719af3aa3628f2dc" + }, "askpass": { "Package": "askpass", "Version": "1.2.1", @@ -196,6 +217,27 @@ ], "Hash": "c1ee497a6d999947c2c224ae46799b1a" }, + "broom": { + "Package": "broom", + "Version": "1.0.12", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "backports", + "cli", + "dplyr", + "generics", + "glue", + "lifecycle", + "purrr", + "rlang", + "stringr", + "tibble", + "tidyr" + ], + "Hash": "6cf2f6757591ea712c57c5d7bedc3c27" + }, "bslib": { "Package": "bslib", "Version": "0.9.0", @@ -242,6 +284,18 @@ ], "Hash": "d7e13f49c19103ece9e58ad2d83a7354" }, + "cellranger": { + "Package": "cellranger", + "Version": "1.1.0", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "rematch", + "tibble" + ], + "Hash": "f61dbaec772ccd2e17705c1e872e9e7c" + }, "checkmate": { "Package": "checkmate", "Version": "2.3.3", @@ -319,6 +373,19 @@ "Repository": "RSPM", "Hash": "8cba62334c1088d21689d353a7e87663" }, + "conflicted": { + "Package": "conflicted", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cli", + "memoise", + "rlang" + ], + "Hash": "bb097fccb22d156624fd07cd2894ddb6" + }, "covr": { "Package": "covr", "Version": "3.6.5", @@ -398,6 +465,17 @@ ], "Hash": "aa27e963d3deccf4bade44d06b976977" }, + "data.table": { + "Package": "data.table", + "Version": "1.18.2.1", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "methods" + ], + "Hash": "df99cd4333ce592df5173d6ad39b5c14" + }, "dbplyr": { "Package": "dbplyr", "Version": "2.5.1", @@ -499,6 +577,24 @@ ], "Hash": "d18028e978a88b2b16ef8d400cb49adf" }, + "distilleR": { + "Package": "distilleR", + "Version": "1.0.0", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "checkmate", + "cli", + "glue", + "httr2", + "jsonlite", + "readr", + "readxl", + "tibble" + ], + "Hash": "27303ee77dcf645153ab5c0b0ef9fa15" + }, "downlit": { "Package": "downlit", "Version": "0.4.5", @@ -521,7 +617,7 @@ }, "dplyr": { "Package": "dplyr", - "Version": "1.1.4", + "Version": "1.2.1", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -540,7 +636,26 @@ "utils", "vctrs" ], - "Hash": "fedd9d00c2944ff00a0e2696ccf048ec" + "Hash": "d71f190466b9496cf8543c76641be5cf" + }, + "dtplyr": { + "Package": "dtplyr", + "Version": "1.3.3", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cli", + "data.table", + "dplyr", + "glue", + "lifecycle", + "rlang", + "tibble", + "tidyselect", + "vctrs" + ], + "Hash": "7f6db50cf8183cce63c06510fc74a318" }, "ellipsis": { "Package": "ellipsis", @@ -553,6 +668,24 @@ ], "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077" }, + "eppoFindeR": { + "Package": "eppoFindeR", + "Version": "2.0.0", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "checkmate", + "cli", + "dplyr", + "glue", + "httr2", + "jsonlite", + "purrr", + "tibble" + ], + "Hash": "65516d2f0714dd343ee80a3ce01e2b36" + }, "evaluate": { "Package": "evaluate", "Version": "1.0.5", @@ -575,6 +708,13 @@ ], "Hash": "17986671536180cabd08d6309755af85" }, + "farver": { + "Package": "farver", + "Version": "2.1.2", + "Source": "Repository", + "Repository": "RSPM", + "Hash": "680887028577f3fa2a81e410ed0d6e42" + }, "fastmap": { "Package": "fastmap", "Version": "1.2.0", @@ -594,6 +734,22 @@ ], "Hash": "bd1297f9b5b1fc1372d19e2c4cd82215" }, + "forcats": { + "Package": "forcats", + "Version": "1.0.1", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cli", + "glue", + "lifecycle", + "magrittr", + "rlang", + "tibble" + ], + "Hash": "f884a14605c6a9eb01db676eee793ba7" + }, "foreign": { "Package": "foreign", "Version": "0.8-86", @@ -618,6 +774,28 @@ ], "Hash": "7eb1e342eee7e0a7449c49cdaa526d39" }, + "gargle": { + "Package": "gargle", + "Version": "1.6.1", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cli", + "fs", + "glue", + "httr", + "jsonlite", + "lifecycle", + "openssl", + "rappdirs", + "rlang", + "stats", + "utils", + "withr" + ], + "Hash": "99e4f3f00be5075372bb650a3e237a71" + }, "generics": { "Package": "generics", "Version": "0.1.4", @@ -644,6 +822,28 @@ ], "Hash": "0fa6acb04daaafc762fe9524fa6f3457" }, + "ggplot2": { + "Package": "ggplot2", + "Version": "4.0.3", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "S7", + "cli", + "grDevices", + "grid", + "gtable", + "isoband", + "lifecycle", + "rlang", + "scales", + "stats", + "vctrs", + "withr" + ], + "Hash": "98520fe6b2745c466dca8e46aaa86242" + }, "gh": { "Package": "gh", "Version": "1.5.0", @@ -674,14 +874,104 @@ }, "glue": { "Package": "glue", - "Version": "1.8.0", + "Version": "1.8.1", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "R", "methods" ], - "Hash": "5899f1eaa825580172bb56c08266f37c" + "Hash": "f8122473e9a49e00d0642f78235ca5e3" + }, + "googledrive": { + "Package": "googledrive", + "Version": "2.1.2", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cli", + "gargle", + "glue", + "httr", + "jsonlite", + "lifecycle", + "magrittr", + "pillar", + "purrr", + "rlang", + "tibble", + "utils", + "uuid", + "vctrs", + "withr" + ], + "Hash": "292be194aa519482c4b83f488a818ba3" + }, + "googlesheets4": { + "Package": "googlesheets4", + "Version": "1.1.2", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cellranger", + "cli", + "curl", + "gargle", + "glue", + "googledrive", + "httr", + "ids", + "lifecycle", + "magrittr", + "methods", + "purrr", + "rematch2", + "rlang", + "tibble", + "utils", + "vctrs", + "withr" + ], + "Hash": "376adbf359b416dbb30a76a2d2051ed5" + }, + "gtable": { + "Package": "gtable", + "Version": "0.3.6", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cli", + "glue", + "grid", + "lifecycle", + "rlang", + "stats" + ], + "Hash": "de949855009e2d4d0e52a844e30617ae" + }, + "haven": { + "Package": "haven", + "Version": "2.5.5", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cli", + "cpp11", + "forcats", + "hms", + "lifecycle", + "methods", + "readr", + "rlang", + "tibble", + "tidyselect", + "vctrs" + ], + "Hash": "437bc7804f8ffdfcfed38d0aead6a9d7" }, "highr": { "Package": "highr", @@ -791,6 +1081,17 @@ ], "Hash": "6e29f1ed132b927f7d52e9fd8869f0ea" }, + "ids": { + "Package": "ids", + "Version": "1.0.1", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "openssl", + "uuid" + ], + "Hash": "99df65cfef20e525ed38c3d2577f7190" + }, "ini": { "Package": "ini", "Version": "0.3.1", @@ -798,6 +1099,20 @@ "Repository": "RSPM", "Hash": "6154ec2223172bce8162d4153cda21f7" }, + "isoband": { + "Package": "isoband", + "Version": "0.3.0", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "cli", + "cpp11", + "grid", + "rlang", + "utils" + ], + "Hash": "0f9a864bbd7ce0232ad05cb76249cc1a" + }, "janitor": { "Package": "janitor", "Version": "2.2.1", @@ -856,6 +1171,17 @@ ], "Hash": "27682babb50f03b6eb7939ea69ec79ca" }, + "labeling": { + "Package": "labeling", + "Version": "0.4.3", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "graphics", + "stats" + ], + "Hash": "b64ec208ac5bc1852b285f665d6368b3" + }, "later": { "Package": "later", "Version": "1.4.4", @@ -894,16 +1220,15 @@ }, "lifecycle": { "Package": "lifecycle", - "Version": "1.0.4", + "Version": "1.0.5", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "cli", - "glue", "rlang" ], - "Hash": "b8552d117e1b808b09a832f589b79035" + "Hash": "36dbfe4fba6c064db50a671a90297c85" }, "lubridate": { "Package": "lubridate", @@ -978,6 +1303,24 @@ ], "Hash": "96b7fedb0964cc6b86631fb2fee23afa" }, + "modelr": { + "Package": "modelr", + "Version": "0.1.11", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "broom", + "magrittr", + "purrr", + "rlang", + "tibble", + "tidyr", + "tidyselect", + "vctrs" + ], + "Hash": "4f50122dc256b1b6996a4703fecea821" + }, "nlme": { "Package": "nlme", "Version": "3.1-164", @@ -1178,6 +1521,20 @@ ], "Hash": "bffa126bf92987e677c12cfb5651fc1d" }, + "progress": { + "Package": "progress", + "Version": "1.2.3", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "R6", + "crayon", + "hms", + "prettyunits" + ], + "Hash": "f4625e061cb2865f111b47ff163a5ca6" + }, "promises": { "Package": "promises", "Version": "1.5.0", @@ -1264,6 +1621,63 @@ ], "Hash": "8f25ebe2ec38b1f2aef3b0d2ef76f6c4" }, + "readr": { + "Package": "readr", + "Version": "2.2.0", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "R6", + "cli", + "clipr", + "cpp11", + "crayon", + "glue", + "hms", + "lifecycle", + "methods", + "rlang", + "tibble", + "tzdb", + "utils", + "vroom", + "withr" + ], + "Hash": "4425ad9e28b8e3351184ca2739995b87" + }, + "readxl": { + "Package": "readxl", + "Version": "1.4.5", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cellranger", + "cpp11", + "progress", + "tibble", + "utils" + ], + "Hash": "18948de59f05d38a44d3e5065a76b4b6" + }, + "rematch": { + "Package": "rematch", + "Version": "2.0.0", + "Source": "Repository", + "Repository": "RSPM", + "Hash": "cbff1b666c6fa6d21202f07e2318d4f1" + }, + "rematch2": { + "Package": "rematch2", + "Version": "2.1.2", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "tibble" + ], + "Hash": "76c9e04c712a05848ae7a23d2f170a40" + }, "remotes": { "Package": "remotes", "Version": "2.5.0", @@ -1288,6 +1702,28 @@ ], "Hash": "41b847654f567341725473431dd0d5ab" }, + "reprex": { + "Package": "reprex", + "Version": "2.1.1", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "callr", + "cli", + "clipr", + "fs", + "glue", + "knitr", + "lifecycle", + "rlang", + "rmarkdown", + "rstudioapi", + "utils", + "withr" + ], + "Hash": "97b1d5361a24d9fb588db7afe3e5bcbf" + }, "rex": { "Package": "rex", "Version": "1.2.1", @@ -1300,18 +1736,18 @@ }, "rlang": { "Package": "rlang", - "Version": "1.1.7", + "Version": "1.2.0", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "R", "utils" ], - "Hash": "34c0d101f4613098abc538b82e0d86c5" + "Hash": "f88151fb9ca15e72dc351deb1328716e" }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.30", + "Version": "2.31", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -1330,7 +1766,7 @@ "xfun", "yaml" ], - "Hash": "efe19db0fde0fff13cea7eec6f695021" + "Hash": "f34039d57d861d2869cbf9be813ed08e" }, "roxygen2": { "Package": "roxygen2", @@ -1398,6 +1834,25 @@ ], "Hash": "e1ebbf6f3ffcf42e12f84d4ebab350d0" }, + "rvest": { + "Package": "rvest", + "Version": "1.0.5", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cli", + "glue", + "httr", + "lifecycle", + "magrittr", + "rlang", + "selectr", + "tibble", + "xml2" + ], + "Hash": "2804ddcd7737082306c559d919886546" + }, "sass": { "Package": "sass", "Version": "0.4.10", @@ -1412,6 +1867,38 @@ ], "Hash": "3fb78d066fb92299b1d13f6a7c9a90a8" }, + "scales": { + "Package": "scales", + "Version": "1.4.0", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "R6", + "RColorBrewer", + "cli", + "farver", + "glue", + "labeling", + "lifecycle", + "rlang", + "viridisLite" + ], + "Hash": "c5bba8f0d1df8c4b9538a40570798d9b" + }, + "selectr": { + "Package": "selectr", + "Version": "0.5-1", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "R6", + "methods", + "stringr" + ], + "Hash": "fb6f4aacfcc16539458c66b698339e69" + }, "sessioninfo": { "Package": "sessioninfo", "Version": "1.2.3", @@ -1609,7 +2096,7 @@ }, "tibble": { "Package": "tibble", - "Version": "3.3.0", + "Version": "3.3.1", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -1624,11 +2111,11 @@ "utils", "vctrs" ], - "Hash": "784b27d0801c3829de602105757b2cd7" + "Hash": "c55df870972551cac674b50cadb2d51f" }, "tidyr": { "Package": "tidyr", - "Version": "1.3.1", + "Version": "1.3.2", "Source": "Repository", "Repository": "RSPM", "Requirements": [ @@ -1647,7 +2134,7 @@ "utils", "vctrs" ], - "Hash": "915fb7ce036c22a6a33b5a8adb712eb1" + "Hash": "a4fa2f5876396f04814cb9d8d9ab89e9" }, "tidyselect": { "Package": "tidyselect", @@ -1665,6 +2152,46 @@ ], "Hash": "829f27b9c4919c16b593794a6344d6c0" }, + "tidyverse": { + "Package": "tidyverse", + "Version": "2.0.0", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "broom", + "cli", + "conflicted", + "dbplyr", + "dplyr", + "dtplyr", + "forcats", + "ggplot2", + "googledrive", + "googlesheets4", + "haven", + "hms", + "httr", + "jsonlite", + "lubridate", + "magrittr", + "modelr", + "pillar", + "purrr", + "ragg", + "readr", + "readxl", + "reprex", + "rlang", + "rstudioapi", + "rvest", + "stringr", + "tibble", + "tidyr", + "xml2" + ], + "Hash": "c328568cd14ea89a83bd4ca7f54ae07e" + }, "timechange": { "Package": "timechange", "Version": "0.3.0", @@ -1686,6 +2213,17 @@ ], "Hash": "03af3ad04817f3019de8ee5c73dab807" }, + "tzdb": { + "Package": "tzdb", + "Version": "0.5.0", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cpp11" + ], + "Hash": "09e3961e87b7bafa4a9340bbb34aeda8" + }, "urlchecker": { "Package": "urlchecker", "Version": "1.0.1", @@ -1742,11 +2280,21 @@ ], "Hash": "d526d558be176e9ceb68c3d1e83479b7" }, + "uuid": { + "Package": "uuid", + "Version": "1.2-2", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R" + ], + "Hash": "528fc9e90d70a6a115e21164f37b2c64" + }, "vctrs": { "Package": "vctrs", - "Version": "0.6.5", + "Version": "0.7.3", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "cli", @@ -1754,7 +2302,43 @@ "lifecycle", "rlang" ], - "Hash": "c03fa420630029418f7e6da3667aac4a" + "Hash": "2dcde2d30d3ad67bf1d3a37177457b87" + }, + "viridisLite": { + "Package": "viridisLite", + "Version": "0.4.3", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R" + ], + "Hash": "9380d36888b72faf5ae6c22b44703867" + }, + "vroom": { + "Package": "vroom", + "Version": "1.7.1", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "bit64", + "cli", + "cpp11", + "crayon", + "glue", + "hms", + "lifecycle", + "methods", + "progress", + "rlang", + "stats", + "tibble", + "tidyselect", + "tzdb", + "vctrs", + "withr" + ], + "Hash": "1e9494eda38f3418f71474363293da2a" }, "waldo": { "Package": "waldo", diff --git a/tests/testthat/test-attach.R b/tests/testthat/test-attach.R new file mode 100644 index 0000000..56737c3 --- /dev/null +++ b/tests/testthat/test-attach.R @@ -0,0 +1,8 @@ +test_that("If no packages, shows nothing", { + expect_null(.efsaToolsAttachMessage(character())) +}) + +test_that("Runs correctly with an odd number of packages", { + local_mocked_bindings(.packageVersionStr = function(x) "1.0.0") + checkmate::expect_character(.efsaToolsAttachMessage(c("a", "b", "c"))) +}) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R new file mode 100644 index 0000000..e8e3e7f --- /dev/null +++ b/tests/testthat/test-utils.R @@ -0,0 +1,3 @@ +test_that("If no message, does nothing", { + expect_null(.informStartup(NULL)) +}) diff --git a/vignettes/EFSATools.Rmd b/vignettes/EFSATools.Rmd index 6726dac..a745e70 100644 --- a/vignettes/EFSATools.Rmd +++ b/vignettes/EFSATools.Rmd @@ -20,6 +20,18 @@ The **EFSATools** package brings together all the functions developed for EFSA's The package is intended for researchers, analysts, and practitioners who require convenient programmatic access to data collection utilities. +During installation, the following packages developed by EFSA are also installed: +- **eppoFindeR** - [Website](https://openefsa.github.io/eppoFindeR/) | [CRAN](https://cran.r-project.org/package=eppoFindeR). +- **distilleR** - [Website](https://openefsa.github.io/distilleR/) | [CRAN](https://cran.r-project.org/package=distilleR). + +These packages are not required to use **EFSATools**, but are included for convenience and can be used directly in the code if needed, for example: + +```{r eval=FALSE} +eppoTaxons <- eppoFindeR::taxons() +# and/or +distillerToken <- distilleR::getAuthenticationToken() +``` + ## Installation ### From CRAN