filterID {tosca} | R Documentation |
Subcorpus With ID Filter
Description
Generates a subcorpus by restricting it to specific ids.
Usage
filterID(...)
## Default S3 method:
filterID(text, id, ...)
## S3 method for class 'textmeta'
filterID(object, id, filtermeta = TRUE, ...)
Arguments
... |
Not used. |
text |
Not necassary if |
id |
Character: IDs the corpus should be filtered to. |
object |
A |
filtermeta |
Logical: Should the meta component be filtered, too? |
Value
textmeta
object if object
is specified,
else only the filtered text
. If a textmeta
object is
returned its meta data are filtered to those texts which appear in the corpus
by default (filtermeta
).
Examples
texts <- list(A="Give a Man a Fish, and You Feed Him for a Day.
Teach a Man To Fish, and You Feed Him for a Lifetime",
B="So Long, and Thanks for All the Fish",
C="A very able manipulative mathematician, Fisher enjoys a real mastery
in evaluating complicated multiple integrals.")
meta <- data.frame(id = c("C", "B"), date = NA, title = c("Fisher", "Fish"),
stringsAsFactors = FALSE)
tm <- textmeta(text = texts, meta = meta)
filterID(texts, c("A", "B"))
filterID(texts, "C")
filterID(tm, "C")
filterID(tm, "B")
filterID(tm, c("B", "A"), FALSE)
[Package tosca version 0.3-2 Index]