bandReplace | R Documentation |
Sets a band of matrix diagonals to any given value
bandReplace(mat, lower, upper, value = NA, silent = TRUE)
mat |
A Matrix |
lower |
Lower diagonal to be included in the band (should be |
upper |
Upper diagonal to be included in the band (should be |
value |
A single value to replace all values in the selected band (default = |
silent |
Operate in silence, only (some) warnings will be shown (default = |
A matrix in which the values in the selected diagonals have been replaced
Fred Hasselman
Other Distance matrix operations (recurrence plot):
createCorridor()
,
mat_di2bi()
,
mat_di2ch()
,
mat_di2we()
,
mat_hamming()
,
rp()
,
rp_lineDist()
,
rp_nzdiags()
,
rp_plot()
,
rp_size()
# Create a 10 by 10 matrix
library(Matrix)
m <- Matrix(rnorm(10),10,10)
bandReplace(m,-1,1,0) # Replace diagonal and adjacent bands with 0 (Theiler window of 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.