作者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://webptt.com/cn.aspx?n=bbs/R_Language/M.1712205389.A.7B1.html
1F:→ luenchang: 我用tabsetPanel()及tabPanel()想产生两个tabs Food及 04/04 12:41
2F:→ luenchang: Hygiene products. 只出现了两个bullet points 04/04 12:41