gistlib
# Create a matrix mat <- matrix(c(1, 2, 3, 4, 5, 6), nrow = 3) # Convert all elements of the matrix to 0 mat[] <- 0 # Print the updated matrix print(mat) 156 chars9 lines
# Create a matrix mat <- matrix(c(1, 2, 3, 4, 5, 6), nrow = 3) # Convert all elements of the matrix to 0 mat[] <- 0 # Print the updated matrix print(mat)
gistlibby LogSnag