return R instruction to create levels

dput_levels(vec)

Arguments

vec

a factor or character vector

Value

a R instruction

Examples

dput_levels(iris$Species)
#> c("setosa", "versicolor", "virginica")