frequency | R Documentation |
compute ratio of number of occurrences of query string divided by total number of words
frequency(texts.vec, starts, patterns)
texts.vec |
character vector of entire text |
starts |
integer vector of starting positions |
patterns |
vector of character string query patterns |
a list whose components are sub-lists
# indexed by the titles of the stories
start integer starting line in text
end integer ending line in text
wPerLine integer words perline
wordSum integer sum of wPerLine
patterns a sub-list
integer pPerLine integer patterns per line
patSum integer total of pPerLine
fraction numeric ratio of patSum/wordSum
fr<-frequency(texts.vec,starts,patterns)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.