Created
January 16, 2013 12:27
-
-
Save marcionicolau/4546801 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="https://github.com/livereload/livereload-js/raw/master/dist/livereload.js?host=localhost"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <script src="http://aleph.sagemath.org/static/jquery.min.js"></script> | |
| <script src="http://aleph.sagemath.org/static/embedded_sagecell.js"></script> | |
| <script> | |
| $(function () { | |
| sagecell.makeSagecell({inputLocation: 'div.compute-r', | |
| evalButtonText: 'Evaluate', | |
| defaultLanguage: "r", | |
| languages: sagecell.allLanguages}); | |
| }); | |
| </script> | |
| <div class="compute-r"><script type="text/x-sage"> | |
| x <- 3; x <- x + 3 | |
| print(x) | |
| </script></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(shiny) | |
| shinyServer(function(input, output) { | |
| output$Routput=reactivePrint(function(){ | |
| cat(input$code,"\n") | |
| eval(parse(text = input$code)) | |
| }) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(shiny) | |
| shinyUI(pageWithSidebar( | |
| headerPanel("Basic notebook"), | |
| sidebarPanel(helpText("Include button to add input and output fields")), | |
| mainPanel( | |
| includeHTML('lr.js'), # needed for livereload | |
| tabsetPanel(id = "tabs", | |
| tabPanel("Notebook",textInput("code","Input R-code", value = 'x <- 3; x <- x + 3'), verbatimTextOutput("Routput"), helpText("Add button to evaluate the code and make the return panel conditional on the the type of output (e.g., text, plot, table).")), | |
| tabPanel("Sage", includeHTML('sage.js')) | |
| ) | |
| ) | |
| )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment