round(x, digits=0) signif(x, digits=6)
When rounding off a 5, the two common conventions are to: 1) go to the higher number, or 2) go to the even digit. The round function obeys convention 2, so round(2.5) is 2 and round(3.5) is 4. The rounding mechanism for signif is machine dependent, but most machines will use the "round to even" rule.
round(mydata, dig=2) #round to 2 decimals round(mydata, -1) #round to nearest 10x <- c(123456, .123456, .000123456)
round(x, 3) # produces [1] 123456.000 0.123 0.000
signif(x, 3) # produces [1] 1.23e+05 1.23e-01 1.23e-04
round(c(-1.9, -1.1, 1.1, 1.9)) # produces [1] -2 -1 1 2