Description Usage Arguments Details Value Author(s) See Also Examples
The values of two variables a
and b
are switched in an
environment envir
.
1 | switch_value(a, b, envir = .GlobalEnv)
|
a |
the name of the first variable (character) |
b |
the name of the second variable (character) |
envir |
the environment of the variables |
This function can make it a little bit easier when a plot can be drawn vertically and horizontally, in which case we only need to switch some attributes in the x-axis and y-axis, and the code for actual drawing is not affected. The bar plot is such an example.
NULL
Yihui Xie <http://yihui.name>
1 2 3 4 5 | x1 <- 4:9
x2 <- letters
switch_value("x1", "x2")
x1
x2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.