Skip to content
Prev 387049 / 398502 Next

need help calculating the indicator function

Perhaps (in R):


n_i <- cumsum( Y==l )


You should read further regarding R's logical class, and operators that 
work on it, and how it is coerced.