My question:
Amat <- diag(4)
I would like to replace all the lower triangular values of Amat
(i.e. Amat[2,1]
, Amat[3,1]
, Amat[3,2]
, and so on) with a value I choose (e.g. NA
).
Obviously I do not want to replace each element one by one.
Could you show me the most efficient way to do it with a single command?
See Question&Answers more detail:os