1

Following the example here in RStudio: https://cran.r-project.org/web/packages/tabplot/vignettes/tabplot-vignette.html

I get "Error in dim(values)...". This happens with any data set I try to plot using tableplot. Could it have something to do with my graphics device? I tried writing to a png but get the same error.

tableplot(diamonds)
Error in dim(values) <- c(rows, cols, 1) : 
  dims [product 539400] do not match the length of object [10]
2
  • 1
    Seems like maybe I was using the wrong package. I restarted, cleared my environment and ran: install.packages("tabplot") library(tabplot) and that fixed the error.
    – Nate Reed
    Commented Jan 13, 2016 at 21:07
  • Not sure where the tableplot() method was coming from if tabplot was not installed.
    – Nate Reed
    Commented Jan 13, 2016 at 21:10

2 Answers 2

8

I had the same issue. The problem is that there is a library called "tabplot" and a library called "tableplot" To make it even more confusing, they both have a tableplot function. Essentially you want:

tabplot::tableplot(diamonds)

Too many R packages.

1
  • I am not able to use package 'tabplot' as it seems deprecated in R version>3.6. I tried downloading package 'tableplot' instead but still the error persists. Is there any alternative way to generate plots as shown in the example with diamonds data? Commented Oct 30, 2020 at 5:56
3

the code you link to (with some install.packages added) works for me (R version 3.2.3 (2015-12-10) and ggplot2_2.0.0)

# install.packages("ggplot2", dependencies = TRUE)
require(ggplot2)
data(diamonds)
## add some NA's
is.na(diamonds$price) <- diamonds$cut == "Ideal"
is.na(diamonds$cut) <- (runif(nrow(diamonds)) > 0.8)

# install.packages("tabplot", dependencies = TRUE)
require(tabplot)
tableplot(diamonds)

sjhsj

1
  • Thanks for the answer. I think I need to close this question since I can't reproduce it, but I'm not sure how to do this on SO.
    – Nate Reed
    Commented Jan 13, 2016 at 23:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.