Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

Plot categorical variable

$
0
0

I am new in R, and I follow the instruction slides to plot:

enter image description here

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.


Viewing all articles
Browse latest Browse all 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>