Empty category in box plot
df <- data.frame(length=1:100,
year=c(rep(1980, 20), rep(1981, 20), rep(1983, 20), rep(1984, 20), rep(1985, 20)))
boxplot(length ~ year, df)
# Not good !
df$year <- factor(df$year, levels = 1980:1985)
boxplot(length ~ year, df)
year=c(rep(1980, 20), rep(1981, 20), rep(1983, 20), rep(1984, 20), rep(1985, 20)))
boxplot(length ~ year, df)
# Not good !
df$year <- factor(df$year, levels = 1980:1985)
boxplot(length ~ year, df)
Commentaires
Enregistrer un commentaire