1 Overview
One of the most common reproducibility barriers in data-driven science isn’t in the analysis code itself, but rather in how data gets loaded in the first place. A script full of hardcoded file paths like read_csv("C:/Users/jsmith/Desktop/data_final_v3.csv") might work perfectly on one machine and fail immediately on every other.
Getting data programmatically – directly in your code, from a remote source – solves this problem. In this session, we’ll move from ad-hoc data downloads to systematic, reproducible data access. We’ll learn a caching pattern for downloading files reliably, then use the dataRetrieval package to retrieve and visualize USGS streamflow data from monitoring stations. Along the way, we’ll peek under the hood at how web APIs work.