data <- data.frame(id = c("10001", "10002", "10003", "10004"), V1 = c(10,11,15,9.3), V2 = c(5,7,21,30.2), V3 = c(10.3, 11, 19, 12))
> data
id V1 V2 V3
1 10001 10.0 5.0 10.3
2 10002 11.0 7.0 11.0
3 10003 15.0 21.0 19.0
4 10004 9.3 30.2 12.0
如何将所有小数乘以 100 并使数据如下所示:
> data
id V1 V2 V3
1 10001 10 5 1030
2 10002 11 7 11
3 10003 15 21 19
4 10004 930 3020 12