public static StringMatrix pearsonCor(DataMatrix nm1, DataMatrix nm2, int m, int n, double r){
        List<String> result = new ArrayList<>();
        for(int i = 0; i < nm1.getDrow(); i++){
            for(int j = 0; j < nm2.getDrow(); j++){
                double[] a1 = Arrays.copyOfRange(nm1.getRow(i), 0, m);
                double[] a2 = Arrays.copyOfRange(nm2.getRow(j), 0, n);
                PairedData pd = new PairedData(a1, a2);
                double cor = new PearsonCorrelation(pd).getR();
                if(cor <= r){
                    result.add(nm1.getRowname(i) + "\t" + nm2.getRowname(j) + "\t" + cor);
                }
            }
        }
        
        StringMatrix out = new StringMatrix(result.size(), 3);
        for(int i = 0; i < result.size(); i++){
            String[] s = result.get(i).split("\t");
            for(int j = 0; j < s.length; j++){
                out.setValue(i, j, s[j]);
            }
        }
        return out;
    }