improve matrix conformability error message

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

improve matrix conformability error message

Joshua N Pritikin

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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel