powered by
Combines mutate_at() and as_formatted_p_value()
mutate_at()
as_formatted_p_value()
format_p_values_at( .tbl, .vars, decimal_places = 3, prefix = "p", less_than_cutoff = 0.001, remove_trailing_zeroes = T, alpha = 0.05, ns_replacement = NULL )
A data frame
A vars() list of symbolic columns
Decimal places to display
Prefix to prepend (default "p=")
Cut-off for small p values. Values smaller than this will be displayed like "p<..."
If the required decimal places are less than decimal places, should resulting trailing zeros be removed?
Cut-off for assuming significance, usually 0.05
If p value is not significant (is > alpha), it will be replace by this string (e.g. "n.s.") If NULL (default), no replacement is performed.
Vectorised (in parallel) over x, prefix, less_than_cutoff, alpha and ns_replacement.
Value of mutate_at
format_numbers_at
# NOT RUN { library(tibble) library(magrittr) library(dplyr) tibble(p=c(0.05, 0.0001)) %>% format_numbers_at(vars(p)) # }
Run the code above in your browser using DataLab