sFilter {tm} | R Documentation |
Filter metadata by special statements.
sFilter(object, s, ...)
object |
a TextDocCol to be the filter applied to. |
s |
a statement of format "tag1 = 'expr1' & tag2 =
'expr2' & ..." . |
... |
arguments passed over by calling functions. |
The statement s
models a simple query language. It consists of
an expression as passed over to a data frame for subsetting. Tags in
s
represent metadata variables. Variables only available at
document level are shifted up to the data frame if necessary. Note
that the metadata tags for the slots Author
, DateTimeStamp
,
Description
, ID
, Origin
and Heading
are
author
, datetimestamp
, description
,
identifier
, origin
and heading
, respectively, to
avoid name conflicts.
A Boolean vector to represent the subset of the DMetaData
(extended for shifted up variables) data frame as specified by the
statement.
Ingo Feinerer
## Load example dataset data(crude) ## Statement Filter returning TRUE for document with ID 127 and heading DIAMOND ... sFilter(crude, "identifier == '127' & heading == 'DIAMOND SHAMROCK (DIA) CUTS CRUDE PRICES'")