2004年1月1日から2010年12月31日までのRの日次死亡率データの時系列を作成したいと思います。現在持っている生データ(.csvファイル)には、日-月-年とすべての行が列としてあります。死の場合です。したがって、特定の日の死亡率がたとえば4に等しい場合、その日付の行は4つあります。特定の日に死亡例が報告されていない場合、その日はデータセットで省略されます。
必要なのは、2557行(2004年1月1日から2010年12月31日まで)の時系列で、1日あたりの死亡症例の総数がリストされています。特定の日に死亡例がない場合でも、その日は「0」が割り当てられたリストに含まれている必要があります。
誰かがこれを行う方法を知っていますか?
ありがとう、ゴシア
生データの例:
day month year
1 1 2004
3 1 2004
3 1 2004
3 1 2004
6 1 2004
7 1 2004
必要なもの:
day month year deaths
1 1 2004 1
2 1 2004 0
3 1 2004 3
4 1 2004 0
5 1 2004 0
6 1 2004 1