How to work with tinytable in R markdown? (How to rotate or re-size a table?)

I am having issues with my tinytable in R markdown. The table expands past the edge of the page so I either need to rotate it or size it down. All the info I found online only talks about kable I really don't want to have to regenerate this table in a different package.

This is my rmd code:

---
title: "Extension Write Up"
author: "Kate Champion"
date: "2024-12-03"
output: pdf_document
---

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


Future text here.

```{r print_table}
setwd("/Users/katechampion/Documents/UCSD/ECON280/econ280project")
table_1 <- readRDS("02_code/table_1.rds")
table_1```

The forum won't let me upload the PDF as an attachment for some reason but here is a screenshot of the table.
temp-Imager6nl-Ca.avif

Someone else already suggested I try the following but trying to force a tinytable to work with kable only produced an error.

library(kableExtra)
library(knitr)

# Load your table from RDS
table_1 <- readRDS("02_code/table_1.rds")

# Create and rotate the table
kable(table_1) %>%
  kable_styling(full_width = F) %>%
  landscape()

Hi @katchampion ,

Here is some guidance on setting widths in tinytables here which can be applied across the table or specified for each column.

There's also the option to appy themes that rotate the table using LaTeX outputs from the {tinytable} package.

Do either of these approaches work for you?

1 Like