title: Searching functions using grep over multiple loaded packages in R
body: <p>Lets say I have package <code>base</code>, <code>dplyr</code>, <code>data.table</code>, <code>tidyr</code> etc. loaded using <code>sapply()</code>.</p>
  
  <pre><code> sapply(c("dplyr","data.table","tidyr"),library,character.only=TRUE)
  </code></pre>
  
  <p>So to check the list of functions in a particular package I do</p>
  
  <pre><code> ls("package:data.table")
  </code></pre>
  
  <p>Now if I want to search for functions inside <code>dplyr</code> starting with <code>is.</code> pattern I do</p>
  
  <pre><code> grep("is\\.",ls("package:dplyr"),value=TRUE)
   # [1] "is.grouped_df" "is.ident"      "is.sql"        "is.src"       
   # [5] "is.tbl" 
  </code></pre>
  
  <p>My Goal is to search for all the functions starting with <code>is.</code> or <code>as.</code> or any other pattern in multiple packages simultaneously. The code I think would be lengthy i.e. below I have combined list of <code>dplyr</code> and <code>base</code> functions and then added grep pattern. How to do it for many loaded packages?</p>
  
  <pre><code> grep("is\\.",c(ls("package:dplyr"),ls("package:base")),value=T)
  </code></pre>
  
  <p>Function <code>search()</code> would give me list of loaded packages. But how to gather all the functions of loaded packages, so that I can later <code>grep</code> on it.</p>
  
  <p>For a single package, list of functions can be obtained by </p>
  
  <pre><code> ls("package:package_name")  
  </code></pre>
  
  <p>Any help is highly appreciated.</p>