7.5.6.Video quiz - quanganh2001/Google-Data-Analytics-Professional-Certificate-Coursera GitHub Wiki

Overview of R Markdown

Questions: Fill in the blank: R Markdown is a _____ for making dynamic documents with R.

A. style guide

B. coding language

C. visualization tool

D. file format

The correct answer is D. file format. Explain: R Markdown is a file format for making dynamic documents with R.

R notebooks allow other users to run your code and display graphs and charts that visualize that code.

A. True

B. False

It is true statement. Explain: R notebooks are an interactive R Markdown option that allows other users to run your code and display graphs and charts that visualize that code.

Structure of markdown documents

Questions: A data analyst wants to make one of the headers in their R Markdown document smaller. What should they include in the markdown text to do this?

A. Semicolons

B. Backticks

C. Hashtags

D. Spaces

The correct answer is C. Hashtags. Explain: Hashtags are used for headers; the more hashtags, the smaller the header.

A data analyst inserts some code directly into their R Markdown file so that they can refer to it directly in their write-up. What is this called?

A. Markdown

B. Inline code

C. YAML header

D. R notebook

The correct answer is B. Inline code. Explain: Inline code can be inserted directly into the text of an .rmd file.

Even more document elements

Questions: A data analyst wants to include a link in their RMarkdown document. They should use the syntax (click here)[rstudio.com].

A. True

B. False

It is false statement. Explain: This syntax is incorrect. The analyst should enclose the text that they want to appear in the document in brackets. The URL should be in parenthesis after that. This data analyst has switched the formatting. It should be click here.

A data analyst wants to include the caption example 1 below an image (image URL: r-project.org/logo/Rlogo.png). What is the correct syntax for adding an image with this caption in an RMarkdown document?

A. %>%[example 1](r-project.org/logo/Rlogo.png)

B. +[example 1](r-project.org/logo/Rlogo.png)

C. =[example 1](r-project.org/logo/Rlogo.png)

D. ![example 1](r-project.org/logo/Rlogo.png)

The correct answer is D. ![example 1](r-project.org/logo/Rlogo.png). Explain: The correct syntax for adding an image with the caption example 1 to an RMarkdown file is ![example 1](r-project.org/logo/Rlogo.png). The syntax is an exclamation mark followed by the caption in brackets and the image URL or pathway in parentheses.

Code chunks

If you would like to follow along with the video, then complete the steps below to access the ggplot_hook.R file:

To start, log into your RStudio (Posit) Cloud account in a new tab. Open the project that you have been working with this link. If you haven't gone through this process already, at the top right portion of the screen you will see a "red stamp" indicating this project as a Temporary Copy. Click on the adjacent button, Save a Permanent Copy, and the project will be saved in your main dashboard for use with future lessons. Once that is completed, navigate to the file explorer in the bottom right and click through to access the R script file: Course 7 -> Week 5 -> ggplot_hook.R

Once opened, you may follow along with the rest of the video to create an R Markdown (.rmd) file for sharing purposes.

Questions: Fill in the blank: Code added to a(n) _____ file is usually called a code chunk.

A. rmd

B. markdown

C. HTML

D. data

The correct answer is A. rmd. Explain: Code added to a .rmd file is usually called a code chunk.

Note: You may have noticed that the instructor had created an .html version from the R Markdown document for sharing purposes.

In order to generate a highly structured and quality R Markdown document, you may want to review the video lecture on Structure of markdown documents before moving to the next activity.

A data analyst writes in a code chunk and puts three backticks at the end of their code to mark the end of the data item. What are these backticks?

A. Delimiter

B. Inline code

C. YAML

D. Metadata

The correct answer is A. Delimiter. Explain: The delimiter is a character that indicates the beginning or end of a data item. In RMarkdown, three backticks first r and three backticks lasts can be used as delimiters for code chunks.