Re: [R] condition in triple summation
If I'm summing over (i,j,k) each from 1 to 3 And I have �condition that (i>j>k) But I want to restrict this condition to only cases where i,j,k>1 Sent from Yahoo Mail on Android From:"Jeff Newmiller" <jdnew...@dcn.davis.ca.us> Date:Mon, Oct 19, 2015 at 1:24 AM Subject:Re: [R] condition in triple summation Learn to post using plain text format. We are seeing garbage on the screen. --- Jeff Newmiller� � � � � � � � � � � � The� � .� � � .� Go Live... DCN:<jdnew...@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@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>1>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@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]] __ R-help@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.
Re: [R] condition in triple summation
Not sure I understand what your condition 'i > j > k' means in the context of where each of the values is 1:3. The only value that meets that condition is i =3, j=2 & k=1, but you said exclude any cases where the values were equal to 1. Can you clarify with an example what you mean. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Mon, Oct 19, 2015 at 3:53 AM, Sherouk Moawad via R-help < r-help@r-project.org> wrote: > If I'm summing over (i,j,k) each from 1 to 3 > > And I have condition that (i>j>k) > > But I want to restrict this condition to only cases where i,j,k>1 > > Sent from Yahoo Mail on Android > > From:"Jeff Newmiller" <jdnew...@dcn.davis.ca.us> > Date:Mon, Oct 19, 2015 at 1:24 AM > Subject:Re: [R] condition in triple summation > > Learn to post using plain text format. We are seeing garbage on the screen. > > --- > Jeff NewmillerThe. . Go Live... > DCN:<jdnew...@dcn.davis.ca.us>Basics: ##.#. ##.#. Live Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/BatteriesO.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@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>1>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@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]] > > > __ > R-help@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]] __ R-help@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.
Re: [R] condition in triple summation
| If for example I have a double sammation on (xj+xi)The first summation from 1 to 3 And second summation is from 1 to 2If I put the condition of (i>j ) then the term (x1+x1) will not be included I need to cut the condition into tow parts If i>1 then i>jWhile if i=1 then i>=jSo that the term (x1+x1) is includedCan this be done or it's an imaginary casePlease help | On Monday, October 19, 2015 4:00 PM, jim holtman <jholt...@gmail.com> wrote: Not sure I understand what your condition 'i > j > k' means in the context of where each of the values is 1:3. The only value that meets that condition is i =3, j=2 & k=1, but you said exclude any cases where the values were equal to 1. Can you clarify with an example what you mean. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Mon, Oct 19, 2015 at 3:53 AM, Sherouk Moawad via R-help <r-help@r-project.org> wrote: If I'm summing over (i,j,k) each from 1 to 3 And I have condition that (i>j>k) But I want to restrict this condition to only cases where i,j,k>1 Sent from Yahoo Mail on Android From:"Jeff Newmiller" <jdnew...@dcn.davis.ca.us> Date:Mon, Oct 19, 2015 at 1:24 AM Subject:Re: [R] condition in triple summation Learn to post using plain text format. We are seeing garbage on the screen. --- Jeff Newmiller The . . Go Live... DCN:<jdnew...@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@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>1>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@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]] __ R-help@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]] __ R-help@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.
Re: [R] condition in triple summation
Learn to post using plain text format. We are seeing garbage on the screen. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.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 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>1>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@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. __ R-help@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.
[R] condition in triple summation
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>1>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@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.