0

My data that i have imported has 21 columns and each column have rows written as "ENGLISH" OR "ARABIC" But my when i read data it shows me 3 levels, "ENGLISH" , "ARABIC" and "" and due to which my geom_bar gives me 3 bars instead of 2. I need the plot of the data ENGLISH and ARABIC in my columns but its also showing me with the third that is blank "" . Help me Out with this Please.

            library(shiny)
            library(shinydashboard)
            library(ggplot2)
            library(dplyr)

    CatLang <- read.csv("C:/Users/Saqlain/Downloads/Careem/CatLang.csv",stringsAsFactors = TRUE)

        ui <- fluidPage(
              dashboardPage(
        dashboardBody(
                          fluidRow(
                          column(6,
                          plotOutput("LangHist1")       
                                 )
                          )
        )))

        server <- function(input, output) {

         output$LangHist1 <- renderPlot({
                    plotLang1<- ggplot(data.frame(CatLang$CAPTAIN.HYGIENE), aes(CatLang$CAPTAIN.HYGIENE)) + geom_bar()
                    plotLang1 + theme_light()
              }) 
     output$CountryHist1 <- renderPlot({
                plotCountry1 <-ggplot(data.frame(CatCountry$CAPTAIN.HYGIENE), aes(CatCountry$CAPTAIN.HYGIENE)) + geom_bar( width = 0.4, color = "black")
                plotCountry1 + theme_light()
          })
            }

shinyApp(ui = ui, server = server)

As you can see in the output it is showing an extra bar of blank data. I have no blank data in my data, how do i overcome this problem ?

0 Answers0