服务热线
178 0020 3020
#task1
library(ggplot2)
point<-read.table("line.csv",header = T,sep = ",")
pline <- ggplot(point,aes(x=YEAR,y=POINT,color=PLAYER))+
geom_point(aes(shape=PLAYER))+
geom_line()+
theme(panel.background = element_rect(fill = "white"),
axis.line = element_line(colour = "grey50"),
legend.justification = "top")+
ggtitle("R2-12-Kobe vs James")
pline
#task2
options(scipen = 999)
theme_set(theme_bw())
p2<-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-12",
caption="Source:midwet")
p2
#task3
heat_text<-read.table("task3.csv",header = T,sep = ",")
head(heat_text)
row.names(heat_text)<-heat_text$Name
head(heat_text)
heat_text<-heat_text[1:45,2:21]
head(heat_text)
heat_m<-data.matrix(heat_text)
library(pheatmap)
pheatmap(heat_m,scale = "column",
cluster_rows = F,cluster_cols = FALSE,legend = F)
附件