dsSearch {readMLData} | R Documentation |
Search a dataset by string matching against the names stored
in dsList
.
Description
The function allows string matching against some of the fields
"identification", "fullName", "dirName", "files"
of the
structure describing the data sets.
Usage
dsSearch(dsList, id, searchField=c("identification", "fullName", "dirName", "files"),
searchType=c("exact", "prefix", "suffix", "anywhere"), caseSensitive=FALSE)
Arguments
dsList |
Data frame as created by |
id |
Character of length one or numeric of length at most |
searchField |
Character. Name of a column in |
searchType |
Character. Type of search. |
caseSensitive |
Logical. Whether the search should be case sensitive. |
Details
The parameter searchField
determines, which column of dsList
is searched, parameters searchType
and caseSensitive
influence the type of search. These three parameters are ignored, if
id
is numeric.
Regular expressions are not used. Matching with searchType="exact"
is done with ==
, searchType="prefix"
and searchType="suffix"
are implemented using substr()
, searchType="anywhere"
is
implemented using grep(, fixed=TRUE)
.
Value
Data frame containing the indices and identification of the matching data sets and the value of the search field, if applicable.
Author(s)
Petr Savicky
See Also
Examples
pathData <- getPath("exampleData")
pathDescription <- getPath("exampleDescription")
dsList <- prepareDSList(pathData, pathDescription)
dsSearch(dsList, "ident", searchField="fullName", searchType="anywhere")