title: How to put ggplot in the renderPlot in shiny r?
body: <p>I am new to shiny and I have problems with putting the <code>ggplot</code> into the <code>renderPlot</code>. If the <code>ggplot</code> ran alone it works well but when I started to put it in the <code>renderPlot</code> It plotted nothing.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>library(shiny)
  library(shinyWidgets)
  library(shinydashboard)
  library(shinythemes)
  library(leaflet)
  library(magrittr)
  library(rvest)
  library(readxl)
  library(dplyr)
  library(maps)
  library(ggplot2)
  library(reshape2)
  library(plotly)
  
  cv_continent &lt;- read.csv("coronavirus_continent.csv")
  
  ui &lt;- bootstrapPage(
    tags$head(includeHTML("gtag.html")),
    navbarPage(theme = shinytheme("flatly"), collapsible = TRUE,
               "VISUALISATION LE COVID-19", id="nav",
  
               tabPanel("GLOBAL",
                         sidebarPanel(
                             width= 20,
                             span(tags$i(h1("Visualiser la revolution globale du Covid-19 pendant 4 mois\n")), style="color:#045a8d"),
                             span(tags$i(h2("Diagramme en barre")), style="color:#045a8d"),
                             selectInput("condition","Choisir observation:",
                                         choices = c("Cas","NouveauxCas","Décès","NouveauxDécès"))
                          ),
  
                         plotOutput("image")
  
                        ),
  
               tabPanel("Continent",
                    sidebarLayout(
                        sidebarPanel(
                          span(tags$i(h4("Visualiser la revolution du Covid-19 par continent\n")), style="color:#045a8d"),
                          selectInput("continent","Choisir un continent:",
                                      choices = c("Asie","Europe","Amérique_du_Nord","Amérique_du_Sud","Océanie"))
                        ),
                        #mainPanel(
                          tabsetPanel(
                            tabPanel("Diagramme en barre pour chaque continent", plotlyOutput("barre")),
                            tabPanel("Diagramme sectoriel", plotlyOutput("sectoriel")),
                            tabPanel("Dendrogramme", plotlyOutput("dendrogramme"))
                          )
                      #  )
  
                      )     
               )
    )
  
  )
  server &lt;- function(input, output){
   ContinentInput &lt;- reactive({
      switch(input$continent,
             "Asie" = Asia,
             "Europe" = Europe,
             "Amérique_du_Nord" = North_America,
             "Amérique_du_Sud" = South_America,
             "Océanie" = Oceania)
    })
  
  
  output$sectoriel &lt;-renderPlot({
  
    sec &lt;- cv_continent %&gt;% 
        group_by(continent_level) %&gt;%
        summarise(total=sum(cases)) %&gt;%
        mutate(pourcentage= total/sum(total) * 100)  
  
        ggplot(sec, aes(x = "",fill= continent_level)) +
        geom_bar(aes(y=pourcentage),width=1,stat="identity")+
        coord_polar(theta = "y")+
        geom_text(size=1.5,aes(y=pourcentage,label = paste0(round(pourcentage,digits = 2), "%")), 
                  position = position_stack(vjust = 0.5),color="black")+
        scale_fill_manual(values = c("Lightblue","#AD7366","Lightgreen","Orange","Coral","#254290"))+
        labs(x="",y="",title = "\n",fill= "Libellé de famille de métier")+
        theme_classic() + theme(axis.line = element_blank(),
                                axis.text = element_blank(),
                                axis.ticks = element_blank(),
                                plot.title = element_text(hjust = 4, color = "#666666"))
        })
  
  
  
  }
  shinyApp(ui=ui, server=server)
  </code></pre>
  
  <p>Here I want to plot in the section <code>Continent</code> and in the second <code>tabPanel</code> name <code>Diagramme sectoriel</code> </p>
  
  <p>In case you need here is the link for csv and others files: <a href="https://gitlab.com/Schrodinger168/practice/-/tree/master#" rel="nofollow noreferrer">https://gitlab.com/Schrodinger168/practice/-/tree/master#</a></p>
  
  <p>Any help for this would be much appreciated! Thank you!</p>