add_value | R Documentation |
Manually change values in data.frames
add_value(x, row, col, value = NA)
x |
data.fram to be canged. |
row |
which row or which condition sex == "male" |
col |
which column |
value |
the value to be changed |
data.frame
DF <- data.frame(
pat.id = 1:5,
sex = factor(c("male", NA, "female", "male", "female")),
hight = c(170, 178, 185, 169, 10)
)
add_value(DF, 5, 3, NA)
add_value(DF, pat.id == 2, sex, "female")
add_value(DF, hight < 100, hight, 175)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.