rshinyr-flextable

Flextable word output only displays the classes but not the values


I have an rmd file that I use to generate a word report. The input comes from a shiny app I created. Specifically I want a dataframe name "BWCase" to be displayed as a flextable in my word report. The thing is the table gets displayed but only showing the classes not the values.

here's the output

to get the output shown i used the following code in my rmd file:

```{r results="asis"}

library(flextable)

BWCase <- as.data.frame(params$BWCase)
flex <- flextable(BWCase)

knit_print(flex)

```

the YAML part:

---
title: "`r params$head`"
author: "`r paste0('Name des Antragstellers: ' , params$name)`"
date: "`r params$date`"
output:
  word_document:
    reference_docx: C:/Users/.../Documents/ValERI/refDocValeri.docx
    toc: yes
    keep_md: yes
    fig_caption: yes
  pdf_document:
    toc: yes
  html_document:
    toc: yes
    df_print: paged
params:
  head: NA
  name: NA
  date: NA
  summary: NA
  decision: NA
  calc: NA
  time: NA
  price: NA
  degrad: NA
  risk: NA
  value: NA
  quali: NA
  sens_case: NA
  investitionen: NA
  BWCase: NA
  SensTable: NA
---

Solution

  • I turned all values into characters, using mutate_all from the dplyr package. Don't know what the actual problem was, maybe flextable doesn't take integers or mixed classes of values