ChiPValue <- function(data, x, y){
options(warn=-1)
chi <- data %>%
summarise(p_value =if (sum(x <= 0) < 1) {
chisq.test(x, p = !!sym(y), rescale.p = T)$p.value
} else {
"---"
})
options(warn=0)
chi <- cbind(`Chi-Test` = "Chi-Test: p value", chi)
return(chi)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.