machinists
mean(with(machinists, rep(accidents, times = ofreq)))
var(with(machinists, rep(accidents, times = ofreq)))
barplot(with(machinists, ofreq),
names.arg = as.character(with(machinists, accidents)),
main = "Machinists accidents",
col = "lightblue", las = 1,
ylab = "Frequency", xlab = "accidents")
Run the code above in your browser using DataLab