powered by
Function to convert a record into a bag of tokens with a fieldwise flag
bag_of_word_ify(record, k, fieldwise = FALSE)
String or record
Parameter k, which is the number of shingle, tokens, or grams to break the string into
Flag where the defalt setting to include the record as the entire string
Computes the bag of tokens for a string
# NOT RUN { data(RLdata500) data.500 <- RLdata500[-c(2,4)] bag_of_word_ify(data.500[1,c(-2)],k=2) bag_of_word_ify(data.500[300,c(-2)],k=2) names(bag_of_word_ify(data.500[300,c(-2)],k=2)) # }
Run the code above in your browser using DataLab