rgl

R : combine and save rgl widgets as a single html file

混江龙づ霸主 提交于 2021-02-18 16:05:57
问题 In R, using the rgl and htmlwidgets libraries, I'm trying to extract an HTML file having a widget with toggle buttons . The following example does what I want in the RStudio Viewer. The HTML export works without the toggle buttons, but fails when the rglwidget includes these buttons. The first part is based on these rgl examples, and the export part on the htmlwidgets manual. library(rgl) open3d() x <- sin(1:100) y <- cos(1:100) z <- -100:100/100 # draw a barrel sids1 <- spheres3d(x, y, z,

Package rgl in R not loading in Mac OS

依然范特西╮ 提交于 2021-02-17 06:43:31
问题 I installed the rgl package (0.104.16) in R (3.6.3), but it does not load. I don't get any errors. It just never ends loading. I tried reinstalling R and RStudio and also Xquartz. Nothing is working. I have Mac OS Catalina version 10.15.7. Any help would be highly appreciated! Cheers 回答1: Edited to add new details and suggested fixes. This appears to be due to problems in the 2.8.0beta version of Xquartz that was released in early February. There are two problems: It makes incompatible

How to Draw a three-dimensional graph in R

徘徊边缘 提交于 2021-02-10 14:49:03
问题 f(x,y)= (1/25)*(20-x)/x 10<x<20, x/2 <y <x 0 o.t I have to create this image through this expression. but x <- seq(10, 20, length=20) y <- seq(10, 20, length=20) f <- function(x,y){(1/25)*(20-x)/5} z <- outer(x,y,f) persp(x,y,z,theta=30,phi=30, expand=0.5,col=rainbow(19), border=NA) what is wrong? 回答1: You should mask z based on the constraint. As a suggestion, you can use an amazing interactive rgl package in R. #source: https://stackoverflow.com/questions/50079316/plot3d-how-to-change-z

How to Draw a three-dimensional graph in R

萝らか妹 提交于 2021-02-10 14:48:38
问题 f(x,y)= (1/25)*(20-x)/x 10<x<20, x/2 <y <x 0 o.t I have to create this image through this expression. but x <- seq(10, 20, length=20) y <- seq(10, 20, length=20) f <- function(x,y){(1/25)*(20-x)/5} z <- outer(x,y,f) persp(x,y,z,theta=30,phi=30, expand=0.5,col=rainbow(19), border=NA) what is wrong? 回答1: You should mask z based on the constraint. As a suggestion, you can use an amazing interactive rgl package in R. #source: https://stackoverflow.com/questions/50079316/plot3d-how-to-change-z

Trying to make movie of 3D PCA plot (rgl) using movie3d

冷暖自知 提交于 2021-02-08 05:39:39
问题 I have made a rgl 3D PCA plot in R using the pca3d package, and I am trying to make a gif file containing a movie of the rotating plot using movie3d. There is a function in the pca3d package (makeMoviePCA), that passes its arguments to movie3d. Here is the command I am using: pca3d(pc, components = 1:3, title=TRUE, col=col_conditions, radius=2) makeMoviePCA(dir="/Users/workdir", clean=TRUE, type = "gif", movie = "movie", convert=TRUE) This plays the movie like I want to, but does not save it