I've a data frame Matrix that I want to output to Excel with the following code:
writeData(wb_Matrix, list(Worksheet), Matrix, startCol = 2, startRow = 5)
Matrix looks like below when printed in R (column names dropped using colnames(Matrix) <- NULL)
c 86 2 2 4 6
c1 57 4 4 4 30
c2 33 17 0 17 33
c3 22 0 7 33 37
c4 4 0 0 0 96
In Excel, it becomes mangled like below, with 2 lines of header (one with V and the other X) added and data repeated in a single column after the last row.
V1 V2 V3 V4 V5
1 X1 X2 X3 X4 X5
2 86 2 2 4 6
3 57 4 4 4 30
4 33 17 0 17 33
5 22 0 7 33 37
4 0 0 0 96
NA NA NA NA NA
4
4
4
30
33
17
0
`
I've searched the web and can't find any post with similar problem.
I don't want the V and X headers and want to preserve the 5x5 format.
Any help is appreciated.