[Rd] improve matrix conformability error message

Joshua N Pritikin jpr|t|k|n @end|ng |rom pobox@com
Wed Apr 24 12:29:47 CEST 2019


Incorrect code,

A <- matrix(1, 2, 2)
B <- matrix(2, 3, 2)
A %*% B

Produces

  Error in A %*% B : non-conformable arguments

It would be helpful to show the matrix dimensions,

  Error in A %*% B : non-conformable arguments of dimensions (2, 2) and (3, 2)

-- 
Joshua N. Pritikin, Ph.D.
Virginia Institute for Psychiatric and Behavioral Genetics
Virginia Commonwealth University
PO Box 980126
800 E Leigh St, Biotech One, Suite 1-133
Richmond, VA 23219
http://exuberant-island.surge.sh



More information about the R-devel mailing list