I have a data frame called df i a rmarkdown (pdflatex not xelatex) in Rmarkdown.
---
title: "t2"
output: pdf_document
date: "2024-04-30"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
suppressMessages(library(tidyverse))
suppressMessages(library(knitr))
suppressMessages(library(gt))
suppressMessages(library(rmarkdown))
df = structure(list(projects = c("Restaurant, Pizzeria and Pasta House Works for New York",
"London Project - New Restaurant Project",
"Athens - Beautiful Lands for Aigaleo City Project",
"Berlin City - Exhibition near the airport with restaurants",
"Pizzeria Buenos Aires New italian restaurant - pasta, tartufo and vino",
"area mean value", "total mean value"),
happiness.and.joyfullness = c(3.5,4, 3, 3.2, 4, 5, 3),
joy.for.children = c(3, 5, 3, 4, 5,4, 4),
area = c(3, 5, 3, 3, 3, 4, 4),
damages.from.environment = c(2,4, 2, 3, 3, 5, 5),
approach = c(3, 1, 5,3, 5, 5, 4),
expensive = c(3, 5, 3, 4, 5, 5, 5),
safety.comes.first = c(5,5, 5, 5, 5, 5, 4),
hungry = c(3, 5, 2, 4, 5,5, 5)),
row.names = c(NA, -7L),
class = c("tbl_df", "tbl","data.frame"))
df %>%
gt() %>%
cols_label("happiness.and.joyfullness" = md("happiness<br>and<br>joyfullness")) %>%
cols_label("joy.for.children" = md("joy<br>for<br>children")) %>%
cols_label("damages.from.environment" = md("damages<br>from<br>environment")) %>%
cols_label("safety.comes.first" = md("safety<br>comes<br>first")) %>%
tab_style(
style = "vertical-align:middle; font-weight: bold",
locations = cells_column_labels()
)
when i render it to pdf the resulted table is positioned to the left and only half of the tyable is visible.Also how can i remove the summarise warning that appear in the pdf ?