Which of the following R code will print "Hello, world!"?
Options are not available for this question.
Select an option to see the answer and solution.
What will be the output of the following R code snippet?
> f <- function(a, b) {
+ print(a)
+ print(b)
+ }
> f(45)Select an option to see the answer and solution.
The syntax of the repeat loop is . . . . . . . .
A. rep statement
B. repeat statement
C. repeat else
D. repeat while
Select an option to see the answer and solution.
In the base graphics system, which function is used to add elements to a plot?
A. Boxplot()
B. Text()
C. Boxplot() or Text()
D. Treat()
Select an option to see the answer and solution.
Which of the following R code generate a uniform random number?
Options are not available for this question.
Select an option to see the answer and solution.
Which function is used to select variables and observations from a given dataset?
A. Subset()
B. Sample()
C. While()
D. Signal()
Select an option to see the answer and solution.
Point out the correct statement?
A. The search list can be found by using the searchlist() function
B. The search list can be found by using the search() function
C. The global environment or the user's workspace is always the second element of the search list
D. R has separate namespaces for functions and non-functions
Select an option to see the answer and solution.
Point out the wrong statement?
A. Statements cannot be grouped together using braces '{' and '}'
B. Computation in R consists of sequentially evaluating statements
C. Single statements are evaluated when a new line is typed at the end of the syntactically complete statement
D. next is used to skip an iteration of a loop
Select an option to see the answer and solution.
What will be the output of the following R code?
> printmessage <- function(x) {
+ if(x > 0)
+ print("x is greater than zero")
+ else
+ print("x is less than or equal to zero")
+ invisible(x)
+ }
> printmessage(1)A. Error
B. Warning
C. Messages
D. 0
Select an option to see the answer and solution.
. . . . . . . . is an indication that a fatal problem has occurred and execution of the function stops.
A. message
B. error
C. warning
D. message & warning
Select an option to see the answer and solution.
What will be the output of the following R code snippet?
> lm <- function(x) { x * x }
> lmA. function(x) { x * x }
B. func(x) { x * x }
C. function(x) { x / x }
D. function { x $ x }
Select an option to see the answer and solution.
Write the syntax to set the path of the current working directory in R environment?
A. Setwd("dipath")
B. Setwd(dir_path)
C. Setwd("dir_path")
D. Set("dir_path")
Select an option to see the answer and solution.
Which of the following language supports lexical scoping?
A. Perl
B. Python
C. Common Lisp
D. All of the mentioned
Select an option to see the answer and solution.
What will be the value of following R expression?
A. Warning in log(c(-1, 2)): NaNs produced
B. Error in log(c(-1, 2)): NaNs produced
C. Message
D. All of the mentioned
Select an option to see the answer and solution.
What will be the output of the following R code?
> x <- 3
> switch(6, 2+2, mean(1:10), rnorm(5))Select an option to see the answer and solution.
Warnings are generated by the . . . . . . . . function.
A. warning()
B. error()
C. run()
D. message()
Select an option to see the answer and solution.
Point out the correct statement?
A. The traceback() function must be called immediately after an error occurs
B. The debugger calls the browser at the very low level of the function body
C. Every time you call the mod() function it will launch the interactive debugger
D. R provides only two tools to help you with debugging your code
Select an option to see the answer and solution.
Point out the correct statement?
A. Vectorizing the function can be accomplished easily with the Vectorize() function
B. There are different levels of indication that can be used, ranging from mere notification to fatal error
C. Vectorizing the function can be accomplished easily with the vector() function
D. Warnings are generated by the run() function
Select an option to see the answer and solution.
What will be the output of the following R code snippet?
> paste("a", "b", sep = ":")A. "a+b"
B. "a=b"
C. "a:b"
D. a*b
Select an option to see the answer and solution.
What will be the output of the following R code?
> mean(x)
Error in mean(x) : object 'x' not found
> traceback()Select an option to see the answer and solution.