library(ggplot2)
library(moments)
school <- read.csv("schools_with_computer.csv")
head(school,10)
schoolStateUT <- school[-c(108,109,110),]
ggplot(schoolStateUT) + aes(x = State_UT, weight = All.Schools) + geom_bar(fill =
"#0c4c8a") + labs(x = "States and UTs", y = "Computers", title = "Computers VS State &
UTs", subtitle = "Computers in schools in various states and UTs across 2013-16") +
theme_minimal() + theme(axis.text.x = element_text(angle = 90))
ggplot(schoolStateUT, aes(reorder(State_UT, All.Schools), All.Schools)) +
geom_col(fill = "#0c4c8a") + labs(x = "States and UTs", y = "Computers", title =
"Computers VS State & UTs (Sorted Graph)", subtitle = "Computers in schools in various
states and UTs across 2013-16") + theme_minimal() + theme(axis.text.x =
element_text(angle = 90)
ggplot(schoolStateUT) + aes(x = State_UT, weight = All.Schools) + geom_bar(fill =
"#0c4c8a") + labs(x = "States and UTs", y = "Computers", title = "Computers VS State &
UTs (Yearly)", subtitle = "Computers in schools in various states and UTs") +
coord_flip() + theme_minimal() + theme(axis.text.x = element_text(angle = 90)) +
facet_grid(vars(), vars(year)
gplot(schoolStateUT, aes(reorder(State_UT, All.Schools), All.Schools)) +
geom_col(fill = "#0c4c8a") + labs(x = "States and UTs", y = "Computers", title =
"Computers VS State & UTs (Yearly and sorted)", subtitle = "Computers in schools in
various state
gplot(schoolStateUT, aes(x = State_UT, y = All.Schools, group=1)) + geom_line() +
labs(x = "States and UTs", y = "Computers", title = "Computers VS State & UTs (Line
Graph)", subtitle = "Computers in schools in various states and UTs across 2013-16") +
theme_minimal() + theme(axis.text.x = element_text(angle = 90))
gplot(schoolStateUT, aes(reorder(State_UT, All.Schools), All.Schools, group=1)) +
geom_line() + labs(x = "States and UTs", y = "Computers", title = "Computers VS State
& UTs (Line Graph Sorted)", subtitle = "Computers in schools in various states and UTs
across 2013-16") + theme_minimal() + theme(axis.text.x = element_text(angle = 90))
)
"yellow") + labs(x = "Computers per 100 schools", y = "Density", title = "Density
g
ggplot(schoolStateUT) + aes(x = All.Schools) + geom_histogram(bins = 30L, fill =
"green") + labs(y = "", title = "Histogram") + theme_dark() + facet_wrap(vars(year))
)
30L) + labs(title = "Histogram") + scale_fill_hue() + theme_minimal() +
g
allSchool <- school["All.Schools"]
ggplot(allSchool) + aes(x = All.Schools) + geom_histogram(bins = 30L, fill =
"#0c4c8a") + theme_minimal()