こういうリサイクル方法もある. sample.a <- c("A","A","A","B","B","B","B","B") c("red","blue")[as.integer(as.factor(sample.a))] A を赤に,B を緑にプロットできる