plot(), hist(), and boxplot() to create basic visualizations.We used several functions to create plots:
plot(): For scatter plots and general purpose plotting.hist(): For histograms to show data distribution.boxplot(): For boxplots to see spread and outliers.barplot(): For bar charts to compare categorical data.While powerful, base R plotting can be complex for custom and advanced plots.
gg)data to be drawn from
aesthetic mappings from data to some visual marking
geometric objects on the plot

gg)scales define the range of values
coordinates to organize location
labels describe the scale and markings
facets group into subplots
themes style the plot elements

DataAestheticsGeometric shapesScales, Coordinates, Labelsggplot2ggplot2 is based on the idea that you can build any plot from the same components: a data set, a coordinate system, and geoms (visual marks that represent data points).ggplot2 FlipbookPublication ready figures with R