I am new in R, and I follow the instruction slides to plot:
The survey[["Program"]]
is the categorical data column from the data frame.
> survey[["Program"]] # returns the Program column as a vector
[1] "PPM""PPM""PPM""Other""PPM""PPM""PPM""Other""PPM""Other""MISM""PPM""MISM"
[14] "Other""PPM""PPM""PPM""PPM""PPM""Other""PPM""MISM""PPM""PPM""PPM""MISM"
[27] "PPM""Other""Other""PPM""Other"
However, when I implement plot(survey[["Program"]])
, I get the error:
Error in plot.window(...) : need finite 'ylim' values
In addition: Warning messages:
1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf
I don't know why I cannot get the same result as I show in the figure.