On 27/07/2011 9:21 AM, dean123 wrote:
Hi David,
I am trying to define t as a single numeric value and not as a vector.. I
want the function to realise that if I call test(t) and t is less than equal
10 return zero, if t greater than 10 return 2*t. Am i missing some code in
which to define t a nu
Hi David,
I am trying to define t as a single numeric value and not as a vector.. I
want the function to realise that if I call test(t) and t is less than equal
10 return zero, if t greater than 10 return 2*t. Am i missing some code in
which to define t a numeric value instead of a vector?
Also,
On Jul 27, 2011, at 3:01 AM, dean123 wrote:
I am trying to plot the following function over the range 0-100
test <- function(t){{
if (t<=10)
x<-t*0
else x<-2*t
}
x
}
Two problems I see. The first is the one described fairly clearly by
the error message:
Read:
?"if"
It is not designed
I am trying to plot the following function over the range 0-100
test <- function(t){{
if (t<=10)
x<-t*0
else x<-2*t
}
x
}
when I use plot(test,0,100) the GUI produces the following;
"Warning message:
In if (t <= 10) x <- t * 0 else x <- 2 * t :
the condition has length > 1 and only the first e
4 matches
Mail list logo