MLflow docs require manually downloading win-quality.csv.
The r2d2 package docs require downloading flare.csv.
The readr package defines readr_example() to avoid downloads.
“R for Data Science” contains “data/heights.csv” in data import.
data_url <- paste0("https://raw.githubusercontent.com/",
"rstudio/r2d3/master/vignettes/gallery/",
"bubbles/flare.csv")
# automatically download
download.file(data_url)# automatically download only once
if (!file.exists("flare.csv"))
download.file(data_url, "flare.csv")Add to .gitignore? Upstream changes? Share across projects?
With pins we can easily cache resources,
"/Users/javierluraschi/Library/Caches/pins/local/flare/flare.csv"
But wait, there is more…
You can use the pins package to:
Anything!
Anywhere! – That implements the ‘board’ interface.
A storage location, like your local file systems, GitHub, Kaggle or RStudio Connect.
library(pins)
# register from RStudio
board_register_rsconnect(server = "https://my-rsc.com", account = "my-user")
# register from RStudio Connect
board_register_rsconnect(server = "https://my-rsc.com", key = Sys.getenv("RSC_API"))A pin can be anything,
A pin can also be extended!
There are many interesting use cases available for pins, from caching remote resources to creating data pipelines.