window_fava | R Documentation |
This function computes FAVA in sliding window slices of a dataset.
window_fava(
relab_matrix,
window_size,
window_step = 1,
group = NULL,
index = NULL,
time = NULL,
w = NULL,
S = NULL,
K = NULL,
normalized = FALSE,
alpha = 0.5
)
relab_matrix |
A matrix or data frame with rows containing non-negative entries that sum to 1. Each row represents
a sample, each column represents a category, and each entry represents the abundance of that category in the sample.
If |
window_size |
An integer number specifying the number of samples per window. |
window_step |
Optional; an integer specifying the distance between the first entry of adjacent windows. Default is |
group |
Optional; a string specifying the name of the column that describes which group each row (sample) belongs to. Use if |
index |
Optional; a string specifying the name of the column in |
time |
Optional; a string specifying the name of the column that describes the sampling time for each row. Include if you wish to weight FAVA by the distance between samples. |
w |
Optional; a vector of length |
S |
Optional; a K x K similarity matrix with diagonal elements equal to 1 and off-diagonal elements between 0 and 1. Entry |
K |
Optional; an integer specifying the number of categories in the data. Default is |
normalized |
Optional; should normalized FAVA be used? Default is |
alpha |
Optional; number between 0 and 1 specifying the opacity of the horizontal
lines plotted. Default is |
A list of values of FAVA for each window.
A = matrix(c(.3,.7,0,.1,0,.9,.2,.5,.3,.1,.8,.1,.3,.4,.3,.6,.4,0,0,.5,.5),
ncol = 3, byrow = TRUE)
window_out = window_fava(relab_matrix = A, window_size = 4, normalized = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.