I am writing an R file which prompts a user to upload a file and plots the data in the file the user uploads. I do not know how to reference the columns however (I am trying to use ggplot2) in my code.
The data the user will upload will be a CSV file that would look something like, but can vary:
        January February March April May
Burgers    4       5       3     5    2
I am stuck at the ggplot2 part where I need to reference column names.
server.R
library(shiny)
library(datasets)
library(ggplot2)
X <- read.csv(file.choose())
# Define server logic required to summarize and view the selected dataset
shinyServer(function(input, output) {
  # Generate a summary of the dataset
  output$summary <- renderPrint({
    dataset <- X
    summary(dataset)
  })
  # Show the first "n" observations
  output$view <- renderTable({
    head(X, n = input$obs)
  })
  # create line plot (I took this from https://gist.github.com/pssguy/4171750)
  output$plot <- reactivePlot(function() {
      print(ggplot(X, aes(x=date,y=count,group=name,colour=name))+
              geom_line()+ylab("")+xlab("") +theme_bw() + 
              theme(legend.position="top",legend.title=element_blank(),legend.text = element_text(colour="blue", size = 14, face = "bold")))
  })
})
UI.r
library(shiny)
# Define UI for dataset viewer application
shinyUI(pageWithSidebar(
  # Application title
  headerPanel("Sample Proj"),
  # Sidebar with controls to select a dataset and specify the number
  # of observations to view
  sidebarPanel(
    numericInput("obs", "Number of observations to view:", 10)
  ),
  # Show a summary of the dataset and an HTML table with the requested
  # number of observations
  mainPanel(
    tabsetPanel(
      tabPanel("Table", tableOutput("view")),
      tabPanel("LineGraph", plotOutput("plot"))
    )
  )
))
 
     
    