Any attempt to subset a matrix using diag gives the error "replacement diagonal has the wrong length."
Investigating with breakpoints shows that the error occurs in Rsh_SetterCall, specifically the Rf_applyClosure call in the CLOSXP case.
When cating the value without setting it, the value shows without issue.
Test to reproduce error:
x <- matrix(4,2,2)
diag(x)[2] <- 5
Any attempt to subset a matrix using diag gives the error "replacement diagonal has the wrong length."
Investigating with breakpoints shows that the error occurs in
Rsh_SetterCall, specifically theRf_applyClosurecall in the CLOSXP case.When
cating the value without setting it, the value shows without issue.Test to reproduce error: