Handling Errors in a plotting function
<p>I have a shiny application which takes an input of a csv file.</p>

<p>I have a plotting function in <code>server.R</code></p>

<p><code>myPlot &lt;- function(data)</code>{This function uses the variables from the data frame in parenthesis. This data frame is the input from the uploaded file.}</p>

<p>Imagine if the data frame does not have the columns which are used by the function we will encounter an error in the shiny tab.</p>

<p>How does one handle such an error?</p>

<p>I would like to handle it by throwing a message stating "the following file is not compatible."</p>