Visuslization of the prevalence of common diseases in Trichy
library(plotly)
library(dplyr)
library(readxl)
disease<-read_excel("C:/Users/Janani Selvaraj/Downloads/Diseasse modeling new.xlsx")
top<-disease %>% group_by(Disease) %>% summarise(total=sum(Count))%>% top_n(10)
ggplot(top,aes(reorder(Disease, -total),total))+geom_bar(aes(fill=Disease),stat="identity")+theme(axis.text.x = element_text(angle = 90, hjust = 1)) +xlab("Disease")

disease[disease$Disease %in% c("Fever","ADD","PUO","Dengue","Other Viral Fever","Scrub Typhus","Leptospirosis","Dog-Bite","Cholera","Chickun Guinea"),]<-NA
disease1<-na.omit(disease)
disease1[disease1$Count<=5,]<-NA
key<-crosstalk::SharedData$new(disease1,~Disease)
p <- plot_ly(disease1, y = ~Disease, color = ~Disease,
boxpoints = "suspectedoutliers")
p1 <- p %>% add_boxplot(x = ~Count) %>%
add_boxplot(data = key, frame = ~Year, ids = ~Disease)
p1
library(tidyr)
library(dplyr)
disease<-read_excel("C:/Users/Janani Selvaraj/Downloads/Diseasse modeling new.xlsx")
disease[disease$Disease %in% c("Fever","ADD","PUO","Dengue","Other Viral Fever","Scrub Typhus","Leptospirosis","Dog-Bite","Cholera","Chickun Guinea"),]<-NA
disease1<-na.omit(disease)
disease1$Month <- factor(disease1$Month)
levels(disease1$Month) <- month.abb
zp <- ggplot(disease1,
aes(x = Year, y = Count))
zp <- zp + geom_bar(aes(fill=Disease),stat = "identity") # Drawing the "overlayer"
zp <- zp + facet_wrap(~ Month)
zp <- zp + theme_bw()
zp
