服务热线
178 0020 3020
> getwd()
[1] "C:/Users/Administrator/Desktop/R语言"
> library(ggplot2)
a<-read.csv("R2-10.csv")
ggplot(a, aes(Time,value,color =SIZE,shape = SIZE))+geom_line(color = "black")+geom_point(size=4)+ ggtitle("R2-07")
>
因为之前没有找到合适的数据,只能用第一期的数据交作业了,原谅我!
TASK two
> options(scipen=999)
> library(ggplot2)
> theme_set(theme_bw())
> data("midwest", package = "ggplot2")
> gg <- ggplot(midwest, aes(x=area, y=poptotal))+ geom_point(aes(col=state, size=popdensity))+geom_smooth(method="loess", se=F) + xlim(c(0, 0.1))+ ylim(c(0, 500000))+labs(subtitle="Area Vs Population",y="Population", x="Area", title="R2-07", caption = "Source: midwest")
> plot(gg)
Task three:
library(RColorBrewer)
> getwd()
[1] "C:/Users/Administrator/Desktop/R语言"
> a<-read.csv("task3.csv")
> a <- a[order(a$PTS),]
> row.names(a) <- a$Name
> a <- a[,2:20]
> a_matrix <- data.matrix(a)
a_heatmap <- heatmap(a_matrix, Rowv=NA, Colv=NA, col = brewer.pal(9, "Blues"), scale="column", margins=c(5,10), main="R2-07")
>
附件