title: Include pattern in list.dirs
body: <p>surely a very newbish question, but how do I include a pattern inside a list.dirs function?</p>
  
  <p>For example, list.files function</p>
  
  <pre><code>Imagery=list.files(full.names=TRUE, recursive=TRUE, pattern= "*20m*.tif$")
  </code></pre>
  
  <p>returns all the files that have 20m in their name and have .tif as extension.</p>
  
  <p>But when i try to apply this logic to list.dirs </p>
  
  <pre><code>directories=list.dirs(full.names = TRUE, recursive=TRUE, pattern="R10m" )
  </code></pre>
  
  <p>i get this error:</p>
  
  <pre><code>Error in list.dirs(full.names = TRUE, recursive = TRUE, pattern = "R10m") : 
  unused argument (pattern = "R10m")
  </code></pre>
  
  <p>Hope I am not missing something obvious here.
  My goal is to get the full path of all directories that have a folder named "R10m". I have a lot of folder that have many subdirectories, and most of them have similar structure. I would like to list only those that have this folder, and within them list all files that are tifs. I know I can get the files I need with only list.files options, but I need the directory path and file names later as variables.</p>
  
  <p>Thank you beforehand for your time,</p>
  
  <p>Best regards,
  Davor</p>