3

Is-there a way to change a value in a flextable? in version 0.4.7.003 it was possible to do it like this (this doesn't work anymore in 0.5.1):

library(flextable)
ft <- flextable( head( iris ))
ft$body$dataset[2,5] <- 'XXXXXXXX'
ft
Po78
  • 143
  • 1
  • 7

1 Answers1

6

You can use the function flextable::compose:

library(flextable)
ft <- flextable( head( iris ))
ft <- compose(ft, i = 2, j = 5, as_paragraph(as_chunk('XXXXXXXX')))
ft
David Gohel
  • 9,180
  • 2
  • 16
  • 34