Include any libraries that we are going to use
library(openintro)
Load the data
data(email50)
data(COL)
Make a dot plot
d <- email50$num_char
dotPlot(d)
Add an x label ‘Number of Characters (in thousands)’
dotPlot(d,
xlab=' ' #enter suitable x axis label between the quotes
)
Remove the y label (for this plot, since we have only one variable)
dotPlot(d,
xlab=' ', #enter suitable x axis label between the quotes
ylab=''
)
Make sure the symbols are circles (phc=20)
dotPlot(d,
xlab=' ', #enter suitable x axis label between the quotes
ylab='',
pch= 10 # change to 20
)
Give the symbols the colour you want
dotPlot(d,
xlab=' ', #enter suitable x axis label between the quotes
pch= 10, # change to 20
col="red" #or, for example, col=COL[1,2]
)
Change the symbol size
dotPlot(d,
xlab=' ', #enter suitable x axis label between the quotes
ylab='',
pch= 10, # change to 20
col="red", #or, for example, col=COL[1,2]
cex=1.5)