title: Creating plots with ggplot in R
body: <p>I am relatively new to R and now I am trying to use ggplot to create some graphs.
  However, I proably did not understand the logic fully, because I have some problems now:</p>
  
  <p>For example, I have the following dataframe which I alrady reshaped:</p>
  
  <pre><code>     id variable value
  1     1 Var1     1
  2     1 Var2     1
  3     2 Var1     NA
  4     2 Var2     NA
  5     3 Var1     1
  6     3 Var2     NA
  7     4 Var1     NA
  8     4 Var2     1
  ...
  
  </code></pre>
  
  <p>Now, I want to produce a simple plot (like a barplot) that adds up the values for each of the two varaibles.
  Howver, I do not get any sensible results...</p>
  
  <p>In a second data frame, my data looks different</p>
  
  <pre><code>     id variable value
  1     1 Var1     4
  2     2 Var1     5
  3     3 Var1     2
  4     4 Var1     5
  5     5 Var1     3
  6     6 Var1     1
  7     7 Var1     5
  8     8 Var1     4
  ...
  
  </code></pre>
  
  <p>Here I would also like to get a barplot, but here I would like to get the percentage shares of the values as bars.
  E.g. 20% said 5, 30% said 4, ... I tried this by calculatiing the percentage shares in advance, but then I wanted to add the number of observations under each bar, which did not work out, because I only had the percentages left in my dataframe. Is there a way to get the sahres as bars, but the number of observations under each bar?</p>
  
  <p>I guess that should not be so diffucult, but I have problems with the logic behind ggplot...</p>
  
  <p>Any help would be highly appreciated! I also checked other posts, but could not find a way that was working.</p>
  
  <p>Thank you very much in adavance!</p>