0

I'm using RStudio's R Notebook and would like to view 12 rows in my table, rather than have it limited to 10. I know you can click through to see the last two but I'd like to show all 12.

I have tried:

head(table_name, 12)

but that doesn't work. Any ideas?

thanks!

example table showing only 10 or the 12 rows

threeisles
  • 301
  • 2
  • 8

1 Answers1

0

Options with {knitr} or {DT}:

With {knitr}

```{r}
library(knitr)
kable(head(iris, 12))
```

Gives you:

enter image description here

Or with {DT}:

```{r dt}

library(DT)
datatable(head(iris, 12),  options = list(pageLength = 12))
```

enter image description here

Peter
  • 11,500
  • 5
  • 21
  • 31