R/scheme_list.R

Defines functions scheme_list

Documented in scheme_list

#' List all sinstalled schemes
#'
#' \bold{\code{scheme_list()}:} Lists all definitions for schemes which are installed. Each follows the
#' pattern \code{SCHEMENAME_SCHEMEVERSION.EXT}. All files with the same basename
#' but different extensions represent different representations of the same
#' scheme definition and are effectively equivalent, only that the tab
#' Documentation can only be found in the \code{.xls} files.
#' @return \code{data.frame} with two columns containing name and version of the intalled schemes
#'
#' @rdname scheme
#'
#' @importFrom tools file_path_sans_ext
#' @importFrom magrittr %>%
#'
#' @export
#'
scheme_list <- function() {

  result <- cache("installedSchemes") %>%
    list.dirs(full.names = FALSE, recursive = FALSE) %>%
    strsplit("_")

  result <- data.frame(
    name = sapply(result, "[[", 1),
    version = sapply(result, "[[", 2),
    stringsAsFactors = FALSE
  )

  return(result)
}

Try the dmdScheme package in your browser

Any scripts or data that you put into this service are public.

dmdScheme documentation built on Aug. 22, 2022, 9:06 a.m.