basedf<-read.csv("dev/matma_bayes/heart.csv", header = TRUE) siha<-read.csv('dev/matma_bayes/sex_if_heart_attack.csv') df2<-read.csv('dev/matma_bayes/age_sex_heart_attack.csv') basedf$sex[basedf$sex==1]<-'Man' basedf$sex[basedf$sex==0]<-'Woman' df2$sex[df2$sex==1]<-'Man' df2$sex[df2$sex==0]<-'Woman' df2$x<-paste(df2$sex,df2$age) df2$comb<- basedf%>% count(sex)%>% arrange(n)%>% hchart(type = "pie", hcaes(x=sex, y = n, color = n), name="Quantity") %>% hc_title(text="Sex in dataset") siha%>% hchart(type = "pie", hcaes(x=sex, y = Probability, color = Probability, name='Probability')) %>% hc_title(text="Sex if heart attack") basedf%>% group_by(sex, chol)%>% count()%>% hchart('area', hcaes(x='chol', y='n', group='sex'))%>% hc_xAxis(title=list(text='Cholesterol'))%>% hc_yAxis(title=list(text='Quantity'))%>% hc_title(text="Number of terrorists attacks in each year by region") df2%>% hchart('column', hcaes(x=x, y=heart.attack, group=age))%>% hc_plotOptions(column = list(stacking = "normal"))%>% hc_xAxis(title=list(text='Age'))%>% hc_yAxis(title=list(text='Probability'))%>% hc_legend(enabled=F) hc_title(text="Probability of heart attack for sex in age group")