Skip to contents

This function retrieves the full URLs of files in a GitHub repository that match a specified pattern.

Usage

get_github_raw_filespath(
  repo = "tidyverse/stringr",
  branch = NULL,
  pattern = "\\.R"
)

Arguments

repo

(character) The GitHub repository in the format "owner/repo". Default is "tidyverse/stringr". Return a list if the user have passed a list of named char (each names is a repo of the list passed)

branch

(character) The branch to scan for files. Default is "main".

pattern

(character) A regex pattern to filter files (default is "\\.R", meaning R scripts). Return a list of named char if the user have passed a list of patterns (NA is returned if a pattern is not associated with github files)

Value

A character vector of URLs of the matching files (https://raw.githubusercontent.com/).

Examples

if (FALSE) { # \dontrun{
readr_fp <- get_github_raw_filespath(repo = "tidyverse/stringr", pattern = "\\.R")
} # }