I,m new to R and LATEX(sorry for the spelling, but I don't know how to generate the classic version of latex here on OS). Anyway, here is my question.
I have a little bit long but narrow table, so I want to break them in two and make them look like enter image description here
the latex will automatically add .1 to the headers of the right half, like "Industry" in the left part but "Industry.1" in the right, what I want is "Industry" on both half, below is my data and code.
any helpful suggestion will be deeply appreciated.
\documentclass[11]{article}
\title{Privatization Report}
\author{JiaGao, PhD}
\usepackage{float}
\usepackage{array}
\usepackage[top = 0.5in, bottom = 0.5in, left = 1in, right = 1in]{geometry}
\begin{document}
\maketitle
INDUSTRY.DATA<-read.dta13("industrycode.dta")
DECRIB.DATA<-read.dta13("describe_V1.dta")
indu.count<-data.frame(table(DECRIB.DATA$industrycode2))
indu.count<-rename(indu.count,c(Var1 = "industrycode2"))
INDUSTRY.DATA<-merge(INDUSTRY.DATA,indu.count,by.x="industrycode2",
by.y = "industrycode2",all.x=TRUE)
na.list<-which(is.na(INDUSTRY.DATA$Freq == "NA"))
INDUSTRY.DATA$Freq<-replace(INDUSTRY.DATA$Freq, na.list,0)
INDUSTRY.DATA$Perc<-INDUSTRY.DATA$Freq/sum(INDUSTRY.DATA$Freq)
rm(na.list,indu.count)
<<echo = FALSE, results = 'asis'>>=
industryTable<-data.frame("Industry" = INDUSTRY.DATA[1:15,]$industryname,
"Freq" = INDUSTRY.DATA[1:15,]$Freq,
"Perc" = INDUSTRY.DATA[1:15,]$Perc,
"Industry" = INDUSTRY.DATA[16:30,]$industryname,
"Freq" = INDUSTRY.DATA[16:30,]$Freq,
"Perc" = INDUSTRY.DATA[16:30,]$Perc)
print(xtable(industryTable,caption = "Distribution of Privatization Across Manufacturing", label = "table:industry",align = c("c","p{4.5cm}","c","c","|p{4.5cm}","c","c"),digits = c(0,0,0,2,0,0,2)),caption.placement="top", include.rownames = FALSE)
@
\end{document}