#' Solve app reverse dependencies
#'
#' @export
#' @note Updated 2023-07-17.
#'
#' @param appName `character(1)`.
#' Application name.
#'
#' @return `character`.
#' Application names.
#'
#' @examples
#' x <- appReverseDependencies("python3.11")
#' print(x)
appReverseDependencies <- function(appName) {
json <- .importAppJson()
sysDict <- .sysDict()
assert(
isString(appName),
isSubset(appName, names(json))
)
allDeps <- Map(
name = names(json),
json = json,
MoreArgs = list(
"sysDict" = sysDict,
"keys" = "dependencies"
),
f = .getAppDeps,
USE.NAMES = TRUE
)
lgl <- unlist(Map(
table = allDeps,
MoreArgs = list("x" = appName),
f = function(x, table) {
x %in% table
}
))
if (!any(lgl)) {
return(character())
}
json <- json[lgl]
lgl <- unlist(Map(
name = names(json),
json = json,
MoreArgs = list("sysDict" = sysDict),
f = .isAppSupported
))
if (!any(lgl)) {
return(character())
}
json <- json[lgl]
out <- sort(names(json))
out
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.