source_conn_path: static url / directory. This helper determines whether source_conn is a file path or URL and creates the full path to the the file as needed based on the type of source_conn.
source_conn_github: static GitHub API url / git directory. This helper determines whether source_conn is a git directory or a GitHub API creates the full path to the the file as needed based on the type of source_conn.
A GitHub token can be configured in the "GITHUB_PAT" environment variable to avoid rate limiting.
If the basename of the requested file contains a date, the function will use fuzzy-matching to determine the closest matching, chronologically earlier, file location to return.
Examples
# Simulating a data directory
source_conn <- "data_dir"
dir.create(source_conn)
write.csv(mtcars, file.path(source_conn, "mtcars.csv"))
write.csv(iris, file.path(source_conn, "iris.csv"))
# Get file path for mtcars.csv
source_conn_path(source_conn, "mtcars.csv")
#> [1] "data_dir/mtcars.csv"
# Clean up
unlink(source_conn, recursive = TRUE)