Shiny app for prediction with rpart displaying error
<p>I tried to build a shiny app. The objective was to let user input a csv file in a input box. Then user can input a dependent variable name in text box. The main panel will display the summary details of model fit and plot.</p>

<p>I have coded the following as <strong>ui.R</strong>:</p>

<pre><code>library(shiny)
shinyUI(fluidPage(

titlePanel(h1("ANALYSIS",align = "center")),
sidebarLayout(
    sidebarPanel(

        fileInput('file1', 'Select CSV File',
                  accept=c('text/csv', 
                           'text/comma-separated-values,text/plain', 
                           '.csv')),
        textInput("text", label = strong("Dependent Variable"), 
                  value = "Enter Dependent Variable...")
    ),
    mainPanel(br(),

              textOutput('text1'),
              plotOutput('plot')
        )
        )
))
</code></pre>

<p>The following as server.R :</p>

<pre><code> library(shiny)
 library(rpart)
 library(rpart.plot)

 shinyServer(function(input, output) {

    output$text1 &lt;- renderText({
    inFile &lt;- input$file1
    if (is.null(inFile))
        return(NULL)
    data &lt;-read.csv(inFile$datapath, header=input$header, sep=input$sep,  quote=input$quote)
    depVar &lt;- input$text
    modrpart &lt;- rpart(depVar ~. ,data=data)
    modrpart
    #depVar


})

    output$plot &lt;- renderPlot({
        inFile &lt;- input$file1
        if (is.null(inFile))
            return(NULL)
        data &lt;-read.csv(inFile$datapath, header=input$header, sep=input$sep,  quote=input$quote)
        depVar &lt;- input$text
        modrpart &lt;- rpart(depVar ~. ,data=data)
        prp(modrpart)
    })


})
</code></pre>

<p>When RunApp is called, its showing error "Error in !: invalid argument type".
The model details and plot is not displayed in main panel as intended. I am missing something . I have used <a href="https://drive.google.com/open?id=0B0ByEpXfdtGWMjZHUGpNc3ZZSTg" rel="nofollow">https://drive.google.com/open?id=0B0ByEpXfdtGWMjZHUGpNc3ZZSTg</a> for test. Thanks</p>