mean()
, median()
, mode (table()
)sd()
, var()
, iqr()
For a one stop shop: summary()
.
barplot(table(nc$premie))
ggplot(nc, aes(premie)) + geom_bar()
pie(table(nc$premie))
Pie charts = confusion
hist(nc$weight)
ggplot(nc, aes(weight)) + geom_histogram()
plot(density(nc$weight))
ggplot(nc, aes(weight)) + geom_density()
boxplot(nc$weight)
ggplot(nc, aes(y = weight, x = factor(1))) + geom_boxplot()
A measure of the strength of a linear relationship: r, the correlation coefficient (cor()
).
plot(x = nc$fage, y = nc$mage)
plot(mage ~ fage, data = nc)
ggplot(nc, aes(x = fage, y = mage)) + geom_point()
mplot(nc)