Write a R program to find the levels of factor of a given vector.
v = c(1, 2, 3, 3, 4, NA, 3, 2, 4, 5, NA, 5) print("Original vector:") print(v) print("Levels of factor of the said vector:") print(levels(factor(v)))
Sample Output:
[1] "Original vector:" [1] 1 2 3 3 4 NA 3 2 4 5 NA 5 [1] "Levels of factor of the said vector:" [1] "1" "2" "3" "4" "5"
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer