# For a 'freqlist' object --------------------
(flist <- freqlist("The man and the mouse.", as_text = TRUE))
keep_pos(flist, c(2, 3))
# For a 'types' object -----------------------
(tps <- as_types(letters[1:10]))
keep_pos(tps, c(1, 3, 5, 7, 9))
drop_pos(tps, c(1, 3, 5, 7, 9))
# For a 'tokens' object ----------------------
(tks <- as_tokens(letters[1:10]))
keep_pos(tks, c(1, 3, 5, 7, 9))
drop_pos(tks, c(1, 3, 5, 7, 9))
Run the code above in your browser using DataLab