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.

advertisement

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.

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”.

advertisement

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.

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.

Sanfoundry Global Education & Learning Series – R Programming Language.

advertisement

Here’s the list of Best Reference 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.

advertisement
advertisement
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn