Displaying 1 result from an estimated 1 matches for "cutoffvalu".
Did you mean:
cutoffvalue
2012 Jan 10
1
error in Recursive
Hi
I need help in the recursive problem. this is my code
#Generate two random Numbers
minval=20
maxval=100
cutoffValue=50
optVal<- function(cutoffValue,minval,maxval)
{
x=runif(2)
x=x*cutoffValue
for( i in 1:2)
{
if(x[i] < 30 || x[i] >60) # checking it falls between the range
{
optVal(cutoffValue,minval,maxval)
}
}
return(x)
}
optVal(40,20,60)
I'm gett...