This function extracts the version information of imported and suggested packages for a given package from the current R session.
Value
A list with two elements:
- imports
A named list of packages in the "Imports" section along with their corresponding versions
- suggests
A named list of packages in the "Suggests" section along with their corresponding versions
Examples
# \donttest{
deps_list <- data.frame(
package = c("dplyr", "ggplot2", "testthat", "knitr"),
type = c("Imports", "Imports", "Suggests", "Suggests")
)
get_session_dependencies(deps_list)
#> $imports
#> $imports$dplyr
#> [1] "1.1.4"
#>
#> $imports$ggplot2
#> [1] "No package version found"
#>
#>
#> $suggests
#> $suggests$testthat
#> [1] "3.2.1.1"
#>
#> $suggests$knitr
#> [1] "1.51"
#>
#>
# }
