Learn R Programming

funspotr (version 0.0.5)

spot_funs_files: Spot Packages or Functions in dataframe of Paths

Description

spot_pkgs_files() : Spot all packages that show-up in R or Rmarkdown or quarto documents in a dataframe of filepaths.

spot_funs_files() : Spot all functions and their corresponding packages that show-up in R or Rmarkdown or quarto documents in a dataframe of filepaths.

Usage

spot_funs_files(df, ..., .progress = TRUE)

spot_pkgs_files(df, ..., .progress = TRUE)

Value

Dataframe with relative_paths and absolute_paths of file paths along with a list-column spotted containing purrr::safely() named list of "result" and "error" for each file parsed. Use unnest_results() to unnest only the "result" values.

Arguments

df

Dataframe containing a column of absolute_paths.

...

Arguments passed onto spot_{pkgs|funs}().

.progress

Whether to show a progress bar. Use TRUE to turn on a basic progress bar, use a string to give it a name, or see progress_bars for more details.

Details

A purrr::safely() wrapper for mapping spot_pkgs() or spot_funs() across multiple filepaths. I.e. even if some files fail to parse the function will continue on.

Default settings are meant for files where package libraries are referenced within the files themselves. See README for more details.

See Also

spot_pkgs(), spot_funs(), unnest_results()

Examples

Run this code
if (FALSE) {
library(funspotr)
library(dplyr)

list_files_github_repo("brshallo/feat-eng-lags-presentation", branch = "main") %>%
  spot_funs_files()
}

Run the code above in your browser using DataLab