Talk:Genetic Algorithms for Function Optimization/@comment-124.83.19.140-20171208053759

I have a problem I'm new at R and would like to optimize my equation but there are 3 variables. Anyway here is my codes, there is an error at the end. how will I resolve that?

> MYdaf <- function(RT, Rt, CP)

+ {

+     1.39-(0.003056*RT)-(0.0064*Rt)+(0.1061*CP)

+ }

> RT <- seq(250, 285, by = 0.1)

> Rt <- seq(5, 20, by = 0.01)

> CP <- seq(-1, 0, by = 1)

> f <- outer(RT, Rt, CP, MYday)

Error in get(as.character(FUN), mode = "function", envir = envir) :

object 'CP' of mode 'function' was not found