I'm working on an RMarkdown document and am running across a strange issue.
My document currently has three chunks, the first one is a table, the second a ggplot, and the third another table being produced using the knitr kable function.
The problem comes in the third chunk. For some reason when I knit to pdf the first column name is blocked by a black box. What makes it even stranger is that it only blocks it the first time the column name appears (the table stretches across two pages) I can't figure out why this is happening or how to remove the box.
My settings are as follows
yaml header:
title: ''
graphics: yes
header-includes:
- \usepackage{graphicx}
- \usepackage{fancyhdr}
- \fancyfoot[LE,RO]{SIG}
- \usepackage{xcolor}
- \usepackage{colortbl}
output: html_document
params:
client: //filepath1.csv
clientname: clientname
clientsummary: //filepath2.csv
refdate: 09/11/2015
tables: yes
geometry: margin=2.25cm
chunk code:
```{r kable, echo=FALSE,results='asis', warning=FALSE}
options(scipen=4,digits=2)
cftest <- read.csv(params$client)
cftest$TradeDate=(as.Date(cftest$TradeDate,"%m/%d/%Y"))
cftest$noticeDate=(as.Date(cftest$noticeDate,"%m/%d/%Y"))
cftest=na.omit(cftest[order(cftest$TradeDate),])
cftest$TradeDate=(as.character(cftest$TradeDate))
cftest$noticeDate=(as.character(cftest$noticeDate))
library(knitr)
library(xtable)
library(gridExtra)
library(pander)
library(plyr)
cftest$OriginalAmount=format((cftest$OriginalAmount/1000000),big.mark = ",")
my.df=cftest[,c(1,3,6,9)]
kable(my.df,digits=2,row.names = FALSE,col.names=c("Notice Date","Amount ($M)","Trade Date","Manager"),caption="Possible Distributions")
If it helps I tried creating the table with xtable to see if that solved the problem but it does not. The black bar appears on the first column name as well.
I googled around for a while and it seems some people have a black bock appear on latex documents due to an overfull error but I don't see how that would be the case here,
I'm pretty perplexed by this, anyone have any thoughts?
p.s.
cftest is just a data frame with mixed data, numbers and text.