No visuals under the plots view - r

Hi i am still a beginner in R. I need a minor assistance
R does not display plots. The plot view remain just blank after running the commands to draw plot.
Everything under the Plots options is not working. I have restarted the session, closed and started R. but no change.
I was working with the packages ggplot2, tidyverse and dplyr.
I don't recall uninstalling something
What could the problem be?

Related

R plot symbols on axis not shown correctly

Hi guys,
I have set up a new conda R-environment (on my ubuntu 20.04) and oddly, the output of the base plot function does not show symbols on the axes or axis labels but little squares with numbers instead (see attached picture).
When I use the plot function in an R-Markdown code chunk and export it as PDF, the plot is displayed correctly. However, in RStudio or when exporting the Rmd to html, the symbols appear like in the picture.
I realize this could have to do with the encoding, but don't know how to solve it. Has anyone encountered this problem before or can give me advice how to troubleshoot it?
Many thanks in advance!
Simply adding the package r-cairodevice to my R environment solved the problem.

Labels cannot be placed in second boxplots in R?

If you run the following simple code, you will notice that although in the first boxplot there are labels, this is not the case with the second boxplot where there are no labels. How to fix this? Is it an internal R bug?
I have tried to store boxplots in a working directory just in case this is an R studio graphics problem, but still... the same issue arised even then so this is not an Rstudio problem.
df=data.frame("A"=rnorm(10),"B"=rnorm(10),"C"=rnorm(10),"D"=rnorm(10))
for (i in 1:2){
boxplot(df[,1:2],xaxt='n')
axis(1,at=c(1,2))
boxplot(df[,3:4],xaxt='n')
axis(1,at=c(3,4))}

plot3D from rgl package doesn't appear

I'm trying to use the rgl package to produce 3D plots of my graphs in RStudio. I use a Mac and I have XQuartz installed, but when I follow step-by-step tutorials for 3D plotting even the simplest plots won't work.
No warning message appears and no plot appears after I launch the command. When I bring all windows forward I can see a small one with no close/expand button and no images on it (same goes for the plot area of the workspace, nothing happens at all).
Does anybody have an idea of why this could be the case? I updated R a couple of weeks ago and all of my packages have been uninstalled and re-installed.
Thanks!
Here's the basic code I used, just in case.
x=runif(1000)
y=runif(1000)
z=rnorm(1000)
install.packages("rgl")
library("rgl")
plot3d(x,y,z)

Is there a way to recover a ggplot2 image from a Plotly image?

I have some code that generates a plotly image in R. Previously I included this plot in a presentation using Rstudio/ioslides. The people I am collaborating with want a version in powerpoint. I am trying to use the ReporterRs package in order to create an re-producible shell powerpoint presentation with all of my plots. However ReporterRs only accepts lattice, ggplot2, and base images. Since there is a way to convert ggplot2 objects to plotly images I was hoping there was a way to go backwards. However I am stuck. I have been unable to "downgrade" my plotly plots to ggplot2. Does anyone know if there is a way to do this?
(I know I can just copy and paste them over but I would like to develop a workflow where I can create easily reproducible and replaceable plots so that I don't have to do very much work if I change the data)

Shiny R: Large differences in ggplot2 plot annotation between unpublished (RStudio preview) and published browser version

I have a fairly in depth set of numerical results being displayed in tables and plots using R/shiny and published online through the teams xxx.shinyapps.io website system.
This has worked fantastically well but I have found that the RStudio preview of my ggplot2 plots to be vastly different to the published versions. In particular, given a set width, height and resolution, the axis text, main text and plotting character annotations are much smaller in the preview compared to the published version. This has made it a nightmare to aesthetically hone these plots to what I want. I have played around with renderPlot() and plotMap() settings but to no avail.
I am using R 3.2.3 in RStudio 0.99.879 with shiny 0.13.2 and ggplot 2.1.0. Has anyone encountered something similar in their shiny/ggplot2 travels?

Resources