new outputs matrix to csv file for R