View source: R/charvec_to_casewhen_tc.R
charvec_to_casewhen_tc | R Documentation |
case_when()
statement for a set of values and copy it to the clipboardTakes a vector of values, creates a corresponding case_when()
statement
for those values, and copies that statement to the clipboard
charvec_to_casewhen_tc(x, varname = "variable", sort = TRUE)
x |
vector of values... there will be one |
varname |
string indicating name of variable for |
sort |
boolean. Should values in |
# charvec_to_casewhen_tc(c("northeast", "west", "south"),
# varname = "xvar")
#
# charvec_to_casewhen_tc(c("northeast", "west", "south"),
# varname = "xvar",
# sort = FALSE)
#
# charvec_to_casewhen_tc(c(1, 2, 3),
# varname = "xvar")
#
# charvec_to_casewhen_tc(c(1, 2, NA, 3),
# varname = "xvar")
#
# charvec_to_casewhen_tc(c(1, 2, NA, 3, 2),
# varname = "xvar")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.