filmov
tv
Return Index Position of Element in Matrix Using which() Function in R (Example) | arr.ind Argument
Показать описание
R code of this video:
mat <- matrix(1:5, # Create example matrix
ncol = 5,
nrow = 4)
mat # Print example matrix
which(mat == 4) # Apply which function with default specifications
mat_pos # Print position matrix of value 4
Follow me on Social Media:
mat <- matrix(1:5, # Create example matrix
ncol = 5,
nrow = 4)
mat # Print example matrix
which(mat == 4) # Apply which function with default specifications
mat_pos # Print position matrix of value 4
Follow me on Social Media: