R_Lattice のバックアップ差分(No.2) - アールメカブ

アールメカブ


R_Lattice のバックアップ差分(No.2)


  • 追加された行はこの色です。
  • 削除された行はこの色です。
[[Rの備忘録]]



[[Lattice:http://www.springer.com/statistics/computational/book/978-0-387-75968-5]] 翻訳メモ

テキスト p.41のコードをそのまま実行すると次のグラフが作成される.
 qqmath(~ gcsescore | gender, Chem97, groups = score, 
         aspect = "xy",  f.value = ppoints(100),
- テキスト p.41
コードをそのまま実行すると次のグラフが作成される.
#ref(lattice43.png);
 data(Chem97, package = "mlmRev")
 qqmath(~ gcsescore | gender, Chem97, 
         groups = score, aspect = "xy",  
         f.value = ppoints(100),
         auto.key = list(space = "right") ,
         xlab = "Standard Normal Quantiles", 
         ylab = "Average GCSE Score")
#ref(lattice43.png);

しかし,掲載されているのは次のような図(ただし白黒)
#ref(lattice43T.png);

 pch.col <- sort(unique(Chem97$score)) + 1 
 
 key.list <- list( space = "right",  
     text =  list(as.character(pch.col-1) ) ,  
      points = list(pch = pch.col, col = 1:6  ) )
 
 qqmath(~ gcsescore | gender, Chem97, 
         groups = score, aspect = "xy",  
         f.value = ppoints(100),  pch = pch.col ,
         col = 1:6,    key = key.list, 
         xlab = "Standard Normal Quantiles", 
         ylab = "Average GCSE Score")