我正在尝试使用huxtable和flextable将表编织成单词,但是它不起作用

问题描述

最近,使用不同的软件包来格式化我的表以便rmarkdown输出到word时,我一直遇到很多困难。我读过的最有前途的东西是使用huxtable,然后输出到flextable。但是,问题仍然存在:

样本数据集:

       wrestler   championship                                  reign      personal reign  days   date
1      Ric Flair  NWA World Heavyweight Championship              40            8          69   1991-01-11 1991-03-21
2           Sting NWA World Heavyweight Championship              39            1         188   1990-07-07 1991-01-11
3      Ric Flair  NWA World Heavyweight Championship              38            7         426   1989-05-07 1990-07-07
4 Ricky Steamboat NWA World Heavyweight Championship              37            1          76   1989-02-20 1989-05-07
5      Ric Flair  NWA World Heavyweight Championship              36            6         452   1987-11-26 1989-02-20
6   Ronnie Garvin NWA World Heavyweight Championship              35            1          62   1987-09-25 1987-11-26

我尝试的代码

joined_ex <- joined_ex %>% 
  as_hux() %>% 
  theme(grey) %>% 
  as(flextable)

Error in is(object,Class) : 
  trying to get slot "className" from an object of a basic class ("function") with no slots
Calls: <Anonymous> ... _fseq -> freduce -> withVisible -> <Anonymous> -> as -> is

我也尝试过:

hux_joined_ex <- as_hux(joined_ex) %>% 
  theme(grey)

flextable_joined_ex <- as_flextable(hux_joined_ex)


Error in UseMethod("as_flextable") : 
  no applicable method for 'as_flextable' applied to an object of class "c('theme','gg')"
Calls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> as_flextable

有人知道我如何使用huxtable格式,同时又将其转换为flextable以便可以将其转换为word吗?谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)