View source: R/transforms_text.R
parse_usubjid | R Documentation |
Recombine pieces of a delimited string
parse_usubjid(id, pick_parts, sep = "-", max_parts = 5)
id |
The USUBJID values |
pick_parts |
a numeric value or vector specifying which parts to recombine and in which order |
sep |
The delimiter between the parts. |
max_parts |
The maximum number of parts to allow for. |
Intended for use in simplifying USUBJID values, this function takes a column of text USUBJIDs, splits them by their delimiter ("-") and allows for recombining the parts.
A vector of the recombined elements from id.
parse_usubjid(c("1-2-3-4-5","3-28-123-12-41"),5)
# "5" "41"
parse_usubjid(c("1-2-3-4-5","3-28-123-12-41"),c(1,5))
# "15" "341"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.