R is a free, open-source programming language for statistical computing, data analysis, visualization, and machine learning. It is used to turn raw, often messy data into evidence for decisions: import and wrangle data, explore patterns, test hypotheses, fit models, and communicate results with charts and reports. section 1.0 section 1.4
R work commonly happens through packages, which extend the language with specialized functions. A practical workflow starts by installing and loading packages, then writing a script to prepare data, run an analysis, inspect outputs and warnings, and interpret findings. Base R supplies functions immediately after installation; packaged functions add much of the data-wrangling and visualization toolkit. section 1.3 section 1.1
Figure 1.1 A snapshot of the RStudio interface. Code is written in the upper-left panel; programs run in the lower-left panel; the plot window is in the lower-right panel; and a running list of created objects is in the upper-right panel. Through preferences, you can set the background color, font, and font size.
RStudio is a free IDE that runs an R session. Its Script Editor is for code, Console for output and errors, Plot window for graphics, and Environment window for created objects such as data frames and visualizations. section 1.1
R supports an end-to-end analytical workflow:
- Prepare real-world web data by importing, cleaning, reshaping, and otherwise wrangling it before analysis. section 1.0 section 1.3
- Explore and explain results with statistical tests, predictive or unsupervised-learning methods, and visualizations. section 1.0 section 1.4
- Work as an analytics layer alongside big-data technologies including Hadoop, Apache Kafka, and Apache Spark. section 1.2.4
Visualizing automobile data
The built-in mtcars data set contains 32 automobile models and 11 variables. With ggplot2 and patchwork, R can combine a correlation plot, faceted boxplots of miles per gallon, a bar chart, and a histogram into one display. The plots make relationships, grouped distributions, and frequencies easier to inspect than a table alone. section 1.2.1
A project can begin with a question or hypothesis, then move through package loading, data preparation, visualization or statistical analysis, and an interpretation of whether the evidence supports the initial expectation. This approach treats R code as part of a complete investigation rather than an isolated technique. section 1.3 section 1.0

