title: Ploting the Lasso L1 constraint
body: <p>In Lasso regression the L1 constraint is used: <img src="https://latex.codecogs.com/gif.latex?%5Clambda%5Csum_%7Bj=1%7D%5E%7Bp%7D%5Cleft&space;|&space;%5Cbeta_j&space;%5Cright&space;|" title="\lambda\sum_{j=1}^{p}\left | \beta_j \right |" /></p>
  
  <p>I'm trying to plot the constraint using R. An example looks like: 
  <a href="https://i.stack.imgur.com/WCxEk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WCxEk.png" alt="enter image description here"></a></p>
  
  <p>Here is the simple R code I wrote: </p>
  
  <pre><code>beta= seq(-1, 1, length=100)
  lambda=2
  penalty=lambda*abs(beta)
  plot(penalty, type="l") 
  </code></pre>
  
  <p>It draws only the lower part of the plot. How could I plot the upper part too in one plot?
  Here is the plot: </p>
  
  <p><a href="https://i.stack.imgur.com/zeTwa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zeTwa.png" alt="enter image description here"></a></p>