Hi, I assume input y to wrapper <- function(y) {function(x) {(y)}} is a function. In the statement to assign gfunc[[i]]<- gsub("(Gene)([[:digit:]])", "x[\\2]", func[[i]]) the mode of gsub("(Gene)([[:digit:]])", "x[\\2]", func[[i]]) is character. Is this the issue? -- View this message in context: http://r.789695.n4.nabble.com/evaluate-logical-expressions-tp4703964p4703970.html Sent from the R help mailing list archive at Nabble.com.