grep<-function(str){
tempobj<-ls(envir=sys.frame(-1))
objstring<-character(0)
for(i in tempobj) {
myfunc<-get(i)
if(is.function(myfunc))
if(length(grep(str,deparse(myfunc))))
objstring<-c(objstring,i)
}
return(objstring)
}
mygrep("for")
tempobj<-ls(envir=sys.frame(-1))
objstring<-character(0)
for(i in tempobj) {
myfunc<-get(i)
if(is.function(myfunc))
if(length(grep(str,deparse(myfunc))))
objstring<-c(objstring,i)
}
return(objstring)
}
mygrep("for")
No comments:
Post a Comment