x %*% y
The last extent of x must be the same size as the first extent of y. Vectors are not oriented, therefore a vector of length n can multiply an n by n matrix on the left or right.
If neither x nor y are matrices, then the result of x %*% y will be a one by one matrix.
The expression x * y will perform element-wise multiplication, not matrix multiplication.
freeny.ls <- lsfit(freeny.x, freeny.y) fit <- cbind(1, freeny.x) %*% freeny.ls$coef