In the new version of RStudio (1.1.456), all my plots I created by ggplot open in an external window, instead of Plots Panel. I do not know how to navigate previous plots created in this window. How can I plot my ggplot graphs in the Plots Panel?
Here is the code to produce the plots:
xLabel = "ID"
yLabel = bquote( Volume "~(mm^3))
gTitle = "Volumes by Groups"
sTitle = "Sample 5"
sCaption = "Company"
for (j in 1:num_covariants) {
value <- animals[, c("ID", covariant_name[j], "GroupID")]
colnames(value)[2] <- "value"
gTitle = covariant_name[j]
p <- ggplot(value, aes(x = ID, y = value, fill = GroupID, color = GroupID)) +
geom_col(position = "dodge", width = 0.5, color = "lightgrey", linewidth = 0.1) +
facet_wrap(~ GroupID, scales = "free_x") +
labs(x = xLabel, y = yLabel, title = gTitle, subtitle = sTitle, caption = sCaption, fill = "Group ID") +
TMTheme() + scale_fill_manual(values = TMColors, name = "Group ID") +
# scale_fill_viridis(discrete = TRUE) +
# scale_fill_brewer(palette = "Dark2") +
theme(strip.text.x = element_text(size = 12, face = "bold"))
p
}
Sorry, what I was asking (or at least intended to ask) was if you could 1) run your code, and then 2) take a screenshot of your full RStudio window immediately afterwards and share it here. Could you do that?
Dramano, I am sorry, I misunderstood. The code is 630 lines long. I cannot create one single = screenshot,+, so there would be many screenshots. Will this do? Maybe I can provide more useful information if you tell me what you are after. The Graphics device is 2. Why>?. I close it (dev.off()), then open one one (dev, new()). PLots are still openned in 2!
Certainly. It's the same. One thing I noticed, if it matters, is that before, there was no terminal window behind RStudio IDE. Now, there is a black terminal each time I open RStudio.
Hello Drango, Thank you for your help. here are the results:
option(device = 'RStudioGD')
Error in option(device = "RStudioGD") : could not find function "option"
In addition: Warning message:
R graphics engine version 16 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed.
dev.cur()
null device
1
dev.list()
NULL
sessionInfo()
R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)