title: Barplot dplyr summarized values
body: <p>I have data from a top 3 ranking. I'm trying to create a plot that would have on the x axis the column name (cost/product), and the y value be the frequency (ideally relative frequency but I'm not sure how to get that in dplyr). </p>
  
  <p>I'm trying to create this in plotly from values summarized in dplyr. I have a dplyr data frame that looks something like this:</p>
  
  <pre><code>likelyReasonFreq&lt;-    LikelyRenew_Reason %&gt;%
        filter(year==3)%&gt;%
        filter(status==1)%&gt;%
        summarize(costC = count(cost), 
                  productsC = count(products))
  
  
  
     &gt; likelyReasonFreq
            costC.x   costC.freq   productsC.x  productsC.freq
       1       1         10           1             31
       2       2         11           2             40
       3       3         17           3             30
       4      NA        149          NA             86
  </code></pre>
  
  <p>I'm trying to create a barplot that shows the total (summed) frequency for cost,and for products. So frequency for cost would be the frequency for # of times ranked 1, 2, or 3 so 38. Essentially I'm summing rows 1:3 (for products it would be 101 (not including NA values). </p>
  
  <p>I'm  not sure how to go about this, any ideas??</p>
  
  <p>below is the variable likelyReasonFreq</p>
  
  <pre><code>&gt; dput(head(likelyReasonFreq))
   structure(list(costC = structure(list(x = c(1, 2, 3, NA), freq = c(10L, 
    11L, 17L, 149L)), .Names = c("x", "freq"), row.names = c(NA, 
    4L), class = "data.frame"), productsC = structure(list(x = c(1, 
    2, 3, NA), freq = c(31L, 40L, 30L, 86L)), .Names = c("x", "freq"
    ), row.names = c(NA, 4L), class = "data.frame")), .Names = c("costC", 
    "productsC"), row.names = c(NA, 4L), class = "data.frame")
  </code></pre>
  
  <p>I appreciate any advice!</p>