Create a demo dataset to be used for a plot.
# Sample data
set.seed(3)
sold <- sample(200:500, 12)
sold
## [1] 460 385 339 235 499 475 382 367 247 303 335 236
month <- month.name
month
## [1] "January" "February" "March" "April" "May" "June"
## [7] "July" "August" "September" "October" "November" "December"
quarter <- c(rep(1, 3), rep(2, 3),
rep(3, 3), rep(4, 3))
quarter
## [1] 1 1 1 2 2 2 3 3 3 4 4 4
# Sample dataSet
df <- data.frame(sold, month,quarter)
df
## sold month quarter
## 1 460 January 1
## 2 385 February 1
## 3 339 March 1
## 4 235 April 2
## 5 499 May 2
## 6 475 June 2
## 7 382 July 3
## 8 367 August 3
## 9 247 September 3
## 10 303 October 4
## 11 335 November 4
## 12 236 December 4
dotchart(sold)
# dotchart with customization
dotchart(sold,
pch = 19, # Symbol
col = hcl.colors(12), # Colors
pt.cex = 1.5, # Symbol size
frame.plot = TRUE) # Plot frame
# dotchart with customization with Labels
dotchart(sold,
pch = 19,
col = 4,
pt.cex = 1.5,
frame.plot = TRUE,
labels = month)