I am producing a levelplot from a matrix. I have another matrix, of the same dimensions of the first one, with labels. I would like to add the labels to the plot -the square plotting a color for the value should also show the label. Is there a way to do that? Thanks in advance.
As an example, here is the following code. I would like each label in matrix source to be shown on top of the part of the graph corresponding to the same data in matrix value with the same coordinates.
library(lattice)
value <- matrix(data=2^seq(from=0.5,to=2,length.out=9),ncol=3,nrow=3)
colnames(value)<-c("wheat","barley","rice")
rownames(value)<-c("1970","1980","1990")
source <- matrix(data=c("A","A","B","A","B","C","C","B","C"),ncol=3,nrow=3)
levelplot(value,xlab="year",ylab="comodity",main="some plot")