gds_binary | R Documentation |
internal function to make all "yes" answers equal to 1, and all "no" to 0. This for convenience of calculations later.
gds_binary(x, values = gds_values())
x |
vector of yes and no coding |
values |
named vector of 2 providing the coding for Yes and No answers c(Yes = 1, No = 2) |
vector of 0's and 1's
Other gds_functions:
gds_alter_values()
,
gds_compute_sum()
,
gds_values()
gds_binary(c(1,1,0,NA,1), gds_values(1,0))
gds_binary(c("y","y","n",NA,"y"), gds_values(yes = "y", no = "n"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.