次のようなデータがあります。
#d TRUE FALSE Cutoff
4 28198 0 0.1
4 28198 0 0.2
4 28198 0 0.3
4 28198 13 0.4
4 28251 611 0.5
4 28251 611 0.6
4 28251 611 0.7
4 28251 611 0.8
4 28251 611 0.9
4 28251 611 1
6 19630 0 0
6 19630 0 0.1
6 19630 0 0.2
6 19630 0 0.3
6 19630 0 0.4
6 19636 56 0.5
6 19636 56 0.6
6 19636 56 0.7
6 19636 56 0.8
6 19636 56 0.9
6 19636 56 1
そこで、True(Y軸)とFalse(X軸)に基づいてプロットしたいと思います。
これが私が大まかに見せたい方法です。
それを行う正しい方法は何ですか?以下の私のコードは失敗します
dat<-read.table("mydat.txt", header=F);
dis <- c(4,6);
linecols <-c("red","blue");
plot(dat$V2 ~ dat$V3, data = dat, xlim = c(0,611),ylim =c(0,28251), type="l")
for (i in 1:length(dis)){
datax <- subset(dat, dat$V1==dis[i], select = c(dat$V2,dat$V3))
lines(datax,lty=1,type="l",col=linecols[i]);
}