 <p>Here is a working version with some changes from your original code. As pointed out in the other answer, there are a few errors in your code. In addition, I changed textOutput to htmlOutput. In server.R, I put all code inside the <code>observeEvent</code> environment.</p> <p>In general, your method in your R script needs to <strong>return</strong> something suitable for process in <code>server.R</code>. For example, in this case, it returns a string, which <code>server.R</code> renders as text, and <code>ui.R</code> in turn renders as HTML. </p> <p>Any variable/data that is accessible in <code>server.R</code> (including any files that it <code>source</code>) can be displayed in the ui. What you need is (1) a suitable render method to render this data in <code>server.R</code> (2) a suitable output container to hold the output display in <code>ui.R</code></p> <p>ui.R</p> <pre><code>library(shiny) shinyUI(fluidPage( headerPanel("Inputting from Interface to Script"), sidebarPanel( #'a' input numericInput(inputId = "a", label = h4("Enter a:"), value = 3), numericInput(inputId = "b", label = h4("Enter b:"), value = 4), actionButton(inputId = "input_action", label = "Show Inputs")), mainPanel( h2("Input Elements"), htmlOutput("td")), # use dataTableOuput to display the result of renderDataTable. Just like the render methods, there are many output methods available for different kind of outputs. See Shiny documentation. dataTableOutput("table") )) </code></pre> <p>server.R</p> <pre><code>library(shiny) source("mathops.R") shinyServer(function(input, output) { observeEvent(input$input_action, { a = input$a b = input$b output$td &lt;- renderText({ mathops(a,b) }) }) # Use renderDataTable to convert mat2 to a displayable object. There are many other render methods for different kind of data and output, you can find them in Shiny documentation output$table &lt;- renderDataTable(data.frame(mat2)) }) </code></pre> <p>mathops.R</p> <pre><code>mathops &lt;- function(a,b) { return(paste0("Addition of two number is: ", a+b, br(), "Multiplication of two number is: ", a*b)) } mat1 &lt;- matrix(sample(1:16), ncol=4) mat2 &lt;- matrix(sample(1:25), ncol=5) </code></pre>