title: How to Combine Multiple Rows Into One Using TidyText
body: <p>I am looking at a novel and want to search for the appearance of characters' names throughout the book Some characters go by different names. For example, the character "Sissy Jupe" goes by "Sissy" and "Jupe". I want to combine two rows of word counts into one so I can see the tally for "Sissy Jupe". </p>
  
  <p>I've looked at using sum, rbind, merge, and other approaches using the message boards, but nothing seems to work. Lots of great examples, but they aren't working. </p>
  
  <pre><code>library(tidyverse) 
  library(gutenbergr)
  library(tidytext)
  
  ht &lt;- gutenberg_download(786)
  
  ht_chap &lt;- ht %&gt;%
    mutate(linenumber = row_number(),
           chapter = cumsum(str_detect(text, regex("^chapter [\\divxlc]",
                                                   ignore_case = TRUE))))
  
  tidy_ht &lt;- ht_chap %&gt;%
    unnest_tokens(word, text) %&gt;%
    mutate(word = str_extract(word, "[a-z']+")) # preserves online letters; removes _)
  
  ht_count &lt;- tidy_ht %&gt;%
    group_by(chapter) %&gt;%
    count(word, sort = TRUE) %&gt;%
    ungroup %&gt;%
    complete(chapter, word,
             fill = list(n = 0)) 
  
  gradgrind &lt;- filter(ht_count, word == "gradgrind")
  bounderby &lt;- filter (ht_count, word == "bounderby")
  sissy &lt;- filter (ht_count, word == "sissy")
  
  ## TEST
  sissy_jupe &lt;- ht_count %&gt;% 
    filter(word %in% c("sissy", "jupe"))
  </code></pre>
  
  <p>I want a single "word" item called "sissy_jupe" that tallies the n by chapter. 
  This is close, but not it. </p>
  
  <pre><code># A tibble: 76 x 3
     chapter word      n
       &lt;int&gt; &lt;chr&gt; &lt;dbl&gt;
   1       0 jupe      0
   2       0 sissy     1
   3       1 jupe      0
   4       1 sissy     0
   5       2 jupe      5
   6       2 sissy     9
   7       3 jupe      3
   8       3 sissy     1
   9       4 jupe      1
  10       4 sissy     0
  # … with 66 more rows
  </code></pre>