| suffix_match | R Documentation |
Suffix a strings where a vector exactly matches one specific string.
suffix_match(string, to_match, .match, suffix)
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 |
A modified version of x.
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.