Plotting Dot Plot
For plotting the dot plot we are going to the geom_point function present in the ggplot2 package which plots the relationship between two continuous variables.
R
library (tidyverse) mpg %>% ggplot ( aes (x=manufacturer, y=displ, color = year))+ labs (title = "Paired dot plot and box plot" )+ geom_point () |
Output:
In the above code, we added the geom_point() function which will draw the dot plot of the data. We also mapped the color aesthetic to the year attribute in the mpg data set which will ensure that every year will have a unique color. The information about which year is mapped to which color is depicted on the right side of the graph.
Plot Paired dot plot and box plot on same graph in R
R Programming Language is used for statistical computing and graphics. R was first developed at the University of Auckland by two professors Ross Ihanka and Robert Gentleman