I'm experimenting with plot in R and I'm trying to understand why it has the following behaviour.
I send a table into the plot function and it gives me a very nice variwidth graph which is quite insightful. However, after I reorder the columns of the table and send it to plot again, I get an odd scatter plot. What has happened in the re-ordering and how can I avoid this?
smoke <- matrix(c(51,43,22,92,28,21,68,22,9),ncol=3,byrow=TRUE)
colnames(smoke) <- c("High","Low","Middle")
rownames(smoke) <- c("current","former","never")
smoke <- as.table(smoke)
plot(smoke) # This gives me a variwidth plot
smoke = smoke[,c("Low", "Middle", "High")] # I reorder the columns
plot(smoke) # This gives me a weird scatter plot