R Programming Questions and Answers – R Profiler – 2

This set of R Programming Questions for campus interviews focuses on “R Profiler – 2”.

1. The profiler can be turned off by passing _________ to Rprof().
a) 0
b) 1
c) 2
d) NULL
View Answer

Answer: d
Explanation: Rprof(NULL) is used to turn off the profiler.

2. Point out the correct statement?
a) Rprof() is used to turn off the profiler
b) At each line of the output, the profiler writes out the function call stack
c) The summaryprof() function tabulates the R profiler output
d) The Rprofiler() function starts the profiler in R
View Answer

Answer: b
Explanation: The Rprofiler() function starts the profiler in R.

3. How many methods exist for normalizing the data?
a) one
b) two
c) three
d) profiler
View Answer

Answer: b
Explanation: There are two methods for normalizing the data.

advertisement
advertisement

4. _______ divides the time spend in each function by the total run time
a) “by.sum”
b) “by.total”
c) “by.self”
d) “by.del”
View Answer

Answer: b
Explanation: “by.self” does the same as “by.total”.

5. Point out the correct statement?
a) “by.total” first subtracts out time spent in functions above the current function in the call stack
b) The summaryRprof() function calculates how much time is spend in which function
c) By default, the profiler samples the function call stack every 0.02 seconds
d) The Rprofiler() function starts the profiler in R
View Answer

Answer: c
Explanation: Output of by.self is more useful than by.total for interpreting the data.

Note: Join free Sanfoundry classes at Telegram or Youtube

6. Which of the following function actually fits the linear model?
a) lm.time()
b) lm.date()
c) lm.fit()
d) lm.interval()
View Answer

Answer: c
Explanation: lm() function does a bit of pre-processing and checking before it actually fits the model.

7. The final bit of output that summaryRprof() provides is the ______ interval and the total runtime.
a) response
b) sampling
c) processing
d) retrieve
View Answer

Answer: b
Explanation: You’re going to be spending a lot of time in preprocessing and checking.

advertisement

8. Which of the following statement gives sampling interval?
a) $sampling.interval
b) $sampling.time
c) $sampling.date
d) $sampling.datetime
View Answer

Answer: b
Explanation: Sampling time is expressed in secs.

9. Which of the following code is not profiled?
a) C
b) C++
c) Java
d) PHP
View Answer

Answer: a
Explanation: C or Fortran code is not profiled.
advertisement

Sanfoundry Global Education & Learning Series – R Programming Language.

Here’s the list of Best Books in R Programming Language.

To practice all areas of R Programming for campus interviews, Here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.