If the user specifies "qr" as the method, then the QR decomposition function is used to obtain the rank.
If the user specifies "chol" as the method, the rank is obtained from the attributes of the value returned.
References
Bellman, R. (1987). Matrix Analysis, Second edition, Classics in Applied Mathematics,
Society for Industrial and Applied Mathematics.