I think itβs clearer to explicitly set sizes instead of double t():
dim(a) <- c(length(a), 1)
which should avoid making a copy.
I saw this quite a bit in the older code, for example, for least squares, you can start with:
solve(t(x) %*% x) %*% t(x) %*% y
, , , :
xt <- t(x)
solve(xt %*% x) %*% xt %*% y
x ,
xt <- t(a)
x <- t(xt)
t() - ;
, solve(crossprod(x), crossprod(x,y)), .