library(tidyverse)
test_data <-
tibble(
Group = sample(c("Apple", "Pear"), size = 10, replace = TRUE),
A = sample(c(NA_integer_, 1:3), size = 10, replace = TRUE),
B = sample(c(NA_integer_, 4:6), size = 10, replace = TRUE),
C = sample(c(NA_real_, seq(from = 6.01, to = 6.09, by = 0.01)), size = 10, replace = TRUE),
D = sample(c(NA, TRUE, FALSE), size = 10, replace = TRUE)
) %>%
dplyr::mutate(E = B)
categorize(data = test_data,
col = A,
Odd = as.character(seq(from = 1,
to = 10,
by = 2)),
other_values = "Even")
categorize(data = test_data,
col = A,
Odd = as.character(seq(from = 1,
to = 10,
by = 2)),
other_values = "Even",
na_level = NULL)
categorize(data = test_data,
col = A,
Odd = as.character(seq(from = 1,
to = 10,
by = 2)),
Even = as.character(seq(from = 2,
to = 10,
by = 2)),
na_level = NULL)
categorize(data = test_data,
col = A,
Odd = as.character(seq(from = 1,
to = 10,
by = 2)),
Even = as.character(seq(from = 2,
to = 10,
by = 2)))
# Recode
recode_value(data = test_data,
col = A,
One = as.character(1),
Two = as.character(2))
recode_boolean(data = test_data,
col = Group,
true_value = "Pear",
false_value = "Apple")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.