R Programming Language Certification Communication & Stakeholder Relations 5 — Questions and Answers
Question 1: A data scientist wants to narrate findings in a report but hide lengthy warnings from package loading. Which knitr chunk option suppresses warnings without hiding output?
- warning = FALSE (Correct answer)
- message = FALSE
- error = FALSE
- echo = FALSE
Correct answer: warning = FALSE
warning = FALSE suppresses warning messages generated during chunk execution while still displaying computed output and plots.
Question 2: A stakeholder requests that R analysis results be automatically sent to a shared Google Sheet after each run. Which package enables writing directly to Google Sheets from R?
- googlesheets4 (Correct answer)
- httr
- curl
- jsonlite
Correct answer: googlesheets4
googlesheets4 provides read and write access to Google Sheets from R using OAuth authentication, enabling automated data pushes after each analysis run.
Question 3: When comparing two groups for an executive audience, which visualization type most clearly shows both the difference and the underlying distribution?
- A raincloud plot or violin plot with overlaid boxplot and jittered points (Correct answer)
- A pie chart
- A stacked bar chart
- A line chart
Correct answer: A raincloud plot or violin plot with overlaid boxplot and jittered points
Raincloud and violin plots simultaneously show distributional shape, summary statistics, and individual data points, giving executives a complete picture in one view.
Question 4: A stakeholder insists on using a metric that the analyst knows is statistically flawed. What is the recommended professional approach?
- Document the limitation in writing, propose a better metric with supporting evidence, and defer to the stakeholder's final decision (Correct answer)
- Silently use the correct metric without telling the stakeholder
- Refuse to proceed with the analysis
- Use the flawed metric without comment
Correct answer: Document the limitation in writing, propose a better metric with supporting evidence, and defer to the stakeholder's final decision
Analysts have an obligation to flag methodological concerns in writing and offer alternatives, but ultimate business decisions belong to the stakeholder.
Question 5: Which R function renders an R Markdown document from the command line or a scheduled script without opening RStudio?
- rmarkdown::render('report.Rmd') (Correct answer)
- knitr::knit('report.Rmd')
- source('report.Rmd')
- Rscript report.Rmd
Correct answer: rmarkdown::render('report.Rmd')
rmarkdown::render() is the programmatic entry point for rendering .Rmd files and can be called from any R session, script, or scheduled job.
Question 6: A colleague reviewing your analysis notes that the same data cleaning step appears in three separate scripts. What communication-friendly refactoring should you apply?
- Extract the logic into a shared R function in a sourced utility file or an internal package (Correct answer)
- Copy-paste the fix into each script
- Leave it as-is to avoid breaking changes
- Use a global variable instead
Correct answer: Extract the logic into a shared R function in a sourced utility file or an internal package
Centralizing repeated logic in a sourced utility file or package ensures all scripts use the same transformation, making maintenance and communication of changes straightforward.
Question 7: A stakeholder from operations asks for a one-number summary of model accuracy that is easy to explain. The outcome is binary (yes/no). Which metric is most intuitive for non-statisticians?
- Accuracy (percent of correct predictions) or a confusion matrix explained in plain language (Correct answer)
- Area Under the ROC Curve (AUC) alone
- Log-loss
- Brier score
Correct answer: Accuracy (percent of correct predictions) or a confusion matrix explained in plain language
Accuracy ('the model was correct 87% of the time') is immediately intuitive, though it should be accompanied by a confusion matrix to reveal false positive/negative trade-offs.
A data scientist wants to narrate findings in a report but hide lengthy warnings from package loading.
Which knitr chunk option suppresses warnings without hiding output?