Advertisement
celestialgod

mapvalues chinese time

Nov 27th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.31 KB | None | 0 0
  1. set.seed(1172)
  2. hr <- sample(0:23,10000,replace=T)
  3. test = plyr:::mapvalues(hr, 0:23, c("子",rep(c("丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"),,, 2), "子"))
  4. table(test)
  5. # test
  6. #  子  巳  丑  午  卯  未  申  亥  戌  辰  酉  寅
  7. # 807 822 835 874 864 841 863 775 829 781 855 854
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement