Basically I want to know if I can generate a heatmap where the color scales are based on the range of values in each column. The solution does not necessarily have to do any clustering or produce a dendrogram.
I have a data frame with a range of different types of variable. Some are continuous, while others are dummy variables, or ordinal. I understand that I need to pass the data to any clustering function as numeric and that the daisy() function is the best option for clustering here.
I want to produce a heatmap, like the ones produced with heatmap and heatmap.2, however the scaling causes problems in the visualization. This question helped me figure out how to get daisy() to work with heatmap.2, but the scaling by column means that the colors assigned to the dummy variables different by column. For example instead of red=1 and white=0 for all columns with dummy variables, the shades very due to different means and standard deviations. Alternatively, if I turn the scaling off, there is virtually no variation in the shades across the entire dataset. It seems that the range of colors is based on the range of the entire data frame, instead of each column.
I will try and add some examples when I have a moment.
Edit
Ok so that was obviously unclear.
The examples for heatmaps I've come across scale the colors based on the minimum and maximum values of the entire dataframe. So, given a dataframe like this:
Row Var 1 Var2
1 1 1
2 -5 10
3 0 7
and I set blue to the lowest cells, white to represent the middle values, red to represent the highest cells. The result will look something like this:
Row Var 1 Var2
1 White White
2 Blue Red
3 Blue Red
Instead, I want the scale to be dependent on the values in each column, wit the result looking like this:
Row Var 1 Var2
1 White Blue
2 Blue Red
3 Red White