teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

syuusei

2021/03/23 02:28

投稿

rm13579
rm13579

スコア0

answer CHANGED
@@ -2,6 +2,8 @@
2
2
  patient = c("1","1","2","2","3","3","4","4")
3
3
  score = c(3,6,5,7,7,10,4,8)
4
4
  library(ggplot2)
5
+
6
+ x$time <- factor(x$time, levels = c("pre", "post"))
5
7
 
6
8
  x = data.frame(time, patient, score)
7
9
 

1

syuusei

2021/03/23 02:28

投稿

rm13579
rm13579

スコア0

answer CHANGED
@@ -1,11 +1,11 @@
1
1
  time = c("pre","post","pre","post","pre","post","pre","post")
2
2
  patient = c("1","1","2","2","3","3","4","4")
3
- lumen = c(3,6,5,7,7,10,4,8)
3
+ score = c(3,6,5,7,7,10,4,8)
4
4
  library(ggplot2)
5
5
 
6
- x = data.frame(time, patient, lumen)
6
+ x = data.frame(time, patient, score)
7
7
 
8
- g = ggplot(x, aes(x = time, y = lumen,group=patient) ) +
8
+ g = ggplot(x, aes(x = time, y = score, group=patient) ) +
9
9
  geom_line() +
10
10
  geom_point()
11
11