How to calculate the mutual information for continous data (as matrix) in R Suppose I have the following data: