library(ggplot2)
setwd("~/Desktop/ZhongjunHuqmssviz/qmssviz/Lab1")
d <-read.csv("Donation-Disease.csv")
d$Death<-as.numeric(d$Death)
d$Death<-d$Death/1000
qplot(data=d,x = MoneyRaised,y=Death,color=Name)+geom_point(size=4)+geom_text(aes(label=Name),vjust=-0.7,hjust=0.3,size=4)
As we see in the scatter, there exists an imbalance in the donation and actual threaten of diseases, which different colors and labels show to us clearly. In the low and left area in plot are disease-donation relations locating in a proper level. However, the very isolated point in the top tells us that Heart Disease has the most high rate of death while the donation to it is quite limited.Meanwhile, Breast Cancer and Prostate Cancer attract major attentions but in terms of death rate have relatively lower probability of threat to human beings. Thus we can conclude in some degree that we should focus more on those common diseases, which are too common to draw public mercy.
library(RColorBrewer)
library(xlsx)
## Loading required package: rJava
## Loading required package: xlsxjars
color <- brewer.pal(5, "Reds")
setwd("~/Desktop/ZhongjunHuqmssviz/qmssviz/Lab1")
un2<-read.xlsx("UN3.xlsx",sheetName="sheet1")
un2$Population_Thousand<-cut(as.numeric(un2$X2010),breaks=c(0,2000,5000,10000,20000,Inf),labels=c("<2000","2000~5000","5000~10000","10000~15000",">15000"))
qplot(data=un2,x=Longitude,y=Latitude,color=Population_Thousand) +geom_point(size=4) +scale_color_manual(values=color)
## Warning: Removed 69 rows containing missing values (geom_point).
## Warning: Removed 69 rows containing missing values (geom_point).
I think this kind of picture of map is really stunning.The color can show the density of population and Latitude and Longitude makes the map. Population and location can be clearly put in one picture. In this map, different populations are seperated into 5 groups. A darker red poiont reflects more population at the spot. These points together depict the outlines of continents through which it is convenient to compare population in different areas. For instance, Darker points crowd in east coast of Asia as shown in the right area of the map while more light red points distribute in the low and middle position which is Africa actually.