rgl

Installing rgl on Ubuntu and Mac: X11 not found

岁酱吖の 提交于 2019-11-27 03:53:34
I have seen this question here: Error in loading rgl package with Mac OS X but there is no mentioning about installation error, which is my case. I cannot install rgl package, using this command in R : source("http://bioconductor.org/biocLite.R") biocLite("rgl") The following error is displayed: configure: error: X11 not found but required, configure aborted. ERROR: configuration failed for package ‘rgl’ * removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl’ I checked this address /Library/Frameworks/R.framework/Versions/3.2/Resources/library and there is no rgl folder

Plot 3D plane (true regression surface)

好久不见. 提交于 2019-11-27 02:00:33
问题 I'm trying to simulate some data (x1 and x2 - my explanatory variables), calculate y using a specified function + random noise and plot the resulting observations AND the true regression surface. Here's what I have so far: set.seed(1) library(rgl) # Simulate some data x1 <- runif(50) x2 <- runif(50) y <- sin(x1)*x2+x1*x2 + rnorm(50, sd=0.3) # 3D scatterplot of observations plot3d(x1,x2,y, type="p", col="red", xlab="X1", ylab="X2", zlab="Y", site=5, lwd=15) Now I'm not sure how I can add the

R: using rgl to generate 3d rotatable plots that can be viewed in a web browser?

只谈情不闲聊 提交于 2019-11-27 00:55:26
问题 In the world of the R statistics package, rgl allows me to generate 3d plots that I can rotate with my mouse. Is there a way I can export these plots in a portable format, load them in a web browser or other third party tool and rotate them there? I Am especially interested in the web browser solution since this will allow me to share the plots on an internal wiki. If rgl does not allow this, are there other libraries or strategies that would allow me to accomplish this? 回答1: You could try

car::scatter3d in R - labeling axis better

被刻印的时光 ゝ 提交于 2019-11-26 23:21:35
问题 I'm using scatter3d and the 3 axes just have two endpoint values. how can I get labels throughout the entire axis, just like the normal plot() function does? 回答1: Oh well. I took it as a challenge. Obviously you need to: require(rgl) require(car) require(mgcv) # for the example Copy the car:::scatter3d.default code and paste it back, assigning it to scatter3d.default . Add these lines early in the code for scatter3d.default : showLabels3d <- car:::showLabels3d nice <- car:::nice # since you

How do I install the latest version of rgl?

冷暖自知 提交于 2019-11-26 18:01:21
The rgl package is developed on R-forge at https://r-forge.r-project.org/projects/rgl/ . The simplest way to install the latest version should be install.packages("rgl", repos="http://R-Forge.R-project.org") but this often fails, as R-forge does not always have current builds. How do you get it then? There are two alternatives. The simplest way is probably to install from Github, using devtools::install_github("rforge/rgl", subdir="pkg/rgl") EDITED TO ADD: For a while this didn't work, as the Github mirror was not being updated. It seems fine again now, but if it dies again, the only one of

including a interactive 3D figure with knitr

柔情痞子 提交于 2019-11-26 17:34:59
问题 Using knitr it is possible to embed a rgl 3D graphics in a html document from a Rmarkdown source file: ```{r setup} library(rgl) knit_hooks$set(rgl = hook_rgl) x <- sort(rnorm(1000)) y <- rnorm(1000) z <- rnorm(1000) + atan2(x,y) ``` ```{r, rgl=TRUE} plot3d(x, y, z, col=rainbow(1000)) ``` But the 3D graphic is not interactive in the html document. Is it possible to get an interactive 3D graphic ? The writeWebGL() function of the rgl package creates a html file with an interactive 3D graphic,

Error in loading rgl package with Mac OS X

房东的猫 提交于 2019-11-26 14:21:37
问题 I am trying to install rgl package (0.92.858) for R (2.14.2) under Mac OS X (Lion 10.7.3). When I try to load it (library(rgl)), I get the following error: Error : .onLoad failed in loadNamespace() for 'rgl', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/2.14/Resources/library/rgl/libs/x86_64/aglrgl.so': dlopen(/Library/Frameworks/R.framework/Versions/2.14/Resources/library/rgl/libs/x86_64/aglrgl.so, 6):

How do I install the latest version of rgl?

纵然是瞬间 提交于 2019-11-26 06:09:19
问题 The rgl package is developed on R-forge at https://r-forge.r-project.org/projects/rgl/. The simplest way to install the latest version should be install.packages(\"rgl\", repos=\"http://R-Forge.R-project.org\") but this often fails, as R-forge does not always have current builds. How do you get it then? 回答1: There are two alternatives. The simplest way is probably to install from Github, using devtools::install_github("rforge/rgl", subdir="pkg/rgl") EDITED TO ADD: For a while this didn't work

R: Plotting a 3D surface from x, y, z

♀尐吖头ヾ 提交于 2019-11-26 05:27:12
问题 imagine I have a 3 columns matrix x, y, z where z is a function of x and y. I know how to plot a \"scatter plot\" of these points with plot3d(x,y,z) But if I want a surface instead I must use other commands such as surface3d The problem is that it doesn\'t accept the same inputs as plot3d it seems to need a matrix with (nº elements of z) = (n of elements of x) * (n of elements of x) How can I get this matrix? I\'ve tried with the command interp, as I do when I need to use contour plots. How