Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Data Visualization
for Corpus
Linguistics:
Shiny Framework
Olga Scrivner
Visual Analytics
Reactive
Framework
Shiny App
Pra...
Upcoming SlideShare
Loading in …5
×

Workshop: Data Visualization for Corpus Linguistics via Shiny Framework

442 views

Published on

Hands-on workshop on Shiny Web Framework for Corpus Linguistics

Published in: Data & Analytics
  • Be the first to comment

Workshop: Data Visualization for Corpus Linguistics via Shiny Framework

  1. 1. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner
  2. 2. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice What You Will Learn 1. Introduction to Visual Analytics 2. Reactive Web Framework 3. Shiny Application 4. Practice https://languagevariationsuite.wordpress.com/
  3. 3. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Data Analytics “Analytics is the critical technology needed to bring value out of data” (Anonymous)
  4. 4. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Visual Analytics “The science of analytical reasoning facilitated by visual interactive interfaces” (Thomas and Cook, 2005) “Visual analytics integrates new computational and theory-based tools with innovative interactive techniques and visual representations to enable human-information discourse” (Thomas and Cook, 2005)
  5. 5. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Visual Analytics and Linguistics “ Language is a system of relatively arbitrary symbols” (Baker-Shenk and Cokely, 1980) http://www.tableaufit.com/tableau-conference-linguistics-data-visualization/
  6. 6. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Visual Analytics (and Corpus Linguistics) 1. Exploration (Queries) 2. Comprehension (Analysis) 3. Communication (Presentation)
  7. 7. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Corpus Linguistics Visualization http://scimaps.org/home.html
  8. 8. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Visualization Tools Challenges: Many tools are built for non-linguistic research Limited preprocessing Visualization may not fit linguistic data
  9. 9. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Visualization Tools Challenges: Many tools are built for non-linguistic research Limited preprocessing Visualization may not fit linguistic data Solution: Reactive Framework Interactive and web-based Research-driven customization Build your own tool!
  10. 10. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Reactive Web Framework “Reactive Systems are highly responsive, giving users effective interactive feedback” http://www.reactivemanifesto.org/ http://littleactuary.github.io/blog/Web-application-framework-with-Shiny/
  11. 11. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Reactive Architecture
  12. 12. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Reactive Framework and Data Science “The impact of data scientists’ work depends on how well others can understand their insights to take further actions” Benefit 1: Interactive display and manipulation of data Benefit 2: No installation required Benefit 3: Easy to develop and share with clients and project teams Benefit 4: Open source library http://datascience.ibm.com/blog/shiny-a-data-scientist-best-friend/
  13. 13. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Shiny Application 1. Shiny is an R package for building interactive web applications 2. Open-Sourced by RStudio 11/2012 on CRAN 3. Uses web sockets (new HTTP): Interactive communication sessions between the user’s browser and a server without having to poll the server for a reply 4. Entirely extensible - custom input/output
  14. 14. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Shiny Library http://littleactuary.github.io/blog/Web-application-framework-with-Shiny/
  15. 15. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Shiny Gallery - Get Inspired https://www.rstudio.com/products/shiny/shiny-user-showcase/
  16. 16. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Interactive Text Mining Suite (Scrivner et al. 2016) 1. Web application for text processing and mining 2. Interactive natural language processing techniques Wordstops, stemming, text-preprocessing 3. High customization
  17. 17. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Stopwords Stopwords (e.g. the, and):
  18. 18. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Manual Removal of Stopwords
  19. 19. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Stemming
  20. 20. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Word Cloud Representation
  21. 21. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Customization
  22. 22. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Format Flexibility Example: Using Google Books API Current limitation is 40 books
  23. 23. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Workshop Materials 1. Rstudio 2. R 3. Shiny library 4. Materials: https: //languagevariationsuite.wordpress.com/
  24. 24. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice R software R is a free software for data analysis, text mining and visualization. To install R on Window: 1. Download the binary file for R https://cran.r-project.org/bin/windows/base/ R-3.3.1-win.exe 2. Open the downloaded .exe file and Install R To install R on Mac: 1. Download the appropriate version of .pkg file https://cran.r-project.org/bin/macosx/ 2. Open the downloaded .pkg file and Install R
  25. 25. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice R Studio RStudio is a free user interface for R. 1. Install the appropriate RStudio version https: //www.rstudio.com/products/rstudio/download/ 2. Run it to install R-studio
  26. 26. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice R Studio Structure
  27. 27. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Installing Packages In your bottom left window - go to Packages
  28. 28. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Selecting Packages - shiny
  29. 29. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Creating Scripts Create R File: File → New File → R Script
  30. 30. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Execution - RUN To execute - click run In the script (top left window) type: library(shiny) Click Run (your cursor can be at the beginning or at the end of the line)
  31. 31. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Shiny Demo runExample(“01 hello”)
  32. 32. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Shiny Demo
  33. 33. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Shiny Demo
  34. 34. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice UI.R
  35. 35. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Reactive Input/Output Input - things user can toggle Output - R objects that user can see, often depend on inputs
  36. 36. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Closing App
  37. 37. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Step 1 - Create New Web Shiny App
  38. 38. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Step 2 - Run App
  39. 39. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice UI shinyUI( fluidPage( titlePanel(“Old Faithful Geyser Data”), sidebarLayout( sidebarPanel( sliderInput(“bins”, “Number of bins:”, min = 1, max = 50, value = 30)
  40. 40. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice UI shinyUI( fluidPage( titlePanel(“Old Faithful Geyser Data”), sidebarLayout( sidebarPanel( sliderInput(“bins”, “Number of bins:”, min = 1, max = 50, value = 30)
  41. 41. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Modifying UI - Practice Change slider’s label: Number of bins → Choose a number Change slider’s values: max and value Save RunApp
  42. 42. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice HTML The UI script simply creates HTML
  43. 43. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice HTML HTML tags: http: //shiny.rstudio.com/articles/tag-glossary.html h1() = header1 br() = line break p() = paragraph hr() = line
  44. 44. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Adding HTML Tags to UI.R - Practice shinyUI( fluidPage( titlePanel(“My Title”), h3(“My subtitle”), p(“This is my first app!”), br(), hr(),
  45. 45. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Layout http: //shiny.rstudio.com/articles/layout-guide.html
  46. 46. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice mainPanel mainPanel( plotOutput(”distPlot”)) Let’s add 3 tab panels: Plot, Summary, Table
  47. 47. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice tabsetPanel mainPanel( tabsetPanel( tabPanel(“Plot”, plotOutput(“distPlot”)), tabPanel(“Summary”), tabPanel(“Table”) ) )
  48. 48. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Input Data
  49. 49. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Input Data 1. Blog https: //languagevariationsuite.wordpress.com/ 2. Download csv file - movie metadata.csv 3. Place this file into the directory myshiny
  50. 50. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice New Input in UI.R Let’s look at the fileInput() function from Shiny Reference page Type in your browser: fileInput Shiny or go to the Shiny Reference page - https://shiny.rstudio.com/reference/shiny/ latest/fileInput.html
  51. 51. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice New Input in UI.R Scroll down to Examples We will add fileInput function inside sidebarPanel Copy fileInput function
  52. 52. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice New Input in UI.R Paste it after slider NB: commas are important!
  53. 53. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Reactive Function in Sever.R Reactive - it changes every time the user uploads new data Create a function that reads csv file myfile() is a function that will read and return csv files
  54. 54. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Render - Reactive Data
  55. 55. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Function summary in Server.R output$summary <- renderPrint({ summary(myfile()) })
  56. 56. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice New Output Function table in Server.R output$table <- renderDataTable({ myfile() })
  57. 57. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Linking summary and table with UI.R tabsetPanel( tabPanel("Plot", plotOutput("distPlot")), tabPanel("Summary", verbatimTextOutput("summary")), tabPanel("Table", dataTableOutput("table")) )
  58. 58. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Linking summary and table with UI.R tabsetPanel( tabPanel("Plot", plotOutput("distPlot")), tabPanel("Summary", verbatimTextOutput("summary")), tabPanel("Table", dataTableOutput("table")) ) RunApp
  59. 59. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Testing CSV Upload
  60. 60. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice One more IF-Statement - Server.R We want to do a histogram for csv file: if (condition) {do..} else {do...}
  61. 61. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice One more IF-Statement - Server.R We want to do a histogram for csv file: if (condition) {do..} else {do...} output$distPlot <- renderPlot({ if (is.null(input$file1)) { .... hist(x, breaks = bins, col = ’darkgray’, border = ’white’) }
  62. 62. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice One more IF-Statement - Server.R We want to do a histogram for csv file: if (condition) {do..} else {do...} output$distPlot <- renderPlot({ if (is.null(input$file1)) { .... hist(x, breaks = bins, col = ’darkgray’, border = ’white’) } else{ x <- myfile()$budget bins <- seq(min(x), max(x), length.out = input$bins + 1) hist(x, breaks = bins, col=’red’, main = ’My New Histogram’) } })
  63. 63. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice RunApp
  64. 64. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Server - Recap
  65. 65. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Deployment Options 1. Share server.r and ui.r 2. Host on shinyapps.io 3. Host on Shiny server
  66. 66. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Deploy with shinyapps.io www.shinyapps.io sign up for an account. Publish Application button in RStudio and follow instructions
  67. 67. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Deploy with shinyapps.io
  68. 68. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice My shinyapps.io
  69. 69. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice My shinyapps.io
  70. 70. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Future of Visualization Tools: CNS Cyberinfrastructure for Network Science Center at Indiana University - http://cns.iu.edu/ Our current project on Shiny Framework (team Olga Scrivner and Jivitesh Poojary) Build Shiny templates for Data Visualization: stage I https: //github.com/Jivitesh-Poojary/CNS-Shiny-Apps Create user-friendly customizable Shiny dashboards: stage II Develop preprocessing plugins for Shiny templates: stage III
  71. 71. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Useful resources 1. Shiny official tutorial - http://shiny.rstudio.com/tutorial 2. Cheat sheet - http://shiny.rstudio.com/images/ shiny-cheatsheet.pdf 3. Publish your app free - http://www.shinyapps.io 4. Examples -http://www.showmeshiny.com/ 5. Tutorial by Dean Attali - http://deanattali.com/ blog/building-shiny-apps-tutorial/
  72. 72. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Thank you! My email: obscrivn@indiana.edu
  73. 73. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice References B¨orner, Katy. 2015. Atlas of Knowledge: Anyone Can Map. The MIT Press Collins, Christopher. 2012. Bridging the Linguistic Visualization Divide. LingVis/UNCLH Workshop Grolemund, Garrett. 2017. How to start with Shiny, Part 1. Workshop
  74. 74. Data Visualization for Corpus Linguistics: Shiny Framework Olga Scrivner Visual Analytics Reactive Framework Shiny App Practice Credits http: //deanattali.com/blog/building-shiny-apps-tutorial/ http://scimaps.org/mapdetail/stream_of_scientific_128 https://github.com/IBMDataScience/dsx-shiny-apps http://www.slideshare.net/SarahAerni/ data-science-as-a-commodity-use-madlib-r-other-oss-tools-for-data- http://www.unixstickers.com/image/data/stickers/ react/badge/React-JS.sh.png https://github.com/rstudio/shiny/issues/250 http://www.slideshare.net/ilio-catallo/ spring-mvc-the-basics

×