hughjonesd / huxtable

An R package to create styled tables in multiple output formats, with a friendly, modern interface.
http://hughjonesd.github.io/huxtable
Other
321 stars 28 forks source link

add_<row or col>names #10

Closed cklett closed 7 years ago

cklett commented 7 years ago

I am working with R Markdown to produce a PDF file. I have an issue while using add_colnames, and trying to avoid the "rownames" column name.

Please, see attached files (I had to rename the huxtable.Rmd file to huxtable.Rmd.txt)

huxtable.pdf huxtable.Rmd.txt

I could not check with other environments, but it was not working in Windows 7, in a 3.3.0 R version.

Thank you.

hughjonesd commented 7 years ago

The code fails because you are not assigning back to ht2 in the add_colnames(...) command. Try this:

ht2 <- as_hux(htdf)
ht2 <- add_colnames(add_rownames(ht2, colname = ''))
na_string(ht2) <- "NA"
set_rotation(ht2, row=1, col=1:6, value=90)