plot3D from rgl package doesn't appear - r

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)

Related

Why are my plots not appearing on a shiny app using rmarkdown and flexdashboard?

When I first run my app (locally through RStudio or hosted on shinyapps.io), most of the times the plots show just fine, but disappear when I reload the page or resize the window. There are also times when the plots don’t even show on start and I have to rerun the app multiple times to make them appear.
My co-dev tried the same on his computer, with similarly inconsistent results.
Things I’ve tried:
Using plotly instead of ggplot2.
Limiting plot size to, say, 300x300 ou 10x10 px to check if it’s not a performance problem due to the size of the PNGs shiny renders as plots.
Using rmarkdown::render_delayed so shiny wouldn’t have to load all plots at once.
Those made no difference.
Could someone shed a light on the issue? Does anyone else have problems with plots on flexdashboard?
You can check a minimum example of the problem on https://ecology-app-test.shinyapps.io/minimum_example/ and the code on https://github.com/NHohl/ShinyEcology/blob/master/Minimum_Example.Rmd
Please try to load multiple times to see if/when the plots fail to show.
I have a more complete version that doesn’t use flexdashboards and works just fine (but the layout is a mess): https://nathalia--hohl.shinyapps.io/ecologia-interativa/
The package versions I’m using:
R v. 4.2.0
Rstudio v. 2022.02.1
rmarkdown v. 2.14
shiny v. 1.7.1
flexdashboards v. 0.5.2
ggplot2 v. 3.3.6
plotly v. 4.10.0

degree symbol for labels in R is messed up

I just upgraded to Ubuntu 20.04. When I use ggplot2 to plot some geographical data, I discover that the degree symbol in the axis labels is messed up (I attached a snip). Does anyone have a solution for that? The same thing occurs if I use a different plotting library (e.g.lattice). I can provide some reproducible code as well although this is not exactly an error to reproduce..
Thanks!

No visuals under the plots view

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?

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?

Spinning 3D Scatterplot in R - Crashes

I'm trying to create a 3D rotating scatterplot in R using the package Rcmdr:
ParticlePos=read.table('FILE.dat',header=T,fill=T)
library(Rcmdr)
attach(mtcars)
scatter3d(ParticlePos[,1],ParticlePos[,2],ParticlePos[,3],xlab=expression(x),ylab=expression(y),zlab=expression(z),pch=19, col="red", size=3)
but it keeps crashing. It seems that it's opening up an XQuartz (v. 2.7.4, OS X 10.8) window and plotting it correctly, but after about a half second it closes leaving me with nothing. I'm fairly certain all of the appropriate dependencies and such are downloaded.
Would anyone have any ideas?
Thanks!

Resources