title: R package dependency issues when namespace is not attached
body: <p>I have always assumed that having a package in the 'Depends' field would automatically also <em>import</em> the namespace. However, it seems that in R 2.15, dependencies do not become available until the package is actually <em>attached</em> to the searchpath. Is this intended behavior?</p>
  
  <p>The problem appears as follows: Suppose there is a package 'Child' which <em>Depends</em>, but does not explicitly <em>Import</em> a package called 'Parent' and contains a function that calls out to an object in the namespace of 'Parent'. Then when this function is called without actually attaching 'Child', the function in 'Parent' cannot be found.</p>
  
  <p>Here an example from the manual of the <code>bigdata</code> package, but the problem is very widespread:</p>
  
  <pre><code>x = matrix(rnorm(50*80),50,80)
  beta = c(3,2,1.5,rep(0,77))
  y = rnorm(50) + x%*%beta
  z1 = bigdata::lasso.stars(x,y)
  </code></pre>
  
  <p>The example fails because lasso.stars depends on 'glmnet' which is not loaded until <code>bigdata</code> is attached. The only way to be able to call <code>lasso.stars</code> is to actually attach the <code>bigdata</code> package:</p>
  
  <pre><code>library(bigdata)
  z1 = bigdata::lasso.stars(x,y)
  </code></pre>
  
  <p>Now to further complicate things, it seems that this problem is inherited to any 'grandchild' package that <em>Imports</em> in this case the lasso.stars function. I have a hard time finding a good example but I am sure they are out there. </p>
  
  <p>Is this a bug? I know that it can be avoided by asking package authors to use Imports instead of Depends, but in practice the majority of the packages on CRAN still use Depends. It seems like the problem is easily avoided if R would automatically import the namespace of any Depends packages into to the child package namespace.</p>