2017-06-20 13 views
0

具体的な再現可能な例がないことをお詫びします。私の質問があまりにも一般的ではないことを願っています。ReactiveValues()は、plotOutputオブジェクトを削除できますか?

R輝きでは、reactiveValues()を使用してplotOutputオブジェクトを削除することが可能かどうか疑問に思っていました。特に、私は後者のオプションの排除(または単に目に見えないレンダリング)plotOutput

my_values <- reactiveValues(A = my_plot, B = [something]) 

if (condition) 
{ 
    output$my_plotOutput <- my_values$A 

} else 

{ 
    output$my_plotOutput <- my_values$B 
} 

のようなものを持つことができますか?

プロットをNULLにすることはできますが、空の矩形は残ります。

ありがとうございます。

+0

*目に見えない*をレンダリングするには、[ 'shinyjs :: hide'](使用する場合がありますhttps://github.com/daattali/shinyjs); ['shiny :: removeUI'](http://shiny.rstudio.com/reference/shiny/latest/removeUI.html)(恐らく、残念ながら、それを挿入するには' insertUI'が必要です)。または単に 'plot(0、type = 'n'、axes = FALSE、ann = FALSE)'(何も持たないプロット)です。 – r2evans

答えて

0

条件付きパネルを試しましたか? server.RでconditionalPanel Document

を参照してください:ui.Rで

output$plotUI <- renderUI({ 
    conditionalPanel(condition=YOURCONDITION, 
        YOURPLOT) 
}) 

を:

uiOutput("plotUI')