Logo

R Questions Set 25:

Quiz Mode

Files containing R scripts end with extension _____

1
2
3
4

Solution:

Extracts First element.

 

> x <- c("a", "b", "c", "c", "d", "a")

1
2
3

Solution:

Individual R objects can be saved to a file using the _____ function.

1
2
3
4

Solution:

 Which of the following is the only environment without a parent is the ________ environment. 

1
2
3
4

Solution:

What will be the output of the following R code?

paste("a", "b", sep = ":")

1
2
3
4

Solution:

Which of the following R functions finds the maximum value in the vector x, excluding missing values?

1
2
3
4

Solution:

Explain the output of the following.

 

> m <- 1:10
> m

1
2
3
4

Solution:

The system.time() function returns an object of class _______ which contains two useful bits of information.

1
2
3
4

Solution:

What will the following code return when executed?

rnorm(1)

1
2
3
4

Solution:

What will be the output of the following R code?

> printmessage <- function(x) {

if(is.na(x))
print("Error")

else if(x > 0)
print("x is greater than zero")

else
print("x is less than or equal to zero")

invisible(x)

}> printmessage(NA)

1
2
3
4

Solution: