R Language MCQs 2 September 10, 2019 | No Comments This quiz “MCQs R Language” will help you to check your ability to execute some basic operations on objects in the R language, and it will also help you to understand some basic concepts. This quiz may also improve your computational understanding. 1. Suppose I have a list defined as x <- list(2, “a”, “b”, TRUE). What does x[] give me? A list containing a character vector with the elements “a” and “b”. A character vector of length 1. A character vector with the elements “a” and “b”. A list containing the number 2 and the letter “a”. 2. A key property of vectors in R language is that A vector cannot have attributes like dimensions Elements of a vector can only be a character or numeric Elements of a vector all must be of the same class Elements of a vector can be of different classes 3. The R language is a dialect of which of the following programming languages? C Matlab and Mathematica S Lisp SAS 4. If I have two vectors x <- c(1,3, 5) and y <- c(3, 2, 10), what is produced by the expression rbind(x, y)? A 2 by 3 matrix A vector of length 3 A vector of length 2 A 2 by 2 matrix 5. What function is used to test the missing observation in data frame missing( ) NA.miss( ) na( ) is.na( ) 6. In R language the following are all atomic data types EXCEPT Logical Data frame Character Integer 7. _________ is function in R to get number of observation in a data frame n( ) ncol( ) nobs( ) nrow( ) 8. What is the class of the object defined by the expression x <- c(4, “a”, TRUE)? Character Numeric Logical Integer 9. If I execute the expression x <- 4 in R language, what is the class of the object “x” as determined by the “class()” function? Integer Complex Numeric Real 10. Suppose I have a vector x <- c(3, 5, 1, 10, 12, 6) and I want to set all elements of this vector that are less than 6 to be equal to zero. What R code achieves this? x[x == 6] x[x x[x x[x == 0] 11. The definition of free software consists of four freedoms (freedoms 0 through 3). Which of the following is NOT one of the freedoms that are part of the definition? The freedom to improve the program, and release your improvements to the public, so that the whole community benefits. The freedom to study how the program works, and adapt it to your needs. The freedom to run the program, for any purpose. The freedom to sell the software for any price. 12. Suppose I have a vector x <- 1:4 and y <- 2:3. What is produced by the expression x + y? A numeric vector with the values 1, 2, 5, 7. A numeric vector with the values 3, 5, 3, 4. An error. An integer vector with the values 3, 5, 5, 7. Loading … For More R Quiz, Visit R Language MCQs 1 Share this:TwitterFacebookLinkedInSkypeTumblrPinterestPrintWhatsAppTelegramRedditPocketLike this:Like Loading... Related R Language Quiz
You must log in to post a comment.