To investigate this, you need to do str () in two cases of "smoke":
> str(smoke) table [1:3, 1:3] 51 92 68 43 28 22 22 21 9 - attr(*, "dimnames")=List of 2 ..$ : chr [1:3] "current" "former" "never" ..$ : chr [1:3] "High" "Low" "Middle" > str( smoke[,c("Low", "Middle", "High")] ) num [1:3, 1:3] 43 28 22 22 21 9 51 92 68 - attr(*, "dimnames")=List of 2 ..$ : chr [1:3] "current" "former" "never" ..$ : chr [1:3] "Low" "Middle" "High"
The first is a table object, and the second is a matrix. You could also make class () on both and get a slightly more compact answer. To see why this is important, see also
methods(plot)
.... and we see that there is a plot.table* method. "*" Indicates that it is not "visible", and you needed to see the code that you need to use:
getAnywhere(plot.table)
As Ananda has shown, you can restore the table class for this smoke object, and then get the sending system to send the plot.table* object.
source share