Hello everybody! I'm using R and I have a little problem about function "grep". I 've got to make a new function in which "grep" is present. So the first argument of "grep" is the string we want to find,ok..but in this case I define a function "x" before , x receives an argument in a object "name" (for instance), then inside function "x" ,i define a grep.. so i want to set as pattern (1st argument of grep) what i put in "name" and not the string "name"... how do i do that?
ex: name <- "Tom" myfun <- function(name) { r <- grep ("name", table ) return (r) } It returns nothing because it searches the word "name" in "table" rather "Tom"... I hope to receive some little help because this is stopping me in my projcet :/ ... i m'not able to reach a solution! Thanks a lot! -- View this message in context: http://www.nabble.com/Difficultes-with-grep-tp18409347p18409347.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.