Skip to contents

Move outcome to last column

Usage

set_outcome(dat, outcome_column)

Arguments

dat

data.frame or similar.

outcome_column

Character: Name of outcome column.

Value

object of same class as data

Author

EDG

Examples

ir <- set_outcome(iris, "Sepal.Length")
head(ir)
#>   Sepal.Width Petal.Length Petal.Width Species Sepal.Length
#> 1         3.5          1.4         0.2  setosa          5.1
#> 2         3.0          1.4         0.2  setosa          4.9
#> 3         3.2          1.3         0.2  setosa          4.7
#> 4         3.1          1.5         0.2  setosa          4.6
#> 5         3.6          1.4         0.2  setosa          5.0
#> 6         3.9          1.7         0.4  setosa          5.4