On Thu, 14 Oct 2004 23:24:40 +0300, Pedro Rodrigues de Almeida
<[EMAIL PROTECTED]> wrote :

>Hi there,
>
>How can I plot a function in R which is defined by conditional 
>branches?, e.g.:
>
>u(x) = 1, Ed<x<2Ed (where Ed is a positive constant, say, 25);
>u(x)=0.5*x, x>2Ed

ifelse(x < 2*Ed, 1, 0.5*x)

is close to what you want (but I'm not sure what you want for x < Ed).

Duncan Murdoch

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to