# For a 'freqlist' object---------------------
(flist <- freqlist("The man and the mouse.", as_text = TRUE))
keep_bool(flist, type_freqs(flist) < 2)
drop_bool(flist, type_freqs(flist) >= 2)
keep_bool(flist, ranks(flist) <= 3)
keep_bool(flist, c(FALSE, TRUE, TRUE, FALSE))
(flist2 <- keep_bool(flist, type_freqs(flist) < 2))
keep_bool(flist2, orig_ranks(flist2) > 2)
# For a 'types' object ----------------------
(tps <- as_types(letters[1:10]))
keep_bool(tps, c(TRUE, FALSE))
drop_bool(tps, c(TRUE, FALSE))
# For a 'tokens' object ----------------------
(tks <- as_tokens(letters[1:10]))
keep_bool(tks, c(TRUE, FALSE))
drop_bool(tks, c(TRUE, FALSE))
Run the code above in your browser using DataLab