rgl

object of type 'closure' is not subsettable in shiny. Working on a simple RGL plotting function

你说的曾经没有我的故事 提交于 2019-12-05 20:17:36
I was coding in shiny with the rgl and shinyRGL package, trying to plot a 3D line plot by having the users insert a csv file of a specific format. But the object type closure error keeps showing up. It seems like because it can't find the function plot3d , or I may be wrong. Here's the code: UI library(shiny) library(rgl) library(shinyRGL) # Define UI for application that draws a histogram shinyUI(fluidPage( titlePanel("title panel"), sidebarLayout( sidebarPanel( helpText("Please select a CSV file with the correct format."), tags$hr(), fileInput("file","Choose file to upload",accept = c( 'text

Using “expression” in R rgl axis labels

耗尽温柔 提交于 2019-12-05 10:04:13
Do the rgl routines accept the use of "expression" for Greek letters and super/sub script for axis labelling? Something like xlab=(expression(paste("Lyman ",alpha,))) works perfectly well in a normal plot call but just seems to display "(paste("Lyman ",alpha,)" as my axis label in plot3d and decorate3d. If not, how can I add these characters to my 3D scatterplots generated using plot3d? On my system (OSX 10.7.5, R 3.1.2) I get an alpha as xlab with: require(rgl) plot3d(1,1,1,xlab=intToUtf8(0x03B1L) ) And pasting to ordinary text also succeeds: plot3d(1,1,1, xlab=paste("Lyman ", intToUtf8

rgl: drawing a cube with colored faces, vertex points and lines

送分小仙女□ 提交于 2019-12-05 01:41:55
问题 To demonstrate the effect of linear transformations in 3D, x -> A x , I want to draw a cube and show its transformation under A . For this, I need to color each face separately, and also show the vertex points and the lines that outline each face. I can't figure out how to use distinct colors for the faces, and how to make this more general so I don't have to repeat all the steps for the result under the transformation. what I tried: library(rgl) c3d <- cube3d(color=rainbow(6), alpha=0.5)

Animated rgl graphs with knitr

。_饼干妹妹 提交于 2019-12-04 14:55:08
问题 I want to include animated rgl graphs in my .Rnw document through knitr . Here is my MWE: \documentclass{article} << label = setup, include = FALSE>>= opts_chunk$set(fig.path = 'figure/', cache = FALSE, dev = "pdf", fig.align = 'center', fig.show = 'hold', fig.width = 3, fig.height = 3, echo = TRUE, warning = FALSE, message = FALSE, size = 'footnotesize', comment=NA, results='hold') knit_hooks$set(par = function(before, options, envir){ if (before && options$fig.show!='none') par(mar = c(4, 4

How do I install the R package rgl on Ubuntu 9.10? [duplicate]

微笑、不失礼 提交于 2019-12-04 11:36:58
This question already has answers here : Closed 8 years ago . Possible Duplicate: Problem Installing rgl I'm trying to install the R package rgl on Ubuntu 9.10. I'm using R version 2.12.1. I got the following error: "configure: error: missing required header GL/gl.h" I asked this question earlier without the restriction that I use Ubuntu 9.10, and the answer I got was to update R, but I haven't been able to do this, possibly because Ubuntu 9.10 is not supported by the folks at CRAN. Dirk Eddelbuettel Just do sudo apt-get install r-cran-rgl As there is a reason we spent time harder-to-install

Plot specified area of a surface mesh with color

落爺英雄遲暮 提交于 2019-12-04 05:44:27
问题 I have data for 3D facia surface mesh. Data are available here, where vb.xlsx contains coordinates for 7160 3D vertices and it.xlsx contains face information. The color coding.txt is a matrix of 7160*1 with elements of either 1 or 2. I want the surface area (not just vertices!) enclosed by vertices which are coded 1 to be plotted in a different color from areas covered by vertices coded 2. For example, if vertices covering nose and upper lip are coded 1 and other facial areas are coded 2,

Setting size of the rgl device

左心房为你撑大大i 提交于 2019-12-04 05:10:26
I have a problem with the fullscreen / non-fullscreen of my rgl device. Currently I use R 3.00 I plot a persp3d plot (library rgl) into my device, it opens in a quite small window: The R code: persp3d(x, y, z, theta=50, phi=25, expand=0.75, col=red, ticktype="detailed", xlab="", ylab="", zlab="",axes=FALSE) axes3d(c('x--','z')) axis3d(edge='y+-',at =c(1,500,1000,1500,2000,2320), labels =rownames(fd)[c(1,500,1000,1500,2000,2320)]) Which looks like this: I now rotated it and saved the single png files to my drive. The problem is, that the png files are too small? I want to put them into one

shiny app rglwidget get userMatrix to generate another plot with same rotation

…衆ロ難τιáo~ 提交于 2019-12-03 21:12:01
问题 I have a shiny app and integrate an rgl 3d-plot into it. I am using renderRglwidget from the rglwidget package to insert the rgl graphics using webgl into my shiny app. In the app the user can rotate the graphic. Now I want to save the rotation state, hence the userMatrix or modelMatrix to later generate a similar plot with the same rotation as the user left the previous graph. Here I read something about java variables storing the userMatrix and other parameters. Can I access them from

Animated rgl graphs with knitr

只谈情不闲聊 提交于 2019-12-03 09:17:15
I want to include animated rgl graphs in my .Rnw document through knitr . Here is my MWE: \documentclass{article} << label = setup, include = FALSE>>= opts_chunk$set(fig.path = 'figure/', cache = FALSE, dev = "pdf", fig.align = 'center', fig.show = 'hold', fig.width = 3, fig.height = 3, echo = TRUE, warning = FALSE, message = FALSE, size = 'footnotesize', comment=NA, results='hold') knit_hooks$set(par = function(before, options, envir){ if (before && options$fig.show!='none') par(mar = c(4, 4, 0.1, 0.1), cex.lab = 0.95, cex.axis = 0.9, mgp = c(2, 0.7, 0), tcl = -0.3) } ) knit_hooks$set(rgl =

R - Plot a region described by planes with rgl

浪尽此生 提交于 2019-12-03 06:11:58
I want to plot a polyhedron, which is described by the following inequalities: 3*x+5*y+9*z<=500 4*x+5*z<=350 2*y+3*z<=150 x,y,z>=0 It is a linear program. The objective function is: 4*x+3*y+6*z The polyhedron is the feasible region for this program. I am able to plot the inequalities as planes, which should describe the polyhedron (Note that this is my first try with rgl, so the code is kinda messy. if you want to improve it, please feel free to do so): # setup x <- seq(0,9,length=20)*seq(0,9,length=20) y <- x t <- x f1 <- function(x,y){y=70-0.8*x} z1 <- outer(x,y,f1) f2 <- function(x,y){500/9