Get vector of variable values
get_var_values(x, data)
x | Either a name (string) or a positive integer which indicates
position of variable in |
---|---|
data | A data frame (or sililar structure). |
If x
is a vector of at least 2 elements,
this vector is returned.
If x
is a string or a number (length 1),
then data[[x]]
is returned.
If x
is NULL
, NULL
is returned.
#> [1] ctrl ctrl ctrl ctrl ctrl ctrl #> Levels: ctrl trt1 trt2#> [1] "group" "group"get_var_values(x = NULL, data = dataset)#> NULL