Drive the concordancer and return the concordance as a data.frame. See details for possible extra arguments.
a list of file and folder names
extra arguments to control the process. See Details.
Possible extra arguments are
locale: locale in ISO format, e.g. "en_US".
Defaults to whatever
encoding: the file encoding of the
files. Defaults to the
output: the folder that the results will land in before being served
back as a data.frame. Defaults to a temporary folder
progress: whether to show the progress of the java code as it goes
dictionary: a content analysis dictionary in ykd or vbpro format
category: optional name of a category within
pattern: a word or phrase, possible containing wildcard character '*'
window: how many words either side to show
prettyprint: Whether to paste an aligned collocation in result data.frame.
Defaults to TRUE
open.browser: Whether to try to open the concordance as a web page.
Defaults to FALSE
pattern must be provided. If
category may also be provided. If it is not then the concordance
is of all the patterns anywhere in the dictionary.
This function also dumps the location of the temporary folder where the results landed to standard error in case you want the original html data file from which the data.frame was extracted.
When the prettyprint option is FALSE the returned data.frame has three columns. The
first is the document from which the collocation line occurs 'Document', the second is the
left hand side of the collocation 'LHS' (the
window words leading up to the
pattern match), and the third is the pattern match and the
succeeding it 'Match.RHS'. Choose this option if e.g. you want to sort the data.frame by
match rather than by document, the default. If you just want to look at the
results aligned on the match then the default TRUE setting will be fine. Then
the columns will be 'Document' and 'Concordance'.
Note that you can also view the original webpage from which this function
scrapes the data.frame. It is in the folder that the function names
and is called 'concordance.html'. If you set
open.browser to TRUE then R will
attempt to open this file in a web browser.
Note: Concordances can get big but this function does not try to be efficient.
a data.frame containing
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.