width_p <- function(x, ignore.NaN = FALSE) {
N <- x$counts["N"]
p <- x$proportions["p"]
ks <- x$proportions[-c(1:3)]
int_names <- names(x$intervals)
if (ignore.NaN) {
usable <- filter(x$intervals, !is.nan(mW_Lower))
lower <- select(usable, str_subset(int_names, "Lower"))
upper <- select(usable, str_subset(int_names, "Upper"))
} else {
lower <- select(x$intervals, str_subset(int_names, "Lower"))
upper <- select(x$intervals, str_subset(int_names, "Upper"))
}
widths <- map2(lower, upper, ~ map2(.x, .y, ~ (.y - .x))) %>%
transpose() %>%
bind_rows() %>%
summarise_all(mean)
names(widths) <- str_remove(names(widths), "[_]?Lower[_]?")
widths %>%
add_column("N" = N, "p" = p, .before = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.