iT邦幫忙

第 11 屆 iThome 鐵人賽

DAY 26
0
自我挑戰組

資料處理以及視覺化系列 第 26

R語言-第二十六天 Shiny - UI 判斷式 conditionalPanel

  • 分享至 

  • twitterImage
  •  

今天來分享一個如何在ui中可以寫判斷式

就像是if判斷式一樣

可以判斷T or F 來決定是否執行

在UI中要使用 conditionalPanel() 來判斷

以下為code

box(

 conditionalPanel(
   condition = "output.resultb != '無此帳號'",
   h4(strong(span(textOutput("comment1_1"),style = "color:#7A090F"),
             align = "left")),
   plotOutput("login_pic", height = 200 , width = 900)),
 
 conditionalPanel(
   condition = "output.resultb == '無此帳號!'",
   h4(strong(span("無此帳號",style = "color:#7A090F"))),
   img(src = "nodata.png", height = 200, width = 300),
   img(src = "nodata.png", height = 200, width = 300),
   img(src = "nodata.png", height = 200, width = 300)),
 textOutput("resultb")

)


上一篇
R語言-第二十五天 Shiny - sidebarUserPanel leaflet 錯誤 -3
下一篇
R語言-第二十七天 Shiny - Box 背景 各項調整
系列文
資料處理以及視覺化30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言