2
假設我有以下data.frame:變化最後兩位數字爲 「00」
dt=data.frame(id=LETTERS[1:5],code=c("101011,101102,101130","211011,101102",
"101011,301102,101132","201015,401102,103412","131011,101101,105430"))
id code
A 101011,101102,101130
B 211011,101102
C 101011,301102,101132
D 201015,401102,103412
E 131011,101101,105430
F 101100,103200`
我希望代碼的最後兩個數字變成 「00」,就像這樣:
id code
A 101000,101100,101100
B 211000,101100
C 101000,301100,101100
D 201000,401100,103400
E 131000,101100,105400
F 101100,103200`
我怎樣才能做到這一點?