[R] Generate simulated data respecting some conditions

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Thu Jul 6 17:52:38 CEST 2017


Yes, definitely. However, this is so close to being legal R code that I feel you have not made any effort to translate it yourself, and this is the "R-help" mailing list, not the "R-do-my-work-for-me" mailing list. Is this homework?  Have you read the "Introduction to R" document that is supplied with R? There are also many basic tutorials on the Internet and books available that would discuss the need to write R statements in an appropriate  order so later statements can use objects created by earlier statements.
-- 
Sent from my phone. Please excuse my brevity.

On July 6, 2017 8:14:19 AM PDT, Marine Regis <marine.regis at hotmail.fr> wrote:
>Hello,
>
>Is it possible to generate simulated data that look like the attached
>figure?
>
>The curve in the figure can be obtained from this equation respecting
>some conditions:
>
>
>
>if(Temperature > T_min & Temperature < T_max){
>
>   a*( Temperature -T_min)*( Temperature -T_max)
>
>} else 0
>
>
>T_min ~ Uniform(0, 24)
>
>T_max ~ Uniform(25, 45)
>
>-a ~ Gamma(1, 1)
>
>Temperature <- seq(0, 45, by = 1)
>
>
>
>Thank you very much for your help.
>
>Have a nice day
>
>Marine



More information about the R-help mailing list