1

formatRを使用して次のような出力を取得する方法

data<-data.frame(response=c(48,31,24,29,46,34,25,31,45,37,27,35,37,39,30,38,45,34,29,32,
                             28,17,19,20,32,18,20,22,35,19,22,24,39,16,19,22,31,15,20,22)
                  ,treatment=rep(c("A","B","C","D"),10)
                  ,subject=rep(c("A","B","C","D","E","F","G","H","I","J"),each=4)
                  ,group=rep(c("A","B"),each=20)
                  )

次のような任意の入力から

data <- data.frame(response = c(48, 31, 24, 29, 46, 
   34, 25, 31, 45, 37, 27, 35, 37, 39, 30, 38, 45, 
   34, 29, 32, 28, 17, 19, 20, 32, 18, 20, 22, 35, 
   19, 22, 24, 39, 16, 19, 22, 31, 15, 20, 22), treatment = rep(c("A", 
   "B", "C", "D"), 10), subject = rep(c("A", "B", 
   "C", "D", "E", "F", "G", "H", "I", "J"), each = 4), 
   group = rep(c("A", "B"), each = 20))

私が欲しいのは、-2番目のdata.frameを取得します-tidy.source(filename、file = filename)を実行し、-最初のdata.frameのような形式でdata.frameを取得します。

formatRがこれらのデータを無視することを選択できれば、私も問題ありません。

4

0 に答える 0