Plotting in R with graphics

Introduction

The graphics package is included with the language, meaning you won’t need to import anything at the beginning of your file. It includes a ton of useful, variably-complex plots to use on your journey of data visualization.

Examples

Make two plots, illustrating how many times that each brand of ice cream appears in the two (respective) data sets with ice cream data

Click to see solution
# read in the products file
a_df <- read.csv("/anvil/projects/tdm/data/icecream/combined/products.csv")
plot(table(a_df$brand))

# read in the reviews file
b_df <- read.csv("/anvil/projects/tdm/data/icecream/combined/reviews.csv")
plot(table(b_df$brand))