I have finished my analysis. And my final output is matrix even with row and colomn names. Now I just need to make a nice table with lines and output it as (may be a pdf) or (may be like an editable word file).
I did my own research and saw that there are many packages like xtable and knitr. But when i install those packages and execute a code. I just get bunch of codes as Output.
mat <- matrix(c(1:91), ncol = 7, byrow=F)
rownames(mat) <- c("Y1","Y2","Y3","Y4","Y5","Y6","Y7","Y8","Y9","Y10",
"Y11", "Y12", "Total water")
colnames(mat) <- c("Runoff", "RM", "DEEP Percolation", "ET",
"Lateralflow", "Change in SW", "Change in FW")
mat
library(knitr)
kable(mat)
library(xtable)
xtable(mat, type="latex")
When i use kable, i get a table but i dont get the formatted table (like you can make in words). When i use xtable, i just get bunch of codes as output.
I feel like i am missing something very simple here. Maybe i need to add Latex to my R? so that when i run the code i will get table instead of code as an output.
I would appreciate if someone could nudge me in the right direction. Or any simple solution would be helpful too.