作者luenchang (luen)
看板R_Language
標題[問題] R shiny app tabs not showing
時間Thu Apr 4 12:36:20 2024
[問題敘述]:
想要把一個在shinyapps.io上面的app
https://luenhchang.shinyapps.io/barcode-scan/
的頁面改成有tab, 例如以下網頁裡的圖所呈現
https://stackoverflow.com/questions/40438390/how-to-put-outputs-side-by-side-in-shiny
我把ui 的部分改成和上述網頁類似,在local PC及shinyapps.io上發佈後都沒有出現
tabs, 只出現了兩個bullet points. 我會在推文裡放張圖。不知道有人的app在
shinyapps.io上面是能呈現tab的嗎?
[程式範例]:
ui部分的程式如下:
ui <- shiny::mainPanel(
shiny::tabsetPanel(type = "tabs"
# First tab
,shiny::tabPanel(title = "Food" # Tab name
,tableOutput(outputId="table.food.expiring") # All output under this tab
,tableOutput(outputId="table.food.consumed")
,tableOutput(outputId="table.food.price")
) # Close tabPanel()
# Second tab
,shiny::tabPanel(title = "Hygiene Product" # Tab name
,tableOutput(outputId="table.hygiene.count.unopened")
)# Close tabPanel()
) # Close tabsetPanel()
) # Close mainPanel()
所有的code可以在以下連結裡看到。這個檔案和我前一篇發文的檔案是一樣的。
[barcode-scanner_shiny-web-app.R](
https://drive.google.com/file/d/1LypwN5rQftb5kPH8FzDN6aviGpxzNEZE/view?usp=sharing)
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.146.70.97 (澳大利亞)
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1712205389.A.7B1.html
→ luenchang: 我用tabsetPanel()及tabPanel()想產生兩個tabs Food及 04/04 12:41
→ luenchang: Hygiene products. 只出現了兩個bullet points 04/04 12:41