服务热线
178 0020 3020
work.dir <- "F:/R Learning/exercise/R2-01-1/"
setwd(work.dir)
getwd() #check working directory
data1 <- read.csv("R2-1-1.csv",sep=',', header=TRUE)
data2 <- read.table("R2-1-2.csv",sep=',', header=TRUE)
library(ggplot2)
p <- ggplot(data1, aes(x=A, y=B,colour=SIZE))
p <- p + geom_point(size=2, shape=1)
p <- p + xlim(-2,3)+ylim(-1,3)
p <- p + labs(title = "R2-10")
p <- p + labs(x = "A gene expression", y = "B gene expression")
p
p <- ggplot(data1, aes(x=A, y=B,colour=SIZE))
p <- p + geom_point(size=2, shape=19)
p <- p + xlim(-2,3)+ylim(-1,3)
p <- p + labs(title = "R2-10")
p <- p + labs(x = "A gene expression", y = "B gene expression")
p
p <- ggplot(data1, aes(x=A, y=B,colour=SIZE))
p <- p + geom_point(size=2, shape=20)
p <- p + xlim(-2,3)+ylim(-1,3)
p <- p + labs(title = "R2-10")
p <- p + labs(x = "A gene expression", y = "B gene expression")
p
p <- ggplot(data1, aes(x=A, y=B,colour=SIZE))
p <- p + geom_point(size=2, shape=21)
p <- p + xlim(-2,3)+ylim(-1,3)
p <- p + labs(title = "R2-10")
p <- p + labs(x = "A gene expression", y = "B gene expression")
p
#exercise 2
p <- ggplot(data2, aes(x=Time, y=value))
p <- p +geom_point(aes(shape = SIZE,colour=SIZE), size=2)
p <- p + geom_line(aes(group=SIZE))
p <- p + labs(title = "R2-10")
p
附件