title: Transforming variable density on log scale with R
body: <p>I want to plot the density of variable whose range is the following:</p>
  
  <pre><code> Min.   :-1214813.0  
   1st Qu.:       1.0  
   Median :      40.0  
   Mean   :     303.2  
   3rd Qu.:     166.0  
   Max.   : 1623990.0
  </code></pre>
  
  <p>The linear plot of the density results in a tall column in range [0,1000], with two very long tails towards positive infinity and negative infinity.
  Hence, I'd like to transform the variable to a log scale, so that I can see what's going on around the mean.
  For example, I'm thinking of something like:</p>
  
  <pre><code>log_values = c( -log10(-values[values&lt;0]), log10(values[values&gt;0]))
  </code></pre>
  
  <p>which results in:</p>
  
  <pre><code>Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  -6.085   0.699   1.708   1.286   2.272   6.211 
  </code></pre>
  
  <p>The main problem with this is the fact that it doesn't include the <code>0</code> values.
  Of course, I can shift all the values away from <code>0</code>with <code>values[values&gt;=0]+1</code>, but this would introduce some distortion in the data.</p>
  
  <p>What would be an accepted and scientifically solid way of transforming this variable to the log scale?</p>