The columns represent the grade of response of the respondent and the rows are the representation of the groups of ages. The table was generated with a (matrix?), the goal is to (graph? O make graphic) how the different groups of ages behave with the responses
tabla<-matrix(c(0, 0, 0, 1, 0, 0,
1, 0, 0, 0, 9, 0,
9, 1, 1, 5, 22, 0,
18, 1, 3, 1, 27, 1,
25, 7, 4, 6, 22, 3,
20, 2, 0, 0, 18, 1,
6, 2, 0, 2, 22, 0,
2, 0, 1, 1, 0, 4,
12, 0, 0, 5, 6, 0),ncol=6,byrow=TRUE)
colnames(tabla)<-c("No","is a problem","lite preblem","a moderate proble","Big problem","No respond")
rownames(tabla)<-c("16-24.5","24.5-33","33-41.5","41.5-50","50-58.5","58.5-67","67-75.5","75.5-84","No responde")
I think heatmap is a good choice. Here is a solution using the tidyverse
package.
library(tidyverse)
tabla2 <- tabla %>%
as.data.frame() %>%
rownames_to_column() %>%
gather(Column, Value, -rowname)
ggplot(tabla2, aes(x = rowname, y = Column, fill = Value)) +
geom_tile() +
scale_fill_gradientn(name = "", colors = terrain.colors(10)) +
scale_x_discrete(name = "") +
scale_y_discrete(name = "")