The dataset is
structure(list(`total primary - yes RS` = c(0L, 1L, 0L, 138L,
101L), `total primary - no RS` = c(0L, 0L, 0L, 29L, 39L), `total secondary- yes rs` = c(0L,
0L, 0L, 6L, 15L), `total secondary- no rs` = c(0L, 0L, 0L, 0L,
7L)), row.names = c(NA, -5L), class = c("tbl_df", "tbl", "data.frame"
))
Then from the dataset i run this to to get chisquare for each line. Though this works normally here it does not because some of the values contain zero's.
yes<-apply(sample, 1, function(x) tidy(chisq.test(matrix(x, ncol = 2)))) %>%
bind_rows
Though this script works i get an error message that says
at least one entry of 'x' must be positive
Is there a way to run the line of code i have but to skip the insufficient line?