服务热线
178 0020 3020
> library(ggplot2)
> tg<-ToothGrowth
> library(lattice)
> library(plyr)
> library(Rmisc)
> tgc <- summarySE(tg, measurevar="len", groupvars=c("supp","dose"))
> pd <- position_dodge(0.1)
> ggplot(tgc, aes(x=dose, y=len, colour=supp, group=supp)) + geom_errorbar(aes(ymin=len-se, ymax=len+se), colour="black", width=.1, position=pd) +geom_line(position=pd) +geom_point(position=pd, size=3, shape=21, fill="white") +xlab("Dose (mg)") +ylab("Tooth length") +scale_colour_hue(name="Supplement type",breaks=c("OJ", "VC"),labels=c("Orange juice", "Ascorbic acid"),l=40) +ggtitle("R2-40") +expand_limits(y=0) +scale_y_continuous(breaks=0:20*4) +theme_bw() +theme(legend.justification=c(1,0),legend.position=c(1,0))+theme(panel.grid.major=element_line(colour=NA))
> options(scipen = 999)
> theme_set(theme_bw())
> data("midwest",package="ggplot2")
> ggplot(midwest,aes(x=area,y=poptotal))+geom_point(aes(col=state,size=popdensity))+geom_smooth(method="loess",se=F,col="red")+xlim(c(0,0.1))+ylim(c(0,500000))+scale_color_brewer(palette = "Accent")+ggtitle("R2-40")+xlab("Area")+ylab("Population")+theme(panel.grid.major = element_blank(),panel.grid.minor = element_blank())
> library(pheatmap)
> library(gplots)
> library(ggplot2)
> mydata<-read.csv("D:\\learningr\\task3.csv",head=TRUE)
> library(reshape2)
> mydata<-mydata[order(mydata$PTS),]
> row.names(mydata)<-mydata$Name
> mydata<-mydata[,2:20]
> mydata_matrix<-data.matrix(mydata)
> plot_mydata<-heatmap(mydata_matrix, Rowv=NA, Colv=NA, col=heat.colors(256), revC=FALSE, scale="column", margins=c(5,10))
附件