InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
If I want to save a plot to a PDF file, which of the following is a correct way of doing that?(a) Construct the plot on the screen device and then copy it to a PDF file with dev.copy2pdf()(b) Construct the plot on the PNG device with png(), then copy it to a PDF with dev.copy2pdf()(c) Open the PostScript device with postscript(), construct the plot, then close the device with dev.off()(d) Open the screen device with quartz(), construct the plot, and then close the device with dev.off()I have been asked this question in a job interview.Question is from Exploratory Data Analysis topic in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct OPTION is (a) Construct the plot on the screen device and then copy it to a PDF file with dev.copy2pdf() |
|
| 2. |
____________ produces one-dimensional scatterplots.(a) xyplot(b) stripplot(c) barchart(d) bwplotThis question was addressed to me in semester exam.This intriguing question originated from Exploratory Data Analysis topic in chapter Profiling, Simulation and Data Analysis of R Programming |
|
Answer» RIGHT option is (B) stripplot Explanation: This function ALONG with other high-level Lattice functions, respond to a common SET of ARGUMENTS. |
|
| 3. |
Which of the following is a principle of analytic graphics?(a) Don’t plot more than two variables at at time(b) Make judicious use of color in your scatterplots(c) Show box plots (univariate summaries)(d) Show causality, mechanism, explanationI had been asked this question in a national level competition.My question comes from Exploratory Data Analysis topic in portion Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct OPTION is (d) SHOW CAUSALITY, mechanism, explanation |
|
| 4. |
Which of the following function works similar to separate()?(a) extract()(b) gather()(c) sep()(d) separate()I had been asked this question by my college director while I was bunking the class.Question is taken from Data Wrangling topic in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct answer is (a) EXTRACT() |
|
| 5. |
_________ describe the type of plot you will produce.(a) geoms(b) ggplot(c) fplot(d) gplotThis question was posed to me during an interview.Origin of the question is ggplot2 topic in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right choice is (a) geoms |
|
| 6. |
_________ extract a subset of rows from a data frame based on logical conditions.(a) rename(b) filter(c) set(d) subsetThis question was addressed to me in exam.Question is taken from Data Wrangling in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» The correct CHOICE is (a) RENAME |
|
| 7. |
Which of the following d takes two columns and spreads them into multiple columns?(a) ggmissplot(b) printplot(c) print.ggplot(d) ggplotI have been asked this question in final exam.My doubt stems from Data Wrangling in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct ANSWER is (C) print.ggplot |
|
| 8. |
Point out the correct statement?(a) gather() makes “long” data wider(b) tidyr is a reframing of reshape designed to accompany the tidy data framework(c) there are two fundamental verbs of data tidying(d) tidyr and dplyr packages do not make use of the pipe operatorI got this question by my school principal while I was bunking the class.Question is taken from Data Wrangling topic in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct answer is (c) there are TWO FUNDAMENTAL VERBS of data tidying |
|
| 9. |
__________ is interval represented by a vertical line, with a point in the middle.(a) geom_range(b) geom_pointrange(c) printplot(d) geom_contourI had been asked this question in an international level competition.My question is taken from ggplot2 topic in portion Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right choice is (b) geom_pointrange |
|
| 10. |
Logical flag is applicable to which of the following plots?(a) scatterplot(b) dotplot(c) xyplot(d) zyplotThe question was asked during an online exam.I need to ask this question from Exploratory Data Analysis topic in chapter Profiling, Simulation and Data Analysis of R Programming |
|
Answer» The CORRECT answer is (B) dotplot |
|
| 11. |
which of the following functions can be used to finely control the appearance of all lattice plots ?(a) par()(b) print.trellis()(c) splom()(d) trellis.par.set()I got this question at a job interview.Enquiry is from Exploratory Data Analysis topic in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct answer is (d) trellis.par.set() |
|
| 12. |
___________ is used to determine what is plotted for each group.(a) panel.expose(b) panel.impose(c) panel.superpose(d) panel.deposeI got this question in quiz.This intriguing question comes from Exploratory Data Analysis topic in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» The CORRECT option is (C) panel.superpose |
|
| 13. |
For barchart and _________ non-trivial methods exist for tables and arrays, documented at barchart.table.(a) scatterplot(b) dotplot(c) xyplot(d) scatterplot & xyplotI have been asked this question in semester exam.Asked question is from Exploratory Data Analysis topic in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» RIGHT answer is (B) dotplot Explanation: The numeric methods are equivalent to a call with no LEFT hand side and no conditioning variables in the FORMULA. |
|
| 14. |
__________ produces bivariate scatterplots or time-series plots.(a) xyplot(b) dotplot(c) barchart(d) bwplotThe question was asked by my school principal while I was bunking the class.I want to ask this question from Exploratory Data Analysis topic in portion Profiling, Simulation and Data Analysis of R Programming |
|
Answer» The CORRECT option is (a) xyplot |
|
| 15. |
__________uses regex groups instead of a splitting pattern or position.(a) spread()(b) gather()(c) separate()(d) extract()The question was asked by my school principal while I was bunking the class.My question is taken from Data Wrangling topic in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» The CORRECT option is (C) separate() |
|
| 16. |
Point out the correct statement?(a) Each row is an observation in tidy data(b) Each column is a variable in tidy data(c) Arranging your data in tidy way makes it easier to work(d) All of the mentionedThe question was asked during an interview.My question is taken from Data Wrangling in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right choice is (d) All of the mentioned |
|
| 17. |
Which of the following is an example of a valid graphics device in R?(a) A socket connection(b) A Microsoft Word document(c) A PDF file(d) A file folderI got this question during an internship interview.My question is taken from Exploratory Data Analysis in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct CHOICE is (c) A PDF file |
|
| 18. |
Which of the following draws nothing?(a) geom_blank(b) geom(c) geom_bin2d(d) geom_contourI had been asked this question in unit test.I would like to ask this question from ggplot2 in portion Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right ANSWER is (c) geom_bin2d |
|
| 19. |
Point out the correct statement?(a) is.theme reports whether x is a real object(b) is.object reports whether x is a aesthetic object(c) qplot is used for quick plot(d) ggplot describe the type of plot you will produceThis question was addressed to me in an online interview.I need to ask this question from ggplot2 in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct answer is (C) qplot is used for QUICK plot |
|
| 20. |
__________ is used when you have variables that form rows instead of columns.(a) tidy()(b) spread()(c) separate()(d) gather()I got this question at a job interview.My doubt stems from Data Wrangling in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right option is (b) spread() |
|
| 21. |
________ add new variables/columns or transform existing variables.(a) mutate(b) add(c) apped(d) arrangeThis question was addressed to me in an online interview.The question is from Data Wrangling topic in chapter Profiling, Simulation and Data Analysis of R Programming |
|
Answer» CORRECT option is (a) mutate Explanation: ARRANGE is used to REORDER rows of a data FRAME. |
|
| 22. |
What is a geom in the ggplot2 system?(a) a plotting object like point, line, or other shape(b) a method for making conditioning plots(c) a method for mapping data to attributes like color and size(d) a statistical transformationThe question was asked by my school teacher while I was bunking the class.The above asked question is from Exploratory Data Analysis topic in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» RIGHT OPTION is (a) a plotting object LIKE point, line, or other shape Easy explanation: The bar geom is used to produce 1d area PLOTS. |
|
| 23. |
Which of the following is an example of a vector graphics device in R?(a) JPEG(b) PNG(c) GIF(d) SVGI had been asked this question during a job interview.I want to ask this question from Exploratory Data Analysis in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» The correct OPTION is (d) SVG |
|
| 24. |
__________ produces box-and-whisker plots.(a) xyplot(b) dotplot(c) barchart(d) bwplotThe question was asked in an interview.Enquiry is from Exploratory Data Analysis in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right ANSWER is (d) bwplot |
|
| 25. |
Which of the following is true about the base plotting system?(a) Margins and spacings are adjusted automatically depending on the type of plot and the data(b) Plots are typically created with a single function call(c) Plots are created and annotated with separate functions(d) The system is most useful for conditioning plotsI had been asked this question in an international level competition.My query is from Exploratory Data Analysis topic in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right option is (c) Plots are created and annotated with separate functions |
|
| 26. |
Spread function is known as ___________ in spreadsheets.(a) pivot(b) unpivot(c) cast(d) orderI have been asked this question in final exam.I need to ask this question from Data Wrangling in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» CORRECT option is (B) UNPIVOT For explanation I would say: Spread is known by other names in other places: it’s cast in reshape2, unpivot in SPREADSHEETS and unfold in databases. |
|
| 27. |
Which of the following function takes multiple columns?(a) spread()(b) gather()(c) separate()(d) extract()The question was asked in an online quiz.My question is taken from Data Wrangling in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» CORRECT option is (b) gather() Easiest explanation: gather() gathers COLUMN into key-value pairs. |
|
| 28. |
How many functions exist for tidying the data?(a) one(b) two(c) three(d) fourThis question was posed to me in an international level competition.I want to ask this question from Data Wrangling topic in chapter Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct OPTION is (c) THREE |
|
| 29. |
Which of the following is complementary to tidyr?(a) geolr(b) dplyr(c) d3lr(d) gekl2The question was asked in an interview for job.This interesting question is from Data Wrangling topic in portion Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right OPTION is (b) dplyr |
|
| 30. |
Annotation of plots in any plotting system involves adding points, lines, or text to the plot, in addition to customizing axis labels or adding titles. Different plotting systems have different sets of functions for annotating plots in this way. Which of the following functions can be used to annotate the panels in a multi-panel lattice plot?(a) points()(b) panel.abline()(c) lines()(d) axis()This question was addressed to me during an internship interview.My question is from Exploratory Data Analysis topic in portion Profiling, Simulation and Data Analysis of R Programming |
|
Answer» CORRECT option is (B) panel.abline() The explanation: panel.abline() is ONE of the most USED panel function. |
|
| 31. |
Which of the following functions is typically used to add elements to a plot in the base graphics system?(a) lines()(b) hist()(c) plot()(d) boxplot()I got this question during a job interview.My doubt is from Exploratory Data Analysis topic in chapter Profiling, Simulation and Data Analysis of R Programming |
|
Answer» The CORRECT answer is (d) boxplot() |
|
| 32. |
What does the ‘pch’ option to par() control?(a) the size of the plotting symbol in a scatterplot(b) the line width in the base graphics system(c) the orientation of the axis labels on the plot(d) the plotting symbol/character in the base graphics systemThis question was addressed to me during an online exam.My doubt stems from Exploratory Data Analysis topic in chapter Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct answer is (d) the plotting symbol/character in the base GRAPHICS system |
|
| 33. |
What is ggplot2 an implementation of?(a) the Grammar of Graphics developed by Leland Wilkinson(b) 3D visualization system(c) the S language originally developed by Bell Labs(d) the base plotting system in RThe question was asked by my school principal while I was bunking the class.I need to ask this question from Exploratory Data Analysis in portion Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct OPTION is (a) the GRAMMAR of Graphics developed by Leland Wilkinson |
|
| 34. |
Which of the following merges two variables into one?(a) spread()(b) gather()(c) separate()(d) unite()This question was addressed to me in my homework.My doubt stems from Data Wrangling in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» The correct OPTION is (b) gather() |
|
| 35. |
How many functions exist for wrangling the data with dplyr package?(a) one(b) seven(c) three(d) fiveThe question was posed to me in an online quiz.My query is from Data Wrangling topic in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct choice is (b) seven |
|
| 36. |
Bitmapped file formats can be most useful for ____________(a) Plots that may need to be resized(b) Plots that require animation or interactivity(c) Plots that are not scaled to a specific resolution(d) Scatterplots with many many pointsThis question was posed to me in an online interview.This interesting question is from Exploratory Data Analysis in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» The correct ANSWER is (d) Scatterplots with MANY many points |
|
| 37. |
Which function opens the screen graphics device for the Mac?(a) bitmap()(b) quartz()(c) pdf()(d) png()The question was asked during an interview.This key question is from Exploratory Data Analysis in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct answer is (b) quartz() |
|
| 38. |
Which of the following create a set of identity mappings?(a) ggplot(b) aes_all(c) aes(d) ggorderI have been asked this question in an interview for internship.My question is from ggplot2 in portion Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right ANSWER is (d) ggorder |
|
| 39. |
Point out the correct statement?(a) tidyr and dplyr packages do not make use of the pipe operator(b) tidyr does less than reshape2(c) tidyr provides ability to string multiple functions together by incorporating %(d) tidyr does greater than reshape2The question was asked in unit test.My question is taken from Data Wrangling topic in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right answer is (B) tidyr does less than reshape2 |
|
| 40. |
What is the role of exploratory graphs in data analysis?(a) They are made for formal presentations(b) They are typically made very quickly(c) Axes, legends, and other details are clean and exactly detailed(d) They are used in place of formal modelingI had been asked this question by my college director while I was bunking the class.My question comes from Exploratory Data Analysis topic in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right ANSWER is (b) They are typically made very quickly |
|
| 41. |
Point out the correct statement?(a) gather() makes “wide” data longer(b) Two functions are present for tidy data(c) separate() makes “wide” data longer(d) spread() function takes multiple columnsThis question was posed to me in homework.Enquiry is from Data Wrangling in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» RIGHT option is (C) separate() MAKES “wide” DATA longer The explanation is: Other names for gather include melt (RESHAPE2), pivot (spreadsheets) and fold (databases). |
|
| 42. |
_________is new package that makes it easy to “tidy” your data.(a) tidy(b) tidyr(c) tidyneat(d) tidynrThis question was addressed to me in unit test.This question is from Data Wrangling topic in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct choice is (c) tidyneat |
|
| 43. |
______ display a smooth density estimate.(a) geom_density2(b) geom_density(c) aes_sdensity(d) geom_contourI had been asked this question in exam.My question is taken from ggplot2 in chapter Profiling, Simulation and Data Analysis of R Programming |
|
Answer» RIGHT OPTION is (b) geom_density The explanation: geom_density display a smooth DENSITY estimate. A smooth density estimate CALCULATED by stat_density. |
|
| 44. |
Point out the correct statement?(a) The Rprofiler() function starts the profiler in R(b) Using system.time() allows you to test certain functions or code blocks to see if they are taking excessive amounts of time(c) R must not be compiled with profiler support(d) Rprofiler() tabulates how much time is spent inside each functionThe question was asked during an internship interview.This interesting question is from R Profiler topic in portion Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right choice is (b) Using system.time() allows you to test certain functions or code blocks to see if they are TAKING excessive amounts of time |
|
| 45. |
The elapsed time may be ________ than the user time if your machine has multiple cores/processors.(a) smaller(b) greater(c) equal to(d) nullThe question was posed to me during an interview for a job.This key question is from R Profiler in chapter Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Correct ANSWER is (a) smaller |
|
| 46. |
Which of the following is a plot to investigate the order in which observations were recorded?(a) ggplot(b) ggsave(c) ggpcp(d) ggorderThe question was posed to me in an interview.I'd like to ask this question from ggplot2 in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» RIGHT choice is (d) ggorder The EXPLANATION is: ggsave SAVE a ggplot with sensible defaults. |
|
| 47. |
________ is used for relative sizing of theme elements.(a) rel(b) size(c) relative(d) timrintervalThis question was addressed to me in an online quiz.Query is from ggplot2 topic in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» The correct ANSWER is (a) rel |
|
| 48. |
______ generate aesthetic mappings from a string.(a) aes_all(b) aes_auto(c) aes_string(d) aes_positionI had been asked this question in an interview for internship.My question is based upon ggplot2 topic in division Profiling, Simulation and Data Analysis of R Programming |
|
Answer» The correct answer is (c) aes_string |
|
| 49. |
Point out the correct statement?(a) update_element update contents of a theme(b) Use theme_update_element to modify a small number of elements of the current theme or use theme_set to completely override it(c) theme_bw is theme with grey background and white gridlines(d) is.rel reports whether x is a theme objectI had been asked this question in examination.My doubt is from ggplot2 in section Profiling, Simulation and Data Analysis of R Programming |
|
Answer» Right option is (a) update_element update contents of a theme |
|
| 50. |
Which of the following is discrete state calculator?(a) discrete_scale(b) ggpcp(c) ggfluctuation(d) ggmissingThis question was addressed to me at a job interview.My question comes from ggplot2 in portion Profiling, Simulation and Data Analysis of R Programming |
|
Answer» CORRECT choice is (c) ggfluctuation For explanation I would say: ggpcp is used to create a PARALLEL COORDINATE PLOT. |
|