服务热线
178 0020 3020
任务1
library(ggplot2) data<- read.csv(file.choose()) p<-ggplot(data,aes(x=Time,y=value,group=SIZE))+geom_line()+geom_point(size=3,aes(colour=SIZE))+xlab("Time")+ylab("Value")+labs(title="R2-01")+geom_errorbar(aes(ymin=value-bar, ymax=value+bar),width=0.1) p+theme(legend.position='none')
任务2
library(ggplot2) g<-ggplot(midwest,aes(x=area,y=poptotal))+geom_point(aes(col=state,size=popdensity))+geom_smooth(method='loess')+xlim(c(0,0.1))+ylim(c(0,500000))+labs(title="R2-01") mytheme<- theme(panel.grid = element_blank(), panel.background=element_blank(),axis.text=element_blank(),axis.ticks = element_blank())+theme(legend.position = "bottom") g+mytheme
任务3
install.packages("RColorBrewer") library(RColorBrewer) nba <- read.csv("task3.csv", sep=",") nba <- nba[order(nba$PTS),] row.names(nba) <- nba$Name nba <- nba[,2:20] nba_matrix <- data.matrix(nba) nba_heatmap <- heatmap(nba_matrix, Rowv=NA, Colv=NA, col = brewer.pal(9, "Blues"), scale="column", margins=c(5,10))
附件