vec_stats | R Documentation |
Calculate the statistical summary of a vector.
vec_stats(x, na.rm = FALSE, conf.interval = 0.95)
x |
a numeric vector. |
na.rm |
remove NA or not. |
conf.interval |
a numeric value for confidence interval. |
Can be used for error bar plotting. Modify from https://bit.ly/3onsqot
a vector of summary consisting:
number of vector length
vector mean
vector standard derivation
standard error of mean
confidence interval
Other vector stats functions:
vec_segment()
library(dplyr)
library(tidyr)
library(purrr)
iris %>% dat_summ(method = vec_stats)
iris %>% group_by(Species) %>% group_modify(~ dat_summ(., method = vec_stats))
iris %>%
pivot_longer(cols = !Species, names_to = "var") %>%
group_nest(Species, var) %>%
mutate(map_dfr(data, ~ vec_stats(.x$value))) %>%
select(!data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.