You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

调用gtsave()时出现Error in s$close()错误,求解决方案

使用gt包的gtsave()时偶现Error in s$close() : attempt to apply non-function错误的解决求助

我用gt包生成表格,调用gtsave()时偶尔会触发如下错误:

Error in s$close() : attempt to apply non-function

以下是我的会话信息:

> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9          later_1.3.0         cellranger_1.1.0    pillar_1.8.1        compiler_4.1.1      tools_4.1.1        
 [7] digest_0.6.29       jsonlite_1.8.0      googledrive_2.0.0   lifecycle_1.0.2     gargle_1.2.1        tibble_3.1.8       
[13] gtable_0.3.1        pkgconfig_2.0.3     rlang_1.0.5         svGUI_1.0.1         cli_3.4.0           rstudioapi_0.14    
[19] commonmark_1.8.0    curl_4.3.2          fastmap_1.1.0       webshot2_0.1.0      dplyr_1.0.10        stringr_1.4.1      
[25] generics_0.1.3      fs_1.5.2            vctrs_0.4.1         sass_0.4.2          svDialogs_1.1.0     websocket_1.4.1    
[31] googlesheets4_1.0.1 grid_4.1.1          tidyselect_1.1.2    chromote_0.1.1      glue_1.6.2          R6_2.5.1           
[37] processx_3.7.0      fansi_1.0.3         tidyr_1.2.1         purrr_0.3.4         ggplot2_3.3.6       magrittr_2.0.3     
[43] ps_1.7.1            promises_1.2.0.1    scales_1.2.1        htmltools_0.5.3     ellipsis_0.3.2      gt_0.7.0           
[49] colorspace_2.0-3    utf8_1.2.2          stringi_1.7.8       munsell_0.5.0

目前重新安装install.packages("webshot")后能暂时恢复正常,但这不是长久之计。我在两台独立电脑上更新了R、RStudio及所有包后,都能复现这个问题,希望能得到可行的解决建议。

内容的提问来源于stack exchange,提问作者melmo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 11:30:55