Hi there,
Here is a slimmed down version of what you are asking for (only minimum amount of packages and code)
library(tidyverse)
library(shiny)
library(shinydashboard)
library(gapminder)
ui<-dashboardPage(
skin="red",
dashboardHeader(title="Has our world become more prosperous?",titleWidth = 500),
dashboardSidebar(
width = 250,
br(),
h4("Select the inputs here"),
selectInput("continent","Select the continent",
choices=sort(unique(gapminder$continent)))),
dashboardBody(
tabsetPanel(
type="tabs",
id="tab_selecetd",
tabPanel(title="Continent-view",
plotOutput("plot2")
)
)
))
server<-function(input,output){
continent<-reactive({
gapminder %>%
filter(continent == input$continent) %>%
group_by(year) %>%
summarise(mean_exp=mean(lifeExp))
})
output$plot2<-renderPlot({
ggplot(continent(),aes(year,mean_exp))+
geom_line(size=1.2)+theme_minimal()+
labs(title="Gains in life expectancy continent-wise")+
xlab("Year")+
ylab("Average Life Expectancy")
})
}
shinyApp(ui,server)
The most important change I made was when defining the continent variable you need to filter by continent, not group 
In the code was also a placeholder for Country, and you could add a filter for that, but it will clash with the Continent one if you don't put in extra (Shiny) code as countries from different continents would cause issues in display (if you want to use the sample plot).
Hope this helps,
PJ