Description Usage Arguments Details Value Examples
This method performs a summary
call on all text objects inside the given
object
object. Contrary to what other summary methods do, this method
always returns the full object with an updated summary
slot.
1 2 3 4 5 6 7 8 9 10 11 12 | ## S4 method for signature 'kRp.corpus'
summary(object, missing = NA, ...)
corpusSummary(obj)
## S4 method for signature 'kRp.corpus'
corpusSummary(obj)
corpusSummary(obj) <- value
## S4 replacement method for signature 'kRp.corpus'
corpusSummary(obj) <- value
|
object |
An object of class |
missing |
Character string to use for missing values. |
... |
Used for internal processes. |
obj |
An object of class |
value |
The new value to replace the current with. |
The summary
slot contains a data.frame with aggregated information of
all texts that the respective object contains.
corpusSummary
is a simple method to get or set the summary
slot
in kRp.corpus objects directly.
An object of the same class as object
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # use readCorpus() to create an object of class kRp.corpus
# code is only run when the english language package can be loaded
if(require("koRpus.lang.en", quietly = TRUE)){
myCorpus <- readCorpus(
dir=file.path(
path.package("tm.plugin.koRpus"), "examples", "corpus", "Edwards"
),
hierarchy=list(
Source=c(
Wikipedia_prev="Wikipedia (old)",
Wikipedia_new="Wikipedia (new)"
)
),
# use tokenize() so examples run without a TreeTagger installation
tagger="tokenize",
lang="en"
)
# calculate readability, but prevent a summary table from being added
myCorpus <- readability(myCorpus, summary=FALSE)
corpusSummary(myCorpus)
# add summaries
myCorpus <- summary(myCorpus)
corpusSummary(myCorpus)
} else {}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.