[R] need help calculating the indicator function

David Winsemius dw|n@em|u@ @end|ng |rom comc@@t@net
Fri Jan 29 23:51:47 CET 2021

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.



On 1/29/21 6:27 AM, Ablaye Ngalaba wrote:
> Hello,
> please, I need to calculate the indicator function as I underlined in my
> attached pdf file but I can't define a code in programming language that
> deals with this case. Please help me with a code whether it's in python or
> R can help me.
>     Sincerely.
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]

More information about the R-help mailing list