check_pkgs_availability: Check Packages Availability

View source: R/spot-pkgs.R

check_pkgs_availabilityR Documentation

Check Packages Availability

Description

Check whether packages are available in current library.

Usage

check_pkgs_availability(pkgs, quietly = TRUE)

Arguments

pkgs

Character vector of package names. (Typically the output from spot_pkgs()).

quietly

logical: should progress and error messages be suppressed?

Value

Named logical vector indicating whether each package is available on the machine.

Examples

library(funspotr)
library(dplyr)

file_lines <- "
library(dplyr)
require(tidyr)
library(madeUpPkg)

as_tibble(mpg) %>%
  group_by(class) %>%
  nest() %>%
  mutate(stats = purrr::map(data,
                            ~lm(cty ~ hwy, data = .x)))

made_up_fun()
"

file_output <- tempfile(fileext = ".R")
writeLines(file_lines, file_output)

spot_pkgs(file_output) %>%
  check_pkgs_availability()


brshallo/funspotr documentation built on Jan. 4, 2024, 10:08 a.m.