rgl
とshinyRGL
パッケージを使用して光沢を持たせて、ユーザーにcsv
という特定の形式のファイルを挿入させて3D線図をプロットしようとしました。しかし、オブジェクトタイプのクロージャーエラーは、引き続き表示されます。それは、それが機能plot3d
を見つけることができないかのように思える、または私は間違っている可能性があります。ここで タイプ 'closure'のオブジェクトは、光沢のあるサブセットではありません。単純なRGLプロット関数を使って作業する
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/csv',
'text/comma-separated-values',
'text/tab-separated-values',
'text/plain',
'.csv',
'.tsv',
label = h3("File input"))
),
tags$hr(),
checkboxInput('header', 'Header', TRUE),
actionButton("graph","PLOT!")
),
mainPanel(textOutput("text1"),
webGLOutput("Aplot")))
)
)
サーバー
library(shiny)
library(rgl)
library(shinyRGL)
options(shiny.maxRequestSize = 9*1024^2)
shinyServer(
function(input, output) {
output$text1 <- renderText({
paste("You have selected", input$select)
})
output$"Aplot" <- renderWebGL({
inFile <- reactive(input$file)
theFrames <- eventReactive(input$graph,read.csv(inFile$datapath,
header = input$header))
plot3d(theFrames[[4]],theFrames[[5]],theFrames[[6]],xlab="x",ylab="y",zlab
= "z", type = "l", col = ifelse(theFrames[[20]]>0.76,"red","blue"))
})
})
エラー
警告:? パッケージhinyRGLRのバージョンで構築された3.3.1 警告:[[でエラーが発生しました: 70:PLOT3D 69型 '閉鎖' はオブジェクトが スタックトレース(最も内側の最初の)subsettableされていません。 FUNC [C:\ユーザーはリープ SDK /テストのイアン\ワークスペース\コピーを\ \ APP_1/server.R#19] 68:出力$ Aplot 1:それはだからrunApp
は、それがどこかにそれらの機能にあなたは明らかに動作しませんクロージャー(機能)を、サブセットしようとしているということです。静的なプレースホルダ(関数を実行させることがわかっているもの)でサブセット化された動的条件を交換して、問題の原因となっている用語を特定できるようにしてください。 – alistaire
@alistaire問題は私のXYZパラメータ "theFrames [[...]]"内にあるようです。しかし、私はそれの原因や解決方法を知らない。 –
'str(theFrames)'とは何ですか? – alistaire