[Solved] command ls with pattern in a function is not working in R


Try to look in the .GlobalEnv:

srch = function(srchstr){
    print(ls(pattern=srchstr, envir = .GlobalEnv))
}

edit joran was faster…

solved command ls with pattern in a function is not working in R