Basic Visualization
Welcome to the module on basic data visualization in R. Graphical visualizations are a crucial tool in data analysis because they allow us to explore, summarize, and communicate patterns in data that would be difficult to detect through numbers alone. Well-chosen visualizations can reveal trends, clusters, correlations, and outliers at a glance, helping to guide further analysis and support clear, persuasive communication of results.
In this module, we will explore the main plotting capabilities built into base R, focusing on four foundational types of visualization: histograms, boxplots, bar plots, and scatterplots. Each section combines conceptual explanation with hands-on examples to show how to create and customize these plots in R, highlighting how they can be adapted to different datasets and analysis goals.
Base R Graphics
R includes a versatile set of built-in plotting tools that allow us to create a wide range of visualizations without the need for additional packages. With these Base R plotting functions you can produce anything from simple scatterplots and histograms to more elaborate multi-panel displays.
Plots in Base R are built up step-by-step. You begin with a main plotting function such as plot(), hist(), or boxplot(), and then refine the result by adding or adjusting titles, axis labels, colors, and other visual elements. This way of working makes Base R graphics particularly useful for exploratory analysis, where it is often important to obtain quick visual feedback.
Although more advanced plotting packages like ggplot2 offer a more structured, layered approach, Base R graphics remain useful for rapidly inspecting datasets and creating lightweight graphics without extra dependencies.
Learning Goals
After completing this module, you will be able to use Base R functions to create:
- Histograms to visualize the distributions of numeric variables
- Boxplots to summarize distributions, detect outliers, and compare groups
- Bar plots to visualize the distributions of categorical variables
- Scatterplots to investigate relationships between two numeric variables
You will also learn how to create conditional plots and how to add information to your visualizations by drawing extra layers on existing plots.
Click the button below to get started with the first tutorial.