# NOT RUN {
Income$class <- cut(Income$percent_change,
breaks = c(-Inf, 0.5, 1.0, 1.5, 2.0, Inf))
T1 <- xtabs(~class, data = Income)
T1
barplot(T1, col = "pink")
# }
# NOT RUN {
library(ggplot2)
DF <- as.data.frame(T1)
DF
ggplot2::ggplot(data = DF, aes(x = class, y = Freq)) +
geom_bar(stat = "identity", fill = "purple") +
theme_bw()
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab