col(x) row(x)
NAs) are allowed.
z[i,j] is
i for all
j;
if z<-col(x),
z[i,j] is
j for all
i.
Do not confuse this function with the
col parameter in graphics functions;
see
par for that use of
col.
x[row(x)>col(x)] <- 0 # zero the strict lower triangle of x x[row(x)-col(x)==1] # first sub-diagonal