我尝试了这段代码,从一个侧边栏菜单项移动到另一个边栏菜单项。但是它不起作用。例如:我希望“简介”选项卡只有描述文本,数据选项卡有数据输出和可视化选项卡tabset面板。我无法找出我在做错的地方。 这是我的代码:
library(shiny)
library(shinydashboard)
sidebar <- dashboardSidebar(width = 350,
sidebarMenu(id ="tabs",
menuItem("Introduction", tabName = "dashboard", icon = icon("dashboard")),
br(),
menuItem("Data", tabName = "data", icon = icon("th")),
br(),
menuItem("Visualization", tabName = "Visual", icon = icon("th")
),
br(),
fileInput("file" , "Dataset"),
textInput("hashtag", "Enter Hashtag",""),
sliderInput("datasize","# of tweets",min = 100,max = 10000,""),
submitButton("Submit","", width = 80),
tags$style(type='text/css', "button#Submit { margin-right: 50px; }"),
tags$style(type = "text/css",
".submit label { font-size: 50px;}"
),
br(),
br(),
radioButtons("paramerters","Select the parameters",list("Sentiment","Emotion","Time series
","Location","Wordcloud","Age","Gender"),""),
tags$style(type = "text/css",
".radio label { font-size: 16px;}"
),
br(),
actionButton("action",label = "Analyse!",class = "butt1", icon = icon("refresh"), style = "font-size: 130%; color: #fff; background-color: #337ab7; border-color: #2e6da4"),
tags$style(type='text/css', "button#action { margin-left: 50px; }")
)
)
body <- dashboardBody(
tabItems(
tabItem(tabName = "dashboard",
br(),
br(),
h2("Introduction", align = "center", style = "font-family: 'times'; color:red"),
br(),
p("On 8 November 2016, Prime Minister of India Narendra Modi announced the",a("demonetisation", href = "https://en.wikipedia.org/wiki/2016_Indian_banknote_demonetisation"),"of all Rs 500 and Rs 1,000 banknotes of the Mahatma Gandhi Series by the Government of India.
In the announcement, Modi declared that use of all 500 rs and 1000rs banknotes of the Mahatma Gandhi Series would be invalid past midnight, and announced the issuance of new 500rs and 2000rs banknotes
of the Mahatma Gandhi New Series in exchange for the old banknotes.
The government claimed that the action would curtail the shadow economy and crack down on the use of illicit and counterfeit cash to fund illegal activity and terrorism."
,width= 12, align ="bottom", style = "font-family: 'times', font-size: 45px"),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
br(),
column(align="left",
h2("About this app ...", align = "left", style = "font-family: 'times'; color:red; font-size: 130%"),
p("This app helps you to explore and visualize the Demonetisation in india 2016."
,style = "font-family: 'times', font-size: 10pt"),
width = 4,
align = "bottom"))
),
tabItem(tabName = "Data",
box(title = "DEmonetisation related Tweets 2016",
width = 12,
DT::dataTableOutput('da.tab'))
),
tabItem(tabName = "visual",
mainPanel(
tabsetPanel(
tabPanel("Tab1", "First tab content"),
tabPanel("Tab2", "Tab content 2")
)
)
)
)
ui <- dashboardPage(skin = "yellow",
dashboardHeader(title= HTML(paste(icon('inr'),"DEMONETisation")),titleWidth = 350 ),
sidebar,
body)
请帮我处理代码。 感谢。