Home > Software design >  htmlTable producing row numbers
htmlTable producing row numbers

Time:09-09

I'm putting a table into an RMarkdown presentation and it is producing erroneous row numbers in the output I've got this:

library(htmlTable)

d <- data.frame(
    x=c('1','2','3'),
    y=c('A','B','C')
)

htmlTable(d)

Here's a picture of the output

How do I remove these?

CodePudding user response:

Set rnames equals to FALSE.

---
title: "htmlTable"
output: html_document
---


```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```


```{r}
library(htmlTable)

d <- data.frame(
    x=c('1','2','3'),
    y=c('A','B','C')
)

htmlTable(d, rnames = FALSE)
```


CodePudding user response:

library("xtable")

d <- data.frame(
    x=c('1','2','3'),
    y=c('A','B','C')
)

print(xtable(d), type="html", include.rownames = FALSE)
  • Related