1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
##(1)一组样本,每个样本一个点
df <- data.frame(dose=c("D0.5", "D1", "D2"),
len=c(4.2, 10, 29.5))
df
# dose len
# 1 D0.5 4.2
# 2 D1 10.0
# 3 D2 29.5
p1 = ggline(df, x = "dose", y = "len")
#show_line_types()
##(2)两组样本,每个样本一个点
df2 <- data.frame(supp=rep(c("VC", "OJ"), each=3),
dose=rep(c("D0.5", "D1", "D2"),2),
len=c(6.8, 15, 33, 4.2, 10, 29.5))
df2
# supp dose len
# 1 VC D0.5 6.8
# 2 VC D1 15.0
# 3 VC D2 33.0
# 4 OJ D0.5 4.2
# 5 OJ D1 10.0
# 6 OJ D2 29.5
p2 = ggline(df2, x = "dose", y = "len",
linetype = "supp",
color = "supp",
shape = "supp")
p1 | p2
|