tomwenseleers / export

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

Error in dml(code = myplot()) : no "dml" function #36

Closed zhangxiang36 closed 3 years ago

zhangxiang36 commented 3 years ago

I install export package from github as shown in README. However, when I use graph2ppt to export ggplot object to ppt, an error occured. "Error in dml(code = myplot()) : no "dml" function". I really do not know where I can get this function.

My system info is shown as bellow: R version 3.5.3 (2019-03-11) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19041)

Matrix products: default

locale: [1] LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936 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] devEMF_4.0-2 scales_1.1.1 export_0.3.0 RColorBrewer_1.1-2
[5] stringi_1.4.6 reshape2_1.4.4 magrittr_1.5 ggplot2_3.3.2
[9] dplyr_0.8.5 readr_1.3.1 RevoUtils_11.0.3 RevoUtilsMath_11.0.0

loaded via a namespace (and not attached): [1] tidyr_0.8.3 jsonlite_1.6.1 stargazer_5.2.2
[4] shiny_1.3.1 assertthat_0.2.1 cellranger_1.1.0
[7] gdtools_0.1.8 pillar_1.4.6 backports_1.1.6
[10] lattice_0.20-41 glue_1.4.0 uuid_0.1-2
[13] digest_0.6.25 manipulateWidget_0.10.0 promises_1.1.0
[16] colorspace_1.4-1 Matrix_1.2-18 htmltools_0.4.0
[19] httpuv_1.5.2 plyr_1.8.6 pkgconfig_2.0.3
[22] broom_0.5.2 purrr_0.3.4 xtable_1.8-3
[25] webshot_0.5.1 RSpectra_0.14-0 openxlsx_4.1.0
[28] later_1.0.0 officer_0.3.3 tibble_3.0.1
[31] generics_0.1.0 farver_2.0.3 ellipsis_0.3.0
[34] withr_2.3.0 cli_2.1.0 crayon_1.3.4
[37] readxl_1.3.1 mime_0.9 evaluate_0.14
[40] fansi_0.4.1 nlme_3.1-137 MASS_7.3-51.5
[43] xml2_1.3.2 tools_3.5.3 data.table_1.12.2
[46] hms_0.5.3 lifecycle_0.2.0 lfda_1.1.2
[49] stringr_1.4.0 flextable_0.5.2 munsell_0.5.0
[52] zip_2.0.1 compiler_3.5.3 rlang_0.4.5
[55] grid_3.5.3 rstudioapi_0.11 htmlwidgets_1.3
[58] crosstalk_1.0.0 miniUI_0.1.1.1 base64enc_0.1-3
[61] labeling_0.4.2 rmarkdown_1.12 gtable_0.3.0
[64] rARPACK_0.11-0 R6_2.5.0 rvg_0.2.0
[67] knitr_1.22 dml_1.1.0 Rcpp_1.0.4.6
[70] vctrs_0.2.4 rgl_0.100.19 tidyselect_1.0.0
[73] xfun_0.13

my code is like this:

library(export) library(ggplot2) library(datasets) x=qplot(Sepal.Length, Petal.Length, data = iris, color = Species, size = Petal.Width, alpha = I(0.7)) graph2ppt(x=x, file='my.pptx')

zhangxiang36 commented 3 years ago

Updating R to 4.0 and installing rvg 0.2.5 can solve this.

cvanderaa commented 3 years ago

Great ! I'm happy you could find a solution!