Created
January 2, 2018 23:06
-
-
Save kieranrcampbell/1ca124b962d3ad4e2c65cff529480c96 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' These functions round an input string 'x' to a desired | |
#' number of decimal places | |
round1 <- function(x) format(round(x, 1), nsmall = 1) | |
round2 <- function(x) format(round(x, 2), nsmall = 2) | |
roundn <- function(x, n = 2) format(round(x, n), nsmall = n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment