View source: R/isolate_sentinels.R
isolate_sentinels | R Documentation |
A sentinel value, takes the place of a value that isn't
available for some reason. isolate_sentinels()
removes these values from a
column of data into a separate column, and optionally converts the data left
behind into an appropriate data type.
isolate_sentinels(.data, col, sentinels, into = "sentinel")
.data |
A data frame. |
col |
The name of the column of data containing sentinel values. |
sentinels |
A vector of sentinel values to be removed. |
into |
A name to give the new column of sentinel values. |
x <- data.frame(name = c("Matilda", "Nicholas", "Olivia", "Paul"), score = c(10, "confidential", "N/A", 12), stringsAsFactors = FALSE) x isolate_sentinels(x, score, c("confidential", "N/A")) isolate_sentinels(x, score, c("confidential", "N/A"), "flag")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.