if I have the following example:
library(text2vec)
library(magrittr)
reviews <- movie_review[1:10,]
vocabInsomnia <- reviews$review %>% itoken(tolower, word_tokenizer, n_chunks = 10) %>%
create_vocabulary %>%
prune_vocabulary(term_count_min = 10, doc_proportion_max = 0.5) %>%
vocab_vectorizer %>%
create_dtm(<output_from_itoken>,<output_from_vocab_vectorizer>)
You can see that in the very last chain sequence I want to use the outputs of two of the previous steps as arguments to the create_dtm
function. I only know how to feed in the output from the chain directly before i.e. output from vocab_vectorizer
, but not the output from the function itoken
that was the first chain in the sequence. Does magrittr allow this?