I'm using the knitr
package to produce some basic table. I'm displaying the first n rows of a table on one slide and the last n rows of the same table on the next slide. I'm using head()
and tail()
to get the first and last rows.
Using head()
produces what I expect:
library(dplyr)
library(pander)
data.frame(a = sample(LETTERS, 10),
b = sample(LETTERS, 10)) %>%
head(5) %>%
pander()
Produces
-------
a b
--- ---
G B
I P
N H
U W
V A
-------
but
data.frame(a = sample(LETTERS, 10),
b = sample(LETTERS, 10)) %>%
tail(5) %>%
pander()
produces
----------------
a b
-------- --- ---
**6** Y B
**7** F O
**8** B H
**9** R Y
**10** W X
----------------
and I can't remove the row names from the final table.
The top answer here suggests that Pander removes the row names from a table when they are 1:n
but here, they begin with 1, so they're not removed automatically.
How can I prevent the row numbers from being displayed? I've tried using select()
as well as using the UPDATE from this question to no avail.