I am new to R, and I'm trying to generate a mosaic plot using the VCD package in R but my code generates the following error:
Setting row names on a tibble is deprecated.
Error in loglin(x, expected, fit = TRUE, print = FALSE) : (list) object cannot >be coerced to type 'double'
My data set is as follows:
Store 16-24 25-34 35-49 50+
A 37 39 45 64
B 13 13 23 38
C 33 69 67 56
D 16 31 34 22
E 8 16 21 35
With Store ID in the first column and Age ranges in columns 2-4.
My code to generate the mosaic plot is:
library(readr)
SandA = readr::read_csv("StoresAndAges.csv", col_names = TRUE)
SandA
library(vcd)
mosaic(SandA, shade=TRUE, legend=TRUE)
I am brand new to R, so any help pointing me in the right direction is appreciated.