0

光沢のあるインタラクティブな関連付けルール プロットを表示する必要があります。そのために、私は arulesViz パッケージを使用しています。しかし、以下を使用してインタラクティブな散布図を表示しようとすると:

shinyServer(function(input, output) {
output$plot1<-renderPlot({
rules <- apriori(transaction_all[[as.numeric(input$level)]],parameter=list(support=input$support,confidence=input$confidence))
plot(rules, measure=c("support", "lift"), shading="confidence",interactive = TRUE)
})

エラーがスローされます:

Error in convertUnit(x, unitTo, "x", "location", "x", "location", valueOnly = valueOnly) : 
 'x' argument must be a unit object

これはどのように行うことができますか?ありがとう

ui.R は次のようになります

shinyUI(pageWithSidebar(

#  Application title
headerPanel("Sliders"),

# Sidebar with sliders that demonstrate various available options
sidebarPanel(
# Simple integer interval
      selectInput("level", label = h3("select level to mine"), 
            choices = list("Level-1" = 1, "Level-2" = 2, "Level-3" = 3,"Level-4" = 4), 
            selected = 1),
sliderInput("support", "Support:", 
            min=0, max=1, value=0.5),
sliderInput("confidence", "Confidence:", 
            min=0, max=1, value=0.5),
width=3 
),

 mainPanel(
plotOutput("plot1")
 )
))

Server.R はこんな感じ

library(shiny)

shinyServer(function(input, output) {
output$plot1<-renderPlot({
rules <- apriori(transaction_all[[as.numeric(input$level)]],parameter=list(support=input$support,confidence=input$confidence))
plot(rules, measure=c("support", "lift"), shading="confidence",interactive = TRUE)
})
})
4

0 に答える 0