简体   繁体   中英

change a cell value in a flextable

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM