tomwenseleers / export

R package for streamlined export of graphs and data tables.
192 stars 35 forks source link

Error in options()$device != FALSE #26

Closed bingyu19821270 closed 4 years ago

bingyu19821270 commented 4 years ago

Hello~

I just tested if I installed it right, and got the following error report.

Error in options()$device != FALSE : comparison (2) is possible only for atomic and list types

The test code is quite simple, as follows: AA <- 1:100 BB <- 2*AA plot(AA,BB) graph2ppt(file="AA_BB_test.ppt")

Could you please tell me what might be wrong? Thanks very much!

Best regards,

Tricia

sessionInfo()

R version 3.6.3 (2020-02-29) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale: [1] LC_COLLATE=Chinese (Simplified)_China.936 [2] LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936 [4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936

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

other attached packages: [1] export_0.2.2.9000 devtools_2.2.2 usethis_1.5.1

loaded via a namespace (and not attached): [1] rgl_0.100.50 Rcpp_1.0.3 lattice_0.20-38
[4] tidyr_1.0.2 prettyunits_1.1.1 ps_1.3.2
[7] assertthat_0.2.1 rprojroot_1.3-2 digest_0.6.25
[10] mime_0.9 R6_2.4.1 backports_1.1.5
[13] evaluate_0.14 pillar_1.4.3 gdtools_0.2.1
[16] rlang_0.4.4 curl_4.3 uuid_0.1-4
[19] miniUI_0.1.1.1 data.table_1.12.8 callr_3.4.2
[22] flextable_0.5.8 rmarkdown_2.1 desc_1.2.0
[25] webshot_0.5.2 htmlwidgets_1.5.1 shiny_1.4.0
[28] broom_0.5.5 compiler_3.6.3 httpuv_1.5.2
[31] xfun_0.12 pkgconfig_2.0.3 systemfonts_0.1.1
[34] base64enc_0.1-3 pkgbuild_1.0.6 rvg_0.2.4
[37] htmltools_0.4.0 tidyselect_1.0.0 tibble_2.1.3
[40] fansi_0.4.1 crayon_1.3.4 dplyr_0.8.4
[43] withr_2.1.2 later_1.0.0 grid_3.6.3
[46] jsonlite_1.6.1 xtable_1.8-4 nlme_3.1-144
[49] lifecycle_0.1.0 magrittr_1.5 zip_2.0.4
[52] cli_2.0.2 stringi_1.4.6 fs_1.3.1
[55] promises_1.1.0 remotes_2.1.1 testthat_2.3.2
[58] xml2_1.2.2 ellipsis_0.3.0 generics_0.0.2
[61] vctrs_0.2.3 openxlsx_4.1.4 stargazer_5.2.2
[64] tools_3.6.3 manipulateWidget_0.10.1 glue_1.3.1
[67] officer_0.3.7 purrr_0.3.3 crosstalk_1.0.0
[70] fastmap_1.0.1 processx_3.4.2 pkgload_1.0.2
[73] sessioninfo_1.1.1 memoise_1.1.0 knitr_1.28

cvanderaa commented 4 years ago

Hello, Thanks for testing our package ! I have no issue when testing your code. Note that we just updated our code that contained a serious bug. Could you please try again with the latest version of export ?

devtools::install_github("tomwenseleers/export")

If this does not help, I will dig into your sessionInfo

liaojiahui-r commented 4 years ago

I've also faced this issue and my 'export' package was up to date

):

YandLiu commented 4 years ago

The same issue here, the export works fine in R-Studio, but it doesn't work in R terminal. I'm using the github version.

cvanderaa commented 4 years ago

Ah, very good observation! I can reproduce the error using the terminal only. Give some time to debug this and I'll come back to you once I have the solution.

cvanderaa commented 4 years ago

There was indeed a bug that occured when using R from a terminal, thanks @YandLiu for noticing. The issue should disappear when installing from the latest GitHub version. I would like to stress out that you need a graphical device when using the export package. We would like to change this behavior so any help or suggestions are much appreciated! See issue #16 for background.