View source: R/fix_database_error.R
fix_database_error | R Documentation |
Use this function to make updates to your data while avoiding adding PHI,
such as MRNs, to your code and subsequently PHI in GitHub. You provide a file
of database fixes that is three columns: 1. An expression that selects a line
in the database to update (e.g. MRN == "12345678"
), 2. The column name that
will be updated, and 3. The updated value. See the examples for the
structure of the database fix input.
fix_database_error(data, engine = readr::read_csv, ...)
data |
data frame with errors |
engine |
function to import file of database fixes |
... |
arguments passed to the engine function to import the database fixes |
updated data frame
df_fixes <-
tibble::tribble(
~id, ~variable, ~value,
"id == 1", "age", "56",
"id == 2", "trt", "Drug C"
)
trial %>%
dplyr::mutate(id = dplyr::row_number()) %>%
fix_database_error(
engine = I,
x = df_fixes
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.