text = c('A B C', 'D E F. G H I', 'A D', 'GGG')
tc = create_tcorpus(text, doc_id = c('a','b','c','d'), split_sentences = TRUE)
## subset by reference
tc$subset_query('A')
tc$meta
## using copy mechanic
class(tc$tokens$doc_id)
tc2 = tc$subset_query('A AND D', copy=TRUE)
tc2$get_meta()
tc$meta ## (unchanged)
Run the code above in your browser using DataLab