I am trying to write the R code for the expression given in the image for calculation purposes. I tried to use two loops and sapply
function but I failed. Can anyone suggest a suitable code for the calculation of this expression?
I tried below lines given in the image.
R Code tried: