This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scaleFUN <- function(x) sprintf("%.1f", x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.csl-entry { | |
margin-bottom: 10px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loglik2AIC <- function(l, k){round((-2 * l) + (2 * k), 3)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trimean <- function(x, p = 0.25, a = 0.25){ | |
q <- Hmisc::hdquantile(x, probs = c(p, 0.5, 1-p), na.rm = TRUE, names = FALSE) | |
tm <- (a * q[1]) + ((1 - (2 * p)) * q[2]) + (a * q[3]) | |
return(tm) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmd <- function(x){median(abs(x - median))/median(x)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
q_summary <- function (x) { | |
h <- Hmisc::hdquantile(x, probs = seq(0.125, 0.875, 0.125), na.rm = TRUE, names = FALSE, se = FALSE, weights = FALSE) | |
med = h[4]; iqr = h[6] - h[2] | |
skew = (h[2] + h[6] - (2 * h[4]))/iqr; kurt = ((h[7] - h[5]) + (h[3] - h[1]))/iqr | |
qcd = (iqr)/(h[6] + h[2]) | |
out <- list(med, iqr, skew, kurt, qcd) | |
names(out) <- c("median", "IQR", "skewness", "kurtosis", "quatile coefficient of dispersion") | |
return(out) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loessggplot <- function(x, low = 0.1, high = 0.9, step = 0.01, title = "", ticks = 0.1){ | |
n <- length(x) | |
t <- cumsum(x); t <- 100*t/max(t) # normalize the running time to percent | |
# Create an empty data fame to store the results of the for loop | |
df <- data.frame() | |
# Loop over the sequence of spans for the loess smoothers and store the result | |
for(s in seq(low, high, step)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loessggplot(backstage, low = 0.1, high = 0.9, step = 0.01, title = "Backstage (1919)", ticks = 0.1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check the class of the output of seewave::acoustat() | |
class(insidious_chapter_3_nape) | |
## [1] "matrix" "array" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (raw_values, title = "Syuzhet Plot", legend_pos = "top", | |
lps = 10, window = 0.1) | |
{ | |
wdw <- round(length(raw_values) * window) | |
rolled <- rescale(zoo::rollmean(raw_values, k = wdw, fill = 0)) | |
half <- round(wdw/2) | |
rolled[1:half] <- NA | |
end <- length(rolled) - half | |
rolled[end:length(rolled)] <- NA | |
trans <- get_dct_transform(raw_values, low_pass_size = lps, |
OlderNewer