switch_value

0th

Percentile

Switch the values of two variables

The values of two variables a and b are switched in an environment envir.

Usage
switch_value(a, b, envir = .GlobalEnv)
Arguments
a
the name of the first variable (character)
b
the name of the second variable (character)
envir
the environment of the variables a and b
Details

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.

Value

NULL

See Also

get, assign

Aliases
  • switch_value
Examples
x1 <- 4:9
x2 <- letters
switch_value("x1", "x2")
x1
x2
Documentation reproduced from package cranvas, version 0.8.5, License: GPL

Community examples

Looks like there are no examples yet.