# Functions to be ignored in build, but include in repo just in case
# ------------------------------------------------------------------
# Function to extract null model quantiles from the overlap stats generated by my tweaked QTstats function.
ses_overlap <- function(ts, qs = c(0.025, 0.975)) {
ses <- ses_lower <- ses_upper <- raw_lower <- raw_upper <- matrix(NA, nrow=nrow(ts$overlaps), ncol=ncol(ts$overlaps))
for (i in 1:nrow(ts$overlaps)) {
for (j in 1:ncol(ts$overlaps)) {
if(!is.na(ts$overlaps[i,j])) {
obs <- ts$overlaps[i,j]
nullvals <- na.omit(ts$overlaps_nm[, j, i])
ses[i,j] <- (obs - mean(nullvals))/sd(nullvals)
ses_lower[i,j] <- (quantile(nullvals, probs=qs[1]) - mean(nullvals))/sd(nullvals)
ses_upper[i,j] <- (quantile(nullvals, probs=qs[2]) - mean(nullvals))/sd(nullvals)
raw_lower[i,j] <- quantile(nullvals, probs=qs[1])
raw_upper[i,j] <- quantile(nullvals, probs=qs[2])
}
}
}
return(list(ses=ses, ses_lower=ses_lower, ses_upper=ses_upper, raw_lower=raw_lower, raw_upper=raw_upper))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.