ETC5523: Communicating with Data

Tutorial 12

Author

Michael Lydeamore

Published

December 1, 2001

🎯 Objectives

  • Revise course material
  • Practice questions in the style of the oral exam

Practice Set 1

  1. Explain the Quarto workflow for creating a HTML report. What do you write, and how is it transformed? What are some of the output formats you can specify?
  • Quarto is written in a (modified) form of Markdown
  • This is converted to markdown
  • Computation is handled using knitr or a language-specific equivalent
  • pandoc converts this to the desired output format
  • Some of the output formats include: docx, pptx, html and pdf.
  1. Describe the purpose of a vignette, including ewhat type of information goes into one, and the technical details of how one is written. Give an example of the code used to create a vignette.
  • Long-form documentation
  • Include full examples of how to use a package
  • Written in RMarkdown
  • Included as part of a package installation
  • Provide a practical guide to a package, similar to a blog post or interactive tutorial
  • Easiest way to create is usethis::use_vignette()
  1. Explain the difference betwee the linear and transactional communication model
  • Linear communication model has sender and receiver in a line
  • Sender transmits a signal, it is affected by noise, then decoded by the receiver
  • It is a one-way communication system
  • The transactional communicaiton model is 2 way
  • It implies communication is continuous, ongoing process
  • There is more noise in this model (due to more communication).
  • There is no ideal way to communicate but the preferred model is transactional, as it reflects the back and forth between sender and recevier.

Practice Set 2

  1. What are some examples of information you might want to extract from a fitted linear model? What would be a good way to communicate these items?
  • Model paramter estimates
  • Model-related summary statistics (\(R^2\), AIC, BIC)
  • Residuals
  • Fitted values
  • Predictions

First two are good to present in a table, the last three are often best presented as visuals

  1. What is the ideal structure for a report or article? How does this differ to the structure for presentations?

Reports and articles have * Introduction * Literature * Data * Methods * Results * Conclusion

The structure is generally the shape of a pyramid, with most time spent on methods, results and conclusions.

This differs from presentations that use the hourglass structure, with little information on methods and most time spent on the ‘hook’ and the conclusion. Presentations tend to not have a literature section and do not contain as much detail as the report.

  1. Describe the checklist for asking a good question
  • Is the problem clearly and succintly described?
  • Is the expected solution or behaviour outlined?
  • Are you asking the right people at the right place?
  • Can people who can answer find your question?
  • Can the problem be easily reproduced on other people’s system
  • Is the minimum reproducible code or steps supplied?
  • Is the data supplied?
  • If the data is big, could you cull your data to communicate or reproduce your problem?

Practice Set 3

  1. Describe 4 of the different R Shiny inputs, and describe how changing these values can affect the app.

Big set here.

  • actionButton, actionLink: Have no outputs,
  • checkboxInput, checkboxGroupInput: Checkboxes with some choices
  • fileInput: Allows user to upload a file into the app
  • numericInput: User enters a number
  • radioButttons: Button that allows user to select one input
  • passwordInput: Like textInput but hides output from the user
  • textInput: User enters a string
  • dateInput, dateRangeInput: User picks dates, has a nice calendar selector
  • selectInput: User picks from a dropdown
  • sliderInput: User picks from a slider
  • selectizeInput: User adds from a dropdown to a list of options

All of these inputs trigger reactive events, based on whether or not the corresponding input is present in the server section of the shiny app.

The relevant function will automatically be evaluated if any of it’s inputs inside change.

  1. Name four of the naming cases conventions and describe them
  • camelCase: Capitalise all words after the first. Common in Shiny and JavaScript
  • PascalCase: Capitalise all words. Used often in C.
  • snake_case: All words lower case, separated by underscore. Convention in R
  • kebab-case: All words lower case, separate by dash. Common in HTML and CSS property names.
  1. Describe the difference between a website and a webpage. Tell me how HTML and CSS work together to create a page.
  • A webpage is a single page, usually written in HTML, that displays content in a webbrowser
  • A website is a collection of webpages
  • HTML provides the structure of the webpage, telling the browser where everything goes
  • CSS controls the look and feel (or style) of the webpage.
  • CSS is optional, HTML is required.
  • CSS changes elements of HTML, identified by IDs, classes, or elements