suffix_match {fgeo.plot} | R Documentation |
Suffix a strings where a vector exactly matches one specific string.
Description
Suffix a strings where a vector exactly matches one specific string.
Usage
suffix_match(string, to_match, .match, suffix)
Arguments
string |
A vector of strings to suffix. |
to_match |
A vector of strings to match with |
.match |
A string to match the vector |
suffix |
A suffix to add at the end of each element of |
Value
A modified version of x
.
Examples
suffix_match(
string = c("one", "banana"),
to_match = c("number", "fruit"),
.match = "number",
suffix = "_num"
)
suffix_match(
string = c("tag1", "tag2"),
to_match = c("dead", "not-dead"),
.match = "dead",
suffix = ".d"
)
vft <- data.frame(
Tag = c("01", "02"),
Status = c("dead", "alive"),
stringsAsFactors = FALSE
)
transform(vft, tagged = suffix_match(Tag, Status, "dead", ".d"))
[Package fgeo.plot version 1.1.11 Index]