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
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
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
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
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
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
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
Explanation: You’re going to be spending a lot of time in preprocessing and checking.
8. Which of the following statement gives sampling interval?
a) $sampling.interval
b) $sampling.time
c) $sampling.date
d) $sampling.datetime
View Answer
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
Explanation: C or Fortran code is not profiled.
Sanfoundry Global Education & Learning Series – R Programming Language.
Here’s the list of Best Books in R Programming Language.
If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]
- Check Information Technology Books
- Apply for Programming Internship
- Check R Programming Books
- Practice Programming MCQs