frequency {SherlockHolmes} | R Documentation |
frequency
Description
compute ratio of number of occurrences of query string divided by total number of words
Usage
frequency(texts.vec, starts, patterns)
Arguments
texts.vec |
character vector of entire text |
starts |
integer vector of starting positions |
patterns |
vector of character string query patterns |
Value
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
Examples
fr<-frequency(texts.vec,starts,patterns)
[Package SherlockHolmes version 1.0.1 Index]