Accessor methods for various corp_* objects.
# S3 method for corp_text
corp_get_text(obj)
# S3 method for corp_cooccurrence
corp_get_text(obj) # S3 method for corp_cooccurrence
corp_get_text_obj(obj)
# S3 method for corp_text
corp_get_tokens(obj)
# S3 method for corp_cooccurrence
corp_get_tokens(obj)
# S3 method for corp_text
corp_get_metadata(obj)
# S3 method for corp_cooccurrence
corp_get_metadata(obj)
# S3 method for corp_concordance
corp_get_metadata(obj)
# S3 method for corp_coco
corp_get_metadata(obj)
# S3 method for corp_cooccurrence
corp_get_counts(obj)
Returns a character string of the text that the co-occurrence
counts were calculated against.
This comes from the corp_text object used to create
the corp_cooccurrence object.
Returns a data.table of the tokenization that the co-occurrence
counts were calculated against.
This comes from the corp_text object used to create
the corp_cooccurrence object.
Returns a data.table
containing the co-occurrence counts.
Note that a data.table is also a data.frame so
if the data.table library is not loaded the returned
object will behave exactly as a data.frame; however,
for large data sets there will be significant performance
enhancement offered by exploiting data.table functionality.
The data.table is of the form:
Classes ‘data.table’ and 'data.frame': ...
$ x: chr
$ y: chr
$ H: int
$ M: int
- attr(*, "sorted")= chr "x" "y"
- attr(*, ".internal.selfref")=<externalptr>
where H is the number of times x types
co-occurs with y types (think Hits), and M
is the number of times x types fail to co-occur with
y types when they could have (think Misses);
hence H + M is the maximum number of times
that x types can co-occur with y types.
A corp_* object.