345 questions
0
votes
1
answer
63
views
How to further fine-tune the RTF output of gtsummary when pagination is needed?
Based on the previous solution,
Does the gtsummary package have a function that allows the exported table to include footnotes on every page?
I successfully implemented pagination for the RTF output, ...
-1
votes
1
answer
130
views
Convert a flextable into a dataframe
After something like:
library(tidyverse)
df <- tibble(a=c(1,2,3), b=c(4,5,6))
tbl <- df %>% flextable::flextable()
Is there a way to get back df from tbl?
2
votes
1
answer
102
views
How to make the title of a gtsummary object correctly paginated and left-aligned when exporting using officer/flextable?
I have two main questions here. The first is how to control the alignment of the title specified in modify_caption so that it is displayed left-aligned when exporting to RTF using flextable/officer. ...
0
votes
1
answer
68
views
Why are all flextable::border() borders visible in html but not in docx/rtf/pptx export?
When adding borders to a flextable manually via flextable::border() then these are visible in html display. However, when exporting to either one of docx, rtf or pptx then only the bottom one of the ...
0
votes
0
answers
43
views
How can I automatically make flextable::save_as_rtf() use the entire available page width? [duplicate]
If I run the code below, I get an rtf that does not seem to use the entire page width when opened in MS Word.
flextable::flextable(head(iris)) |>
flextable::save_as_rtf(path = "test1.rtf&...
1
vote
0
answers
59
views
RMarkdown - flextable paging in pdf
I'm having trouble paginating a flextable table when publishing it in an RMarkdown document.
The table has some merged columns. In the reproducible example, this is column 1.
In the sekwencja variable,...
3
votes
1
answer
90
views
Is it possible to fix the head for a long html flextable?
I am trying to have sticky headers like tables produced with kableExtra which is useful when inspecting long tables and was wondering if anyone has an idea how this may be doable with flextable.
Here'...
0
votes
0
answers
60
views
Function as_flex_table() Corrupting Word File when Knitting
The function as_flex_table() is causing my Word files to be corrupted when I knit to Word using R Markdown, despite the code running fine within R Studio.
The following code knits to Word with no ...
2
votes
2
answers
139
views
Method to set minimum column width in flextable
I'm looking for a way to apply autofit() only to columns that are too small.
This is my current method but I'm looking for a better way to do it:
library(flextable)
library(magrittr)
### Ex. Tbls
...
0
votes
0
answers
149
views
Flextable corrupts .docx when knitted/printed from .rmd/.qmd
I am producing a corrupted .docx when including flextable in my workflow.
The below examples have previously worked.
I updated most packages and environments (VS code) and pandoc. I cannot quite ...
1
vote
1
answer
84
views
GitLab CI/CD: apt-get Fails to Locate System Packages with r-base:latest Image [closed]
I'm trying to deploy an R Shiny app using GitLab CI/CD and publish it to Posit Connect. My goal is simple—I just want my GitLab pipeline to run my Shiny app (app.R) and deploy it.
I have very limited ...
1
vote
1
answer
94
views
flextable adding a new column when using tbl_stack in gtsummary
I'm using tbl_stack to combine two tables and I have a group header for each table.
It looks fine when I view the table in R - however, when I export the document to .docx format, flextable is adding ...
0
votes
0
answers
67
views
Render multiple data frame with flextable do not show
I have a data frame in R called data and looks like this:
library(tibble)
library(flextable)
library(dplyr)
# Create a tibble
data <- tibble(
country = c("USA", "Canada", &...
0
votes
1
answer
79
views
Conditional coloring in the Flextable in R
I have tibble (data frame) in R called table_factors that
at the end will be a flextable. I want to conditionally color the columns Results based on multiple and complex condition.
For example the ...
0
votes
1
answer
130
views
Font color in flextable text
I have a tibble in R that has text (string) in the 3rd column that its cells has character and number.I want the number only to be colored but the text to remain black.
Is that possible to do that in ...
1
vote
0
answers
119
views
Rows are disappearing after conversion using as_flextable
I'm encountering an issue with the flextable package in R. I have a data frame (elements_table) with 12 rows. However, when I create a flextable using as_flextable(elements_table), the resulting table ...
3
votes
1
answer
82
views
Conflict between flextable, ggplot2, and Arabic & Hindi
I'm having trouble getting ggplot2 to work with Arabic and Hindi when flextable is loaded.
Here's a first run that also includes English and Russian to demonstrate that everything works without ...
2
votes
1
answer
158
views
Created consistent caption formatting between figures and flextables in Rmd HTML output
I am having trouble getting my captions for figures and tables having consistent formatting when knitting a Rmd file to HTML output from the Bookdown package. I have tried applying different methods ...
2
votes
1
answer
183
views
flextable: I want to remove second level header [closed]
I am pretty new to R and trying to format a flextable. I would like to remove the second level header altogether (blue arrow).
I would like to remove the second level of the header. I've created the ...
0
votes
1
answer
372
views
How can I write a latex chunk inside an R chunk in Rmarkdown?
I want to create a PDF file with several instances of two side-by-side flextables. For this, I want to be able to use a loop, since I want all different flextables to have different input, provided ...
1
vote
2
answers
116
views
R flextable proc_freq remove counts
I want to show a crosstab of two variables in a flextable, but only show row/column/table percentages, not counts.
For example, if I run the collowing code
library(flextable)
proc_freq(
mtcars,
&...
1
vote
1
answer
154
views
Is there a way to get separate N and % columns using gtsummary and flextable?
I am making a descriptive table of categorical variables. gtsummary::tbl_summary combined with as_flextable and my own flextable adjustments gives me the APA-formatted table I want, with frequencies ...
0
votes
1
answer
53
views
Why is Row Percentage Still Showing in Flextable?
Despite using (what I believe to be) sufficient code to remove all percentages, they are still showing up in my flextable. If only attaining frequency for 1 variable, does the package simply require ...
-1
votes
1
answer
60
views
Colour body of flextable [closed]
I am piping data into the following in the hope to put a blue table around my data where am I going wrong?
|>
flextable::flextable() |>
colors(color = 'blue',part = "body")
I ...
3
votes
2
answers
271
views
Flextable conditional formatting based on a variable not shown in the output
I have a flextable that I am trying to conditionally format based on a variable that will not be shown in the output. Here are some dummy data:
library(tidyverse)
library(flextable)
set.seed(12345)
#...