View source: R/makeQueryTable.R
gsubAb | R Documentation |
Remove a pattern from a column, either modifying in place or creating a new column. The default pattern removes the prefix "anti-" or "Anti-", optionally followed by Human or human, then optionally a space or underscore
gsubAb(
df,
ab = "Antigen",
pattern = "[Aa]nti-([Hh]uman)?([ _]?)",
replacement = "",
new_col = NA
)
df |
A data.frame or tibble |
ab |
(character(1), default "Antigen) Name of the column to remove prefixes from |
pattern |
(character(1)) A regular expression for matching in column ab. |
replacement |
(character(1)) Replacement value, default "" (i.e. remove) |
new_col |
(character(1), default NA Name of the column to add to df. If NA, column ab is modified |
df, where prefixes such as "anti-human" have been removed from column "ab".
Helen Lindsay
df <- data.frame(Antigen = c("anti-Human CD8", "anti-mouse CD8"))
gsubAb(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.