Skip to content

Instantly share code, notes, and snippets.

@yuukimiyo
Created September 17, 2014 04:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuukimiyo/1b7b848e14ce8500ea49 to your computer and use it in GitHub Desktop.
Save yuukimiyo/1b7b848e14ce8500ea49 to your computer and use it in GitHub Desktop.
R言語で年齢や月齢を計算する。 ref: http://qiita.com/YuukiMiyoshi/items/b2fc8d4c83837f204e24
length(seq(as.Date("1981/07/05"), Sys.Date(), "year"))-1
length(seq(as.Date("1981/07/05"), Sys.Date(), "month"))-1
age = floor((20140917 - 19810705) / 10000); // PHPの場合
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment