> I want to write the inside function (3^(x[i]+x[j])) in a more condensed form
> cause this will help me when the multiple summations are more than two
indices<-c(i,j) #or whatever you want
3^sum( x[indices] )
S Ellison
***
This e
Dear R Experts
that's my original equation
> x=c(2,4)
> Y1=sum(sapply(1:2,function(i){sum(sapply(1:i,function(j){(3^(x[i]+x[j]))}))}))
>
> y1
[1] 7371
I want to write the inside function (3^(x[i]+x[j])) in a more condensed form
cause this will help me when the multiple summations are more t
2 matches
Mail list logo