My Report

R Programming Practice Test 2


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. What will be the output of the following R code?

> x <- 0:6
> as.logical(x)

2. Why is it needed for R studio to update regularly?

3. What will be the output of the following R function?

cat("Everybody", "is", "a", “warrior”,sep="*")

4. Which of the following statement would print "0" "1" "2" "3" "4" "5" "6" for the following R code?

 > x <- 0:6 

5. What will be the output of the following R code?

x <- c("a", "b", "c")
> as.numeric(x)

6. _______ function returns a vector of the same size as x with the elements arranged in increasing order.

7. Point out the correct statement?

8. Which of the following is a valid assignment?

9. Find the following type of vector?

a <- c(1,2,5.3,6,-2,4)

10. What will be the output of the following R code?

 > m <- matrix(nrow = 2, ncol = 3)
 > dim(m)

 

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.