I want to visualize/plot data with a color scale represents the value in the GIC.Fish and GIC. Zoop columns by Dive.Number. This is somewhat like a correlation matrix or heat map, except that the Fish and Zoop values are not related to one another, but are related to the dive number. The following data is a data frame "temp".
Dive.Number GIC.Fish GIC.Zoop
[1,] 1 0.83 0.37
[2,] 2 0.88 0.41
[3,] 3 0.98 0.57
[4,] 4 0.90 0.43
[5,] 5 1.00 0.58
[6,] 6 0.92 0.44
[7,] 7 0.71 0.33
[8,] 8 0.99 0.55
[9,] 9 0.94 0.47
[10,] 10 0.95 0.48
[11,] 11 0.91 0.44
[12,] 12 0.96 0.50
[13,] 13 0.86 0.39
[14,] 14 0.94 0.47
[15,] 15 0.91 0.43
[16,] 16 0.89 0.41
[17,] 17 0.92 0.45
[18,] 18 0.94 0.47
[19,] 19 1.00 0.59
[20,] 20 0.96 0.53
[21,] 21 0.96 0.52
[22,] 22 1.00 0.68
[23,] 23 0.99 0.73
[24,] 24 0.98 0.77
[25,] 25 0.96 0.80
[26,] 26 0.83 0.98
[27,] 27 0.72 1.00
[28,] 28 0.98 0.77
[29,] 29 0.44 0.73
[30,] 30 0.29 0.44
[31,] 31 0.31 0.48
[32,] 32 0.64 0.97
[33,] 33 0.08 0.04
[34,] 34 0.09 0.05
[35,] 35 0.61 0.96
[36,] 36 0.36 0.59
This code gets me somewhat close, but with only one column of relevant data.
p<-ggplot(temp, aes(x=GIC.Fish, y=Dive.Number, fill=GIC.Fish))+
geom_tile() +
scale_fill_gradient2(midpoint=.5, low="blue", high="red") +
guides(fill=FALSE)
This gets me even closer, but I don't want a column for Dive Number, nor do I want to show the actual values in the cells and I'd like to be able to change the colors in the colorbar.
setInternet2(TRUE)
con = gzcon(url('http://www.systematicportfolio.com/sit.gz', 'rb'))
source(con)
close(con)
as.matrix(temp)
plot.table(temp, highlight=TRUE, colorbar=TRUE)