Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > head(statistics)
- persnr year NOBS value
- 1: 61961225 1993 1 0.5777598
- 2: 62037645 1993 1 0.5777598
- 3: 62181514 1993 1 0.5777598
- 4: 62499451 1993 1 0.5777598
- 5: 62649247 1993 1 0.5777598
- 6: 62744472 1993 1 0.5777598
- dataTable = data.table(cast(statistics, persnr ~ year, value='totalWage'))
- # y is the second year. Iterate over that
- for (y in tail(unique(statistics[, jahr]), n=-1)):
- # get the first year
- x <- y - 1
- dataTable[!is.na(`x`) & !is.na(`y`), `y`-`x`]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement