title: R - finding max value of Corpus vector
body: <p>I'm new to R coding. 
  I've been trying to use the TM library to get the percentage of sentiment in each element.</p>
  
  <p>I started by using the:</p>
  
  <pre><code>   sc &lt;- Corpus(VectorSource(email))
  </code></pre>
  
  <p>After that is tried to minimize the unnecessary words by using the:</p>
  
  <pre><code>sclean&lt;- tm_map(sc, removePunctuation)
  sclean &lt;- tm_map(sclean, content_transformer(tolower))
  sclean &lt;- tm_map(sclean, removeWords, stopwords(kind="en"))
  sclean &lt;- tm_map(sclean, removeNumbers)
  sclean &lt;- tm_map(sclean, stripWhitespace)
  sclean &lt;- tm_map(sclean, removeWords, commonwords)
  sent&lt;-sent_Analysed&lt;-get_nrc_sentiment(unlist(as.list(sclean)))
  </code></pre>
  
  <p>I'm getting an answer that looks like (each row is a "sent" ): </p>
  
  <p><a href="https://i.stack.imgur.com/fKsCF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fKsCF.png" alt="feelings"></a></p>
  
  <p>From this i want to find the maximum value and calculate the percentage of it (excluding the negative and positive).
  For example for line 2:</p>
  
  <p>The max value will be: trust (40) 
  And the percentage will be: 32.5 ( max / sum (= 123) * 100)</p>
  
  <p>I'm struggling with finding the max value, and the sum (each line is printed by a for loop) of all numbers without the last 2 columns </p>