search for: fnexp

Displaying 1 result from an estimated 1 matches for "fnexp".

Did you mean: fnext
2012 Mar 18
1
Converting expression to a function
...)!=3) && (sf[1]!="~")) stop("Bad model formula expression") lhs<-sf[2] # NOTE ORDER formula with ~ puts ~, lhs, rhs rhs<-sf[3] # And build the residual at the parameters resexp<-paste(rhs,"-",lhs, collapse=" ") fnexp<-paste("crossprod(",resexp,")", sep="") ff[[length(ff) + 1]] <- parse(text=fnexp) # want crossprod(resexp) myfn<-as.function(ff, parent.frame()) } # a test y<-c(5.308, 7.24, 9.638, 12.866, 17.069, 23.192, 31.443, 38.558, 50.15...