search for: resexp

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

Did you mean: regexp
2012 Mar 18
1
Converting expression to a function
...ames(ff) <- xx2 sf<-as.character(f) if ((length(sf)!=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.30...