How to Apply the norm() Function in R (Example Code)
In this article, I’ll illustrate how to compute the norm of a matrix using the norm() function in R.
Creation of Example Data
x <- matrix(1:12, ncol = 3) # Example matrix x # [,1] [,2] [,3] # [1,] 1 5 9 # [2,] 2 6 10 # [3,] 3 7 11 # [4,] 4 8 12 |
x <- matrix(1:12, ncol = 3) # Example matrix x # [,1] [,2] [,3] # [1,] 1 5 9 # [2,] 2 6 10 # [3,] 3 7 11 # [4,] 4 8 12
Example: Calculate Norm of Matrix
norm(x) # Compute one norm of matrix # [1] 42 |
norm(x) # Compute one norm of matrix # [1] 42