Reputation: 3531
I am plotting a table using following code but I found there is unnecessary column names V1 and V2 appear as column name.
statdat<-read.table("stat.txt",sep="\t",header=FALSE)
kable(statdat)
How can I avoid printing the column name?
Upvotes: 22
Views: 25038
Reputation: 1201
You can set col.names to NULL to remove the column names:
kable(statdat, col.names = NULL)
An alternative solution is to use format="pandoc"
and cat()
to select the relevant rows after the table has been created. This solution is given here: R- knitr:kable - How to display table without column names?
Upvotes: 37