title: How to extract an element from a list within a function
body: <p>I am trying to extract an element from a list within a function.</p>
  <pre><code>```{r}
  Q7.4&lt;-function (v1,v2){
    mean&lt;-mean(v1)
    median&lt;-median(v1)
    variance&lt;-var(v1)
    minimum&lt;-min(v1)
    maximum&lt;-max(v1)
    Coefficientofvariation&lt;-sqrt(variance)/mean
    my.list&lt;&lt;-list(mean=mean,meadian=median,variance=variance,minimum=minimum,maximum=maximum,Coefficientofvariation=Coefficientofvariation)
    my.list$v2
  }
  </code></pre>
  <p>When i run the code</p>
  <pre><code>Q7.4(1:100,mean)
  </code></pre>
  <p>I get NULL. Why is this happening?</p>