Question 1 Exploratory Data
AnalysisWhich of the following is a principle of analytic graphics?
According to six principles stated during the video Principles of Analytic Graphics:
- Principle 1: Show comparisons
- Principle 2: Show causality, mechanism, explanation
- Principle 3: Show multivariate data
- Principle 4: Integrate multiple modes of evidence
- Principle 5: Describe and document the evidence
- Principle 6: Content is king
What is the role of exploratory graphs in data analysis?
According to the Summary of Exploratory Graphs document.
- Exploratory plots are โquick and dirtyโ
- Let you summarize the data (usually graphically) and highlight any broad features
- Explore basic questions and hypotheses (and perhaps rule them out)
- Suggest modeling strategies for the โnext stepโ
Which of the following is true about the base plotting system?
According to the Summary of The Base Plotting System in R document.
- Plots in the base plotting system are created by calling successive R functions to โbuild upโ a plot
- Plotting occurs in two stages:
- Creation of a plot
- Annotation of a plot (adding lines, points, text, legends)
- The base plotting system is very flexible and offers a high degree of control over plotting
Which of the following is an example of a valid graphics device in R?
Based on slides 6 and 7 from Graphics Devices in R document.
- Vector formats:
svg,win.metafile, andpostscript, and;- Bitmap formats:
png,jpeg,tiff, andbmp.
Which of the following is an example of a vector graphics device in R?
Based on slide 6 from Graphics Devices in R document.
- Vector formats:
svg,win.metafile, andpostscript, and;
Bitmapped file formats can be most useful for
According to the Summary of Graphics Devices in R in R document.
- Plots must be created on a graphics device
- The default graphics device is almost always the screen device, which is most useful for exploratory analysis
- File devices are useful for creating plots that can be included in other documents or sent to other people
- For file devices, there are vector and bitmap formats
- Vector formats are good for line drawings and plots with solid colors using a modest number of points
- Bitmap formats are good for plots with a large number of points, natural scenes or webbased plots
Which of the following functions is typically used to add elements to a plot in the base graphics system?
Based on slide 13 from The Base Plotting System in R document.
- plot: make a scatterplot, or other type of plot depending on the class of the object being plotted
- lines: add lines to a plot, given a vector x values and a corresponding vector of y values (or a 2-
- column matrix); this function just connects the dots
- points: add points to a plot
- text: add text labels to a plot using specified x, y coordinates
- title: add annotations to x, y axis labels, title, subtitle, outer margin
- mtext: add arbitrary text to the margins (inner or outer) of the plot
- axis: adding axis ticks/labels
Which function opens the screen graphics device for the Mac?
Based on slide 2 from Graphics Devices in R document.
- A graphics device is something where you can make a plot appear
- A window on your computer (screen device)
- A PDF file (file device)
- A PNG or JPEG file (file device)
- A scalable vector graphics (SVG) file (file device)
- When you make a plot in R, it has to be โsentโ to a specific graphics device
- The most common place for a plot to be โsentโ is the screen device
- On a Mac the screen device is launched with the quartz()
- On Windows the screen device is launched with windows()
- On Unix/Linux the screen device is launched with x11()
What does the โpchโ option to par() control?
Based on slide 9 from The Base Plotting System in R document.
- pch: the plotting symbol (default is open circle)
- lty: the line type (default is solid line), can be dashed, dotted, etc.
- lwd: the line width, specified as an integer multiple
- col: the plotting color, specified as a number, string, or hex code; the colors() function gives
- you a vector of colors by name
- xlab: character string for the x-axis label
- ylab: character string for the y-axis label
If I want to save a plot to a PDF file, which of the following is a correct way of doing that?
Based on slide 9 from Graphics Devices in R document.
Copying a plot to another device can be useful because some plots require a lot of code and it can be a pain to type all that in again for a different device.
- dev.copy: copy a plot from one device to another
- dev.copy2pdf: specifically copy a plot to a PDF file