Last active
January 29, 2016 21:55
-
-
Save artemklevtsov/2b8a84038ce8349857af to your computer and use it in GitHub Desktop.
Source at gtools::stars.pval
This file contains 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
format_pval <- function(x, cut = 0.05) { | |
x <- round(x, 3) | |
x[x == 0] <- paste("<span style='color:red;'><", 0.001, "</span>") | |
x[x < cut] <- paste0("<span style='color:red;'>", x[x < cut], "</span>") | |
return(x) | |
} |
This file contains 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
stars_pval <- function(x) { | |
unclass(symnum(x, corr = FALSE, na = FALSE, legend = FALSE, | |
cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1), | |
symbols = c("***", "**", "*", ".", " "))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example: