titlePanel(title=div(img(src="https://siw.amu.edu.pl/__data/assets/file/0004/162751/logo_wersja-podstawowa_granat_1.jpg",width=50,height=50),'explore CO2 data')),
tabPanel("Linear Chart",
sidebarLayout(
sidebarPanel(
selectInput('country',
'Select Country',
selected='Afghanistan',
choices=countries
),
selectInput('category',
'Select Category',
selected='population',
choices=col_names
)
),
mainPanel(
plotlyOutput('linear_chart')
),
)
),
tabPanel(
'GDP',
plotlyOutput('gdp')
),
tabPanel("Map: CO2 by year",
sidebarLayout(
sidebarPanel(
selectInput('year',
'Select year',
selected='2011',
choices=years
)
),
mainPanel(
plotlyOutput('map'),
),
)
),
tabPanel("Map: statistics in year 2011",
sidebarLayout(
sidebarPanel(
selectInput('category2',
'Select category',
selected='population',
choices=col_names
)
),
mainPanel(
plotlyOutput('map2'),
),
)
),
tabPanel(
'Biggest CO2 Production',
fluidRow(
column(6,plotlyOutput(outputId="the_most_1")),
column(6,plotlyOutput(outputId="the_most_2")),
column(6,plotlyOutput(outputId="the_most_3"))
)
),
tabPanel(
'Smallest CO2 production',
fluidRow(
column(6,plotlyOutput(outputId="the_least_1")),
column(6,plotlyOutput(outputId="the_least_2")),
column(6,plotlyOutput(outputId="the_least_3"))
)
),
tabPanel(
'Data',
DT::dataTableOutput('tableData')
),
tabPanel(
'Theme',
shinythemes::themeSelector(),
theme=shinythemes::shinytheme('flatly'),
)
)
server<-function(input,output,session){
output$tableData<-DT::renderDataTable({
CO_data%>%
filter(country==input$country)%>%
DT::datatable()
})
output$linear_chart<-renderPlotly({
CO_data%>%
filter(country==input$country)%>%
ggplot(aes(x=year,y=get(input$category)))+
ylab(input$category)+
geom_line()
})
output$gdp<-renderPlotly({
CO_data_filtered%>%
filter(year==2011)%>%
ggplot(aes(x=gdp,y=co2,label=country))+
geom_line()+
geom_point()+
ylim(0,10000)+
ggtitle('Placement of countries by CO2 and GDP production')