Developing Data Products complete course is currently being offered by Johns Hopkins University through Coursera platform and is being taught by Brian Caffo, Jeff Leek and Roger D. Peng.
Learning Outcomes
- Develop basic applications and interactive graphics using GoogleVis
- Use Leaflet to create interactive annotated maps
- Build an R Markdown presentation that includes a data visualization
- Create a data product that tells a story to a mass audience
Skills You Will Gain
- Interactivity
- Plotly
- Web Application
- R Programming
Also Check: How to Apply for Coursera Financial Aid

library(manipulate)
myPlot <- function(s) {
plot(cars$dist - mean(cars$dist), cars$speed - mean(cars$speed))
abline(0, s)
}
This function plots distance versus speed, each de-meaned and an associated line of
slope s.
Which of the following code will make a manipulate plot that creates a slider for the slope?
- 1 manipulate(myPlot(s), x.s = slider(0, 2, step = 0.1))
- 1 manipulate(myPlot(s), slider = x(0, 2, step = 0.1))
- 1 manipulate(myPlot, s = slider(0, 2, step = 0.1))
- 1 manipulate(myPlot(s), s = slider(0, 2, step = 0.1))
Question 2) Which of the following code uses the rChzrts package to create a sortable and searchable data table for the a1rquzl1ty data set? Assume the rCharts package and the a1rgual1ty data set have already been loaded into R.
- 1 head(airquality)
- 1 d <- data.frame(airquality, stringsAsFactors = FALSE)print(d)
- 1 airquality
- 1 dTable(airquality, sPaginationType = "full_numbers")
Question 3) A basic shiny data product requires:
- A shiny .R file.
- A server.R file only.
- A ui.R file only.
- A ui.R and server.R file or a Aserver.R file and a directory called www
Question 4) What is incorrect about the following syntax in u1.R?
library(shiny)
shinyUI(pageWithSidebar(
headerPanel("Data science FTW!"),
sidebarPanel(
h2('Big text')
h3('Sidebar')
),
mainPanel(
h3('Main Panel text')
)
))
- The h2 command has the wrong arguments.
- The h3 command should be an h2 command.
- Missing a comma in the sidebar panel
- The "Sidebar" should say "Sidebar text".
Question 5) Consider the following code in ui.R
shinyUI(pageWithSidebar(
headerPanel("Example plot"),
sidebarPanel(
sliderInput('mu', 'Guess at the mu',value = 70, min = 60, max = 80, step
= 0.05,) ),
mainPanel(
plotOutput('newHist')
)
))
And the following code.
library(UsingR)
data(galton)
shinyServer(
function(input, output) {
output$myHist <- renderPlot({
hist(galton$child, xlab='child height', col='lightblue',main
='Histogram')
mu <- input$mu
lines(c(mu, mu), c(0, 200),col="red",lwd=5)
mse <- mean((galton$child - mu)^2)
text(63, 150, paste("mu = ", mu))
text(63, 140, paste("MSE = ", round(mse, 2)))
}) }
)
Why isn't it doing what we want?
- The server.R output name isn't the same as the plotOutput command used in ui.R
- The phrase "Guess at the mu value" should say "mean" instead of "mu"
- It should be mu <- input$mean in server.R
- The limits of the slider are set incorrectly and giving an error.
- It changes whether the document is self contained or requires being connected to the internet.
- It changes nothing.
- It changes the html5 framework thus changing the style of the slides.
- It changes the ability to display mathjax javascript rendering.
```{r}fit <- lm(y - x1 + xZ + x3)summory(fit)```
- Comment out the command # sugary(:f1t)
- Add a echo = FALSE option in the (r) call of the code chunk
- Add a results - ’h1de’ option in the (r) call of the code chunk
- Comment the command as below but also use a bang symbol after the comment, as in #! survey(I'1t}
...fit <- lm(y - x1 + x2 + x3)summOry(fit)```
- Comment the command, but use a bang symbol after the comment, as in
- #! sugary(I it)
- Add a echo = TRUEoption in the (r) call of the code chunk
- Add a echo = FALSE option in the (r) call of the code chunk
- Comment out the command # suzzaary(t1t)
- Creates HTMLS slides using a generalized markdown format having an extention Rpres and creates reproducible presentations by embedding and running the R code from within the presentation document.
- Creates presentable R code from within presentations. However, it does not actually run the code.
- Creates a presentation that can only be run from within Rstudio.
- Creates a power point presentation from a generalized markdown format having an extension Rpres.
- 1 results = hide’
- 1 echo = FALSE
- 1 run = FALSE
- 1 eval = FALSE
- Summarize the problem first.
- Present results in the chronological order in which it was performed.
- Show every analysis and method that was done.
- Do not include figure captions.
Question 1) Which of the following items is required for an R package to pass R CMD check without any warnings or errors?
- vignette
- unit tests
- a demo directory
- example data sets
- DESCRIPTION file
Question 2) Which of the following is a generic function in a fresh installation of R, with only the default packages loaded?
- colSums
- Im
- show
- dgamma
- predict
- mean
Question 3) What function is used to obtain the function body for an S4 method function?
- getMethod()
- getClass()
- showMethods()
- getS3method()
Question 4) Please download the R package DDPQuiz3 from the course web site. Examine the create sean function implemented in the R/ sub-directory. What is the appropriate text to place above the c:rezteaezn function for Roxygen2 to create a complete help file?
(1)
- This function calculates the mean
- @param x is a numeric vector
- @return the mean of x
- @export
- @examples
- x <- 1:10
- createmean(x)
(2)
- #' This function calculates the mean
- #'
- #' @return the mean of x
- #' @export
- #' @examples
- #' x <- 1:10
- #' createmean(x)
(3)
- #' This function calculates the mean
- #'
- #' @param x is a numeric vector
- #' @return the mean of x
- #' @export
- #' @examples
- #' x <- 1:10
- #' createmean(x)
(4)
- #' This function calculates the mean
- #'
- #' @param x is a numeric vector
- #' @return the mean of x
- #' @export
- #' @examples
- #' x <- 1:10
- #' createmean(y)
Post a Comment