Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. > head(statistics)
  2. persnr year NOBS value
  3. 1: 61961225 1993 1 0.5777598
  4. 2: 62037645 1993 1 0.5777598
  5. 3: 62181514 1993 1 0.5777598
  6. 4: 62499451 1993 1 0.5777598
  7. 5: 62649247 1993 1 0.5777598
  8. 6: 62744472 1993 1 0.5777598
  9.  
  10. dataTable = data.table(cast(statistics, persnr ~ year, value='totalWage'))
  11. # y is the second year. Iterate over that
  12. for (y in tail(unique(statistics[, jahr]), n=-1)):
  13. # get the first year
  14. x <- y - 1
  15. dataTable[!is.na(`x`) & !is.na(`y`), `y`-`x`]
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement