0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rで集計表

Last updated at Posted at 2016-10-29

Rで大量の数値データを集計する方法。
通常はカテゴリカル化&summaryで事足りるが、カテゴリー数が極度に多いとそれが通用しなくなるので、以下のような面倒な方法によるしかない。

filename="hogehoge.txt" #change the filename here
filename2=paste(filename,"_summary.txt",sep="")
read.table(filename) -> data
h <- hist(data$V1,breaks=seq(min(data$V1)-0.5,max(data$V1)+0.5,1))
write.table(h$counts,filename2,quote=F,append=F,sep="\t")
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?