R: filling up data gaps with NAs and applying cumsum function
问题 It was requested that I would break down my question asked here (R: Applying cumulative sum function and filling data gaps with NA for plotting) a little and post a smaller sample. Here it is and here you can find my sample data: https://dl.dropboxusercontent.com/u/16277659/inputdata.csv NAME; ID; SURVEY_YEAR; REFERENCE_YEAR; VALUE SAMPLE1; 253; 1883; 1883; 0 SAMPLE1; 253; 1884; 1883; NA SAMPLE1; 253; 1885; 1884; 12 SAMPLE1; 253; 1890; 1889; 17 SAMPLE2; 261; 1991; 1991; 0 SAMPLE2; 261; 1992;