Unable to export a pdf file from R Studio

Hi,

I am trying to export a pdf file from R studio, however, the program keeps running without exporting the required file. I am not sure if this has something to do with my machine configuration like memory, xmx settings. Kindly assist me regarding the same and let me know if you need any further details.

Thank you,

Toufiq

Here is the code:

pdf(paste0(GSE_ID, "_", platform, "_Heatmap_plot.pdf"), height = 70, width = 30)
ht=Heatmap(df_plot)
draw(ht,heatmap_legend_side = "left", annotation_legend_side = "left", padding = unit(c(2, 20, 2, 2), "mm"))

dev.off()
sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] ComplexHeatmap_2.6.2 stringr_1.4.0       

loaded via a namespace (and not attached):
 [1] compiler_4.0.3      pillar_1.4.7        RColorBrewer_1.1-2  tools_4.0.3         digest_0.6.27      
 [6] lifecycle_0.2.0     tibble_3.0.5        gtable_0.3.0        clue_0.3-58         pkgconfig_2.0.3    
[11] png_0.1-7           rlang_0.4.10        DBI_1.1.1           rstudioapi_0.13     parallel_4.0.3     
[16] xfun_0.20           dplyr_1.0.3         cluster_2.1.0       generics_0.1.0      GlobalOptions_0.1.2
[21] S4Vectors_0.28.1    vctrs_0.3.6         IRanges_2.24.1      tidyselect_1.1.0    stats4_4.0.3       
[26] glue_1.4.2          R6_2.5.0            GetoptLong_1.0.5    ggplot2_3.3.3       purrr_0.3.4        
[31] magrittr_2.0.1      scales_1.1.1        matrixStats_0.57.0  ellipsis_0.3.1      BiocGenerics_0.36.0
[36] assertthat_0.2.1    shape_1.4.5         circlize_0.4.12     colorspace_2.0-0    tinytex_0.28       
[41] stringi_1.5.3       munsell_0.5.0       crayon_1.3.4        rjson_0.2.20        Cairo_1.5-12.2

We really need more information and probably a reproducible example (reprex)

In the meantime, what happens if you try

xx <-   1:100
pdf("myplot.pdf")
plot(xx)
dev.off()

1 Like

@jrkrideau, thank you very much for the response.

Running the below code, works fine.

xx <-   1:100
pdf("myplot.pdf")
plot(xx)
dev.off()

The issue occurs when I run this piece of code:
draw(ht,heatmap_legend_side = "left", annotation_legend_side = "left", padding = unit(c(2, 20, 2, 2), "mm"))

I will share the reproducible example shortly.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.