change single cell in a matrix by index number in r
# Create a sample matrixmat <- matrix(1:9, nrow = 3, byrow = TRUE)
print(mat)
# Change a single cell in the matrix by index numberrow_index <- 2col_index <- 3mat[row_index, col_index] <- 99print(mat)