tabla_rank = table(Salaries$rank)
prop.table(tabla_rank)
##
## AssocProf AsstProf Prof
## 0.1612091 0.1687657 0.6700252
color= paletteer_c("grDevices::Green-Brown", 30)
table(Salaries$rank)
##
## AssocProf AsstProf Prof
## 64 67 266
tabla=table(Salaries$rank)
prop.table(tabla)
##
## AssocProf AsstProf Prof
## 0.1612091 0.1687657 0.6700252
par(mfrow=c(1,2))
boxplot(Salaries$salary ~ Salaries$rank,
xlab="Salario",
col=c("#C625B7","#3AE7F9","#B214F2"),
main="Grafico de Cajas - Rango",
boxwex = 0.5,
horizontal = TRUE
)
coord= barplot(tabla,
col= color,
xlab="rank",
ylim= c(0, 350),
main="Barplot del Rank"
)
text (coord, tabla, labels=(round(tabla,1)), pos=3)
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.