[R] condition in triple summation

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Mon Oct 19 01:24:37 CEST 2015


Learn to post using plain text format. We are seeing garbage on the screen.

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

On October 18, 2015 2:03:34 PM PDT, Sherouk Moawad via R-help <r-help at r-project.org> wrote:
>Dear R-Expertsx=c(0,0.3, 0.5,0.6)sum(sapply(1:4, function(i)
>{sum(sapply(1:3, function(j){sum(sapply(1:2, function(k)
>{(i>j)*(j>k)*exp(x[i]+x[j]+x[k])}))}))}))
>I want to restrict the condition (i>j>k) to only those cases where
>i>1&j>1&k>1In other words'if i=1 then i>=jif j=1 then j>=kother wise
>i>j>kcan this be done using coding or notThank you 
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at 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.



More information about the R-help mailing list