In most data science applications, preparing the data is at least half the job. Finding where the data lives, figuring out how to access it, finding the right records, filtering, cleaning and transforming the data … all of this has to be done before the statistical analysis can even begin.
Fortunately, the R language has many tools for data processing, and there's a great example of those tools in action at the PremierSoccerStats blog. There you can see R code that accesses public data (climate data from the Ontario Ministry of the Environment) and performs several data processing steps to create the chart below.
PremierSoccerStats: Processing Public Data with R