title: (solved by updating) Measure similarity of sentences to target document's sentences (error msg)
body: <p>I am using the R <a href="https://quanteda.io/index.html" rel="nofollow noreferrer">quanteda package</a> (version 1.4.3, windows system) to find almost verbatim text-reuse in several documents. In the end, I want to compare the relative influence of the source documents, plus I want to be able to display instances of near verbatim matches. So far, what I have been doing is this:</p>
  
  <ul>
  <li>build a corpus from text files</li>
  <li>re-shape it into sentences to be compared</li>
  <li>tokenize it into words</li>
  <li>build a document-feature-matrix from word ngrams</li>
  </ul>
  
  <pre><code>library(magrittr)
  library(readtext)
  library(quanteda)
  
  corpus    &lt;-  readtext("data/*.txt",
                         docvarsfrom = "filenames",
                         dvsep = "_-_",
                         docvarnames = c("country"),
                         encoding = "UTF-8"
                        ) %&gt;%
                corpus()
  
  sentences &lt;-  corpus_reshape(corpus,
                               to = "sentences",
                               use_docvars = TRUE
                              )
  
  mytokens  &lt;-  tokens(sentences,
                       what = "word",
                       include_docvars = TRUE
                      ) %&gt;%
                tokens_ngrams(n = 3:5)
  
  mydfm     &lt;-  dfm(mytokens, tolower = TRUE)
  </code></pre>
  
  <p>Inspecting the results, they seem fine so far.</p>
  
  <p>However, when I try to calculate the similarity of "documents" (i.e. sentences) to "documents" from my target text, I get an error:</p>
  
  <pre><code>simil &lt;- textstat_simil(mydfm,
                          dfm_subset(mydfm, country == "USA"),
                          margin = "documents",
                          method = "simple matching"
                         )
  Error in selection[is.na(i)] : 
    invalid or not-yet-implemented 'Matrix' subsetting
  </code></pre>
  
  <ul>
  <li>How can I avoid this error?</li>
  <li>Am I taking a good approach in the first place?</li>
  </ul>
  
  <p>PS. Am I right that it's "include_docvars" in tokens() but "use_docvars" in corpus_reshape()? I seem to have this from the online reference docs.</p>