Stop plotting plots in pop-up window Graphic Device 2 & plot in R plot pane?

RStudio is outputting graphics to a pop-up window entitled "R Graphics: Device 2 (Active)" and not placing anything in the RStudio plots pane.
I found another post with this roblem, but no solution.

I don't want the plots in the Graphics Device plane because you cannot decide the size at which to save each plot. For example, before I was clicking "export" and deciding the width and height of each plot prior to saving so that similar plots could be saved with the exact same size.

I can't do that with the graphic device panel...it only allows you to save as a jog/pdf...etc.. but without defining the size precisely.
Is it possible to eliminate this Graphic Device plotting and go back to the normal plotting approach where the plot is produced in the plot pane in R?

Unfortunately, the package I am using saves plot in a temporary folder but outputs them in the R plot pane usually, so i can easily save them at a specific size from there, but they are not saved as objects...so i can't use ggsave. If i can't save the plots from the R plot pane anymore, it would be highly disruptive for me.

Any solution?

Thanks
Gabriella

RStudio RStudio 2022.07.0+548 "Spotted Wakerobin" Release

sessionInfo( )
R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_Australia.utf8 LC_CTYPE=English_Australia.utf8 LC_MONETARY=English_Australia.utf8 LC_NUMERIC=C
[5] LC_TIME=English_Australia.utf8

time zone: Australia/Brisbane
tzcode source: internal

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

other attached packages:
[1] ggthemes_5.1.0 ggrepel_0.9.6 directlabels_2024.1.21 dartRverse_1.0.2 dartR_1.9.6 vegan_2.6-8
[7] lattice_0.22-6 permute_0.9-7 pcadapt_4.4.0 amap_0.8-19.1 spida2_0.2.3 gtools_3.9.5
[13] remotes_2.5.0 readxl_1.4.3 radiator_1.2.8 OutFLANK_0.2 qvalue_2.36.0 SNPRelate_1.38.1
[19] gdsfmt_1.40.2 ggtern_3.5.0 graph4lg_1.8.0 plotrix_3.8-4 lubridate_1.9.3 forcats_1.0.0
[25] stringr_1.5.1 purrr_1.0.2 readr_2.1.5 tidyr_1.3.1 tibble_3.2.1 tidyverse_2.0.0
[31] plyr_1.8.9 dartR.data_1.0.8 dplyr_1.1.4 ggplot2_3.5.1 adegenet_2.1.10 ade4_1.7-22

loaded via a namespace (and not attached):
[1] fs_1.6.4 matrixStats_1.4.1 hierfstat_0.5-11 devtools_2.4.5 rms_6.8-2 httr_1.4.7
[7] RColorBrewer_1.1-3 doParallel_1.0.17 StAMPP_1.6.3 latex2exp_0.9.6 profvis_0.4.0 tools_4.4.1
[13] backports_1.5.0 haplo.stats_1.9.7 utf8_1.2.4 R6_2.5.1 lazyeval_0.2.2 mgcv_1.9-1
[19] urlchecker_1.0.1 withr_3.0.1 dartR.sexlinked_1.0.5 sp_2.1-4 GGally_2.2.1 gridExtra_2.3
[25] bayesm_3.1-6 quantreg_5.98 cli_3.6.3 sandwich_3.1-1 labeling_0.4.3 mvtnorm_1.3-1
[31] robustbase_0.99-4-1 polspline_1.1.25 QuickJSR_1.4.0 StanHeaders_2.32.10 foreign_0.8-86 R.utils_2.12.3
[37] dartR.spatial_0.78 pegas_1.3 parallelly_1.38.0 sessioninfo_1.2.2 maps_3.4.2 rstudioapi_0.16.0
[43] generics_0.1.3 combinat_0.0-8 inline_0.3.19 loo_2.8.0 Matrix_1.7-0 fansi_1.0.6
[49] R.methodsS3_1.8.2 terra_1.7-78 lifecycle_1.0.4 multcomp_1.4-26 grid_4.4.1 promises_1.3.0
[55] gdata_3.0.0 crayon_1.5.3 miniUI_0.1.1.1 LEA_3.16.0 pillar_1.9.0 knitr_1.48
[61] arsenal_3.6.3 codetools_0.2-20 glue_1.8.0 data.table_1.16.0 vctrs_0.6.5 png_0.1-8
[67] spam_2.11-0 Rdpack_2.6.1 cellranger_1.1.0 gtable_0.3.5 poisbinom_1.0.1 cachem_1.1.0
[73] xfun_0.48 rbibutils_2.3 mime_0.12 genetics_1.3.8.1.3 survival_3.6-4 iterators_1.0.14
[79] fields_16.3 ellipsis_0.3.2 dartR.base_0.98 TH.data_1.1-2 dartR.popgen_1.0.0 gap_1.6
[85] nlme_3.1-164 usethis_3.0.0 rstan_2.32.6 tensorA_0.36.2.1 rpart_4.1.23 colorspace_2.1-1
[91] DBI_1.2.3 Hmisc_5.1-3 raster_3.6-30 nnet_7.3-19 SNPassoc_2.1-0 tidyselect_1.2.1
[97] compiler_4.4.1 compositions_2.0-8 htmlTable_2.4.3 SparseM_1.84-2 ggdendro_0.2.0 plotly_4.10.4
[103] checkmate_2.3.2 scales_1.3.0 DEoptimR_1.1-3 hexbin_1.28.4 quadprog_1.5-8 digest_0.6.37
[109] rmarkdown_2.28 dismo_1.3-14 htmltools_0.5.8.1 pkgconfig_2.0.3 base64enc_0.1-3 fastmap_1.2.0
[115] rlang_1.1.4 htmlwidgets_1.6.4 shiny_1.9.1 farver_2.1.2 zoo_1.8-12 jsonlite_1.8.9
[121] R.oo_1.26.0 magrittr_2.0.3 Formula_1.2-5 dotCall64_1.2 gdistance_1.6.4 patchwork_1.3.0
[127] munsell_0.5.1 Rcpp_1.0.13 ape_5.8 proto_1.0.0 furrr_0.3.1 stringi_1.8.4
[133] MASS_7.3-60.2 pkgbuild_1.4.4 ggstats_0.7.0 parallel_4.4.1 listenv_0.9.1 splines_4.4.1
[139] hms_1.1.3 igraph_2.0.3 seqinr_4.2-36 reshape2_1.4.4 stats4_4.4.1 pkgload_1.4.0
[145] PopGenReport_3.1 mmod_1.3.3 evaluate_1.0.0 calibrate_1.7.7 RcppParallel_5.1.9 BiocManager_1.30.25
[151] tzdb_0.4.0 foreach_1.5.2 httpuv_1.6.15 RgoogleMaps_1.5.1 MatrixModels_0.5-3 future_1.34.0
[157] gap.datasets_0.0.6 xtable_1.8-4 later_1.3.2 viridisLite_0.4.2 memoise_2.0.1 cluster_2.1.6
[163] timechange_0.3.0 globals_0.16.3