I am building a reliability data analysis tool in R Shiny. I am newish to R (used it once a few years ago) and new to Shiny. I haven't been able to solve this problem via the tutorials or forums :(

Basically, I want the user to upload a .csv file of the failure events table. This table has four columns (i, Xi, Ci and Ti) and can have any number of rows.

First, I want to display the data in table form. This part of my model currently works.

Then, I want to make a plot of Ti vs i. I have written code for it (I've tried many iterations, current code is below), but nothing I have tried works.

Later, I will want to perform statistical operations using the data (starting with a Laplace trend test), which I am also not yet sure how to do (eg. how do I specify which column/row/data item I'm using when performing operations?).

Below is the current R code (I have removed irrelevant sections):

```
library(shiny)
library(ggplot2)
library(tidyverse)

ui <- fluidPage(

  #App title
  titlePanel("Reliability Data Analysis Tool"),

  tabsetPanel(

    tabPanel("Model selection", fluid = TRUE,
             sidebarLayout(

               sidebarPanel(

                 "Welcome to the RShiny Reliability Data Analysis tool. 
                 To begin, please upload a valid events table file.", HTML('<br/>'),HTML('<br/>'),

                 #Allow user to input events table in .csv format
                 fileInput(
                   inputId = "fileEventsTable",
                   label = "Upload an events table", 
                   accept = ".csv"),

                 #Indicate whether or not data includes headers   
                 checkboxInput("header", "Header", TRUE),

               ),

               mainPanel(

                 h4("Events table"),

                 h5("Key"),
                 "i = Observation number,",
                 "Xi = Interarrival time,",
                 "Ci = Failure indication,",
                 "Ti = Global time",

                 #Display events table
                 tableOutput("eventsTableContents"),

                 HTML('<br/>'),

                 h4("Cumulative failure plot"),

                 #Display cumulative failure plot 
                 plotOutput("eventsTablePlot")

               )))))

server <- function(input, output) {

                   #Read .csv file as a data frame
                   eventsdataframe<-reactive({
                     if (is.null(input$fileEventsTable))
                       return(NULL)                
                     data<-read.csv2(input$fileEventsTable$datapath)
                   })

                   #Render table from events table data frame
                   output$eventsTableContents <- renderTable({
                     eventsdataframe()
                   })

                   #Render plot from events table data frame
                   output$eventsTablePlot <- renderPlot({
                     ggplot(data = eventsdataframe()  +
                              geom_point(aes(x=eventsdataframe$Ti,y=eventsdataframe$i,size=10)))

                   })
                 }

shinyApp(ui = ui, server = server)              

```

And this is the current output I get when running it and uploading an appropriate .csv file:

[Screenshot](https://i.stack.imgur.com/0M7D9.png)

Note the error: non-numeric argument to binary operator, where I want the scatter plot to be.

Any help/insight would be greatly appreciated!