M <- matrix(1:12, 3, 4)
mrank(M) #=> 2
N <- nullspace(M)
# [,1] [,2] [,3]
# [1,] 0.4082483 -0.8164966 0.4082483
N
M <- magic(5)
rank(M) #=> 5
nullspace(M) #=> 0 0 0 0 0
Run the code above in your browser using DataLab