I am fairly new to R but trying to learn by doing
I am trying to plot a categorical (channel) against a continuous variable (sales).
Here is my data
print(columnValues)
channel_final tot_sales_year
1 Texas 5000.00
2 Mexico 8951.55
3 Mexico 0.23
4 Mexico 12.00
5 Mexico 250094.00
6 Texas 388859.38
Here is the code I am using to produce the graph
plot(columnValues[,1],columnValues[,2],xlab="independentColumnName",ylab="Test")
However I get an error
Error in plot.window(...) : need finite 'xlim' values
and some warnings
4: In min(x) : no non-missing arguments to min; returning Inf
5: In max(x) : no non-missing arguments to max; returning -Inf
What am I doing wrong? How do I fix this?
Thanks in advance for your help
Update #1 I have updated my plotting code to
boxplot(columnValues[,2]~columnValues[,1])
This works now.