title: using multiple variables in geom_bar with ggplot at same X (R)
body: <p>I'm trying to find how to do a barplot like this (<a href="https://i.stack.imgur.com/0Tu17.png" rel="nofollow noreferrer">barplot</a>), but with my data (multiple variables).</p>
  
  <p>The data (<code>PlatformGlobe</code>) is the following:</p>
  
  <pre><code>    Platformvendor total_NA total_EU total_JP total_Other total_Global
         &lt;chr&gt;       &lt;dbl&gt;    &lt;dbl&gt;    &lt;dbl&gt;       &lt;dbl&gt;        &lt;dbl&gt;
       microsoft     870.92   379.56    14.02      107.63      1372.92
       nintendo     1743.71   774.77   758.91      189.71      3469.71
        other         81.50     5.40    35.41        0.91       123.31
         PC           93.34   140.37     0.17       21.88       256.56
        sega          27.48     8.10    11.75        1.29        48.66
        sony        1526.25  1092.01   470.47      461.29      3549.89
  </code></pre>
  
  <p>I would like in the X axis <code>total_NA</code>, <code>total_EU</code>, <code>total_JP</code> ..., with different colors and bars for each platform (<code>Platformvendor</code>) and y axis being the number of the table. I tried this as an example (with less data):</p>
  
  <pre><code> library(ggplot)
   library(gridExtra)
  
   temp4 &lt;-ggplot(PlatformGlobe, aes(x=c("NA","EU","JP"),y=c(PlatformGlobe$total_NA,PlatformGlobe$total_EU,PlatformGlobe$total_JP),fill=PlatformGlobe$Platformvendor)) + 
   geom_bar(stat="identity")
  
  
   grid.arrange(temp4)
  </code></pre>
  
  <p>But it outputs an error: Aesthetics must be either length 1 or the same as the data (6): x, y, fill</p>
  
  <p>This is the best way to do what I want? Any tip will be helpful.</p>