Introduction To R Programming

Name: _____________________

Date: _____________________

Instructions: Answer all questions. Write your answers clearly in the space provided.

Question 1:

They primary R system is available from the . . . . . . . .

A. CRAN
B. CRWO
C. GNU
D. CRDO
Answer: _________
Question 2:

What is the function used to test objects (returns a logical operator) if they are NaN?

A. as.nan()
B. is.na()
C. as.na()
D. is.nan()
Answer: _________
Question 3:

Dataframes can be converted into a matrix by calling the following function data . . . . . . . .

A. matr()
B. matrix()
C. matrixf()
D. matrixfunc()
Answer: _________
Question 4:

Advanced programmers can write . . . . . . . . code to manipulate R objects.

A. Python
B. Java
C. C
D. Java Script
Answer: _________
Question 5:

What will be the output of the following R code? y <- c(TRUE, 2)

A. [1] "TRUE" "2"
B. [1] "TRUE" 2
C. [1] "0" "2"
D. [1] 1 2
Answer: _________
Question 6:

Point out the WRONG statement?

A. Early versions of the S language contain functions for statistical modeling
B. The book Programming with Data by John Chambers documents S version of the language
C. In 1993 Bell Labs gave StatSci (later Insightful Corp.) an exclusive license to develop and sell the S language
D. The book Programming with Data by IBM documents S version of the language
E. : operator is used to create integer sequences
F. The numbers in the square brackets are part of the vector itself
G. There is a difference between the actual R object and the manner in which that R object is printed to the console
H. Files containing R scripts ends with extension .R
I. One nice feature that R shares with many popular open source projects is frequent releases
J. R has sophisticated graphics capabilities
K. S's base graphics system allows for very fine control over essentially every aspect of a plot or graph
L. All of the mentioned
M. Windows versions of R have other optional help system also
N. The help.search command (alternatively ??) allows searching for help in various ways
O. R is case insensitive as are most UNIX based packages, so A and a are different symbols and would refer to different variables
P. $ R is used to start the R program
Q. Setting up a workstation to take full advantage of the customizable features of R is a straightforward thing
R. q() is used to quit the R program
S. R has an inbuilt help facility similar to the man facility of UNIX
T. Windows versions of R have other optional help systems also
U. The grammar of the language determines whether an expression is complete or not
V. The <- symbol is the assignment operator in R
W. The ## character indicates a comment
X. R does not support multi-line comments or comment blocks
Y. Key feature of R was that its syntax is very similar to S
Z. R runs only on Windows computing platform and operating system
[. R has been reported to be running on modern tablets, phones, PDAs, and game consoles
\. R functionality is divided into a number of Packages
]. R is a language for data analysis and graphics
^. K is language for statistical modelling and graphics
_. One key limitation of the S language was that it was only available in a commercial package, S-PLUS
`. C is a language for data and graphics
Answer: _________
Question 7:

The most convenient way to use R is at a graphics workstation running a . . . . . . . . system.

A. windowing
B. running
C. interfacing
D. matrix
Answer: _________
Question 8:

If a command is not complete at the end of a line, R will give a different prompt, by default it is . . . . . . . .

A. *
B. -
C. +
D. /
Answer: _________
Question 9:

Which one of the following is not a basic datatype?

A. Numeric
B. Character
C. Data frame
D. Integer
Answer: _________
Question 10:

In which IDE we can interact with R?

A. R studio
B. Console
C. GCC
D. Power shell
Answer: _________
Question 11:

Which of the R following code is example of explicit printing?

A. > x <- 5 > x
B. > x <- 5 > print(x)
C. > x <- "auto" > x
D. > x <- "auto" > x <- "auto"
Answer: _________
Question 12:

What is the meaning of the following R function? x <- c(4, 5, 1, 2, 3, 3, 4, 4, 5, 6)
x <- as.factor(x)

A. x becomes a factor
B. x is a factor
C. x does not exist
D. x is not a vector
Answer: _________
Question 13:

R runs on the . . . . . . . . operating system.

A. Linux
B. Windows
C. Ubuntu
D. Any operating system
Answer: _________
Question 14:

There are more than . . . . . . . . packages on CRAN that have been developed by users and programmers around the world.

A. 40
B. 400
C. 4000
D. 40000
Answer: _________
Question 15:

Point out the wrong statement?

A. Early versions of the S language contain functions for statistical modeling
B. The book Programming with Data by John Chambers documents S version of the language
C. In 1993 Bell Labs gave StatSci (later Insightful Corp.) an exclusive license to develop and sell the S language
D. The book Programming with Data by IBM documents S version of the language
E. : operator is used to create integer sequences
F. The numbers in the square brackets are part of the vector itself
G. There is a difference between the actual R object and the manner in which that R object is printed to the console
H. Files containing R scripts ends with extension .R
I. One nice feature that R shares with many popular open source projects is frequent releases
J. R has sophisticated graphics capabilities
K. S's base graphics system allows for very fine control over essentially every aspect of a plot or graph
L. All of the mentioned
M. Windows versions of R have other optional help system also
N. The help.search command (alternatively ??) allows searching for help in various ways
O. R is case insensitive as are most UNIX based packages, so A and a are different symbols and would refer to different variables
P. $ R is used to start the R program
Q. Setting up a workstation to take full advantage of the customizable features of R is a straightforward thing
R. q() is used to quit the R program
S. R has an inbuilt help facility similar to the man facility of UNIX
T. Windows versions of R have other optional help systems also
U. The grammar of the language determines whether an expression is complete or not
V. The <- symbol is the assignment operator in R
W. The ## character indicates a comment
X. R does not support multi-line comments or comment blocks
Y. Key feature of R was that its syntax is very similar to S
Z. R runs only on Windows computing platform and operating system
[. R has been reported to be running on modern tablets, phones, PDAs, and game consoles
\. R functionality is divided into a number of Packages
]. R is a language for data analysis and graphics
^. K is language for statistical modelling and graphics
_. One key limitation of the S language was that it was only available in a commercial package, S-PLUS
`. C is a language for data and graphics
Answer: _________
Question 16:

Finally, in . . . . . . . . R version 1.0.0 was released to the public.

A. 2000
B. 2005
C. 2010
D. 2012
Answer: _________
Question 17:

A . . . . . . . . is a variable that holds one value at a time.

A. Scalar variable
B. Duplex
C. High
D. Vector
Answer: _________
Question 18:

Which of the following is not an object of R?

A. calls
B. expressions
C. strings
D. names
Answer: _________
Question 19:

Scripts will run on . . . . . . . .

A. Script Editors
B. Console
C. Terminal
D. GCC Compiler
Answer: _________
Question 20:

Why is it needed for R studio to update regularly?

A. Bugs
B. More Functions
C. Methods
D. For more packages
Answer: _________
Question 21:

R language is a dialect of which of the following languages?

A. S
B. C
C. MATLAB
D. SAS
Answer: _________
Question 22:

What is the meaning of "<-"?

A. Functions
B. Loops
C. Addition
D. Assignment
Answer: _________
Question 23:

Modification in Dundas BI is done . . . . . . . .

A. Directly
B. Indirectly
C. Need access to Server
D. Not known
Answer: _________
Question 24:

Which programming language is more based on the results?

A. R
B. C
C. C++
D. Java
Answer: _________
Question 25:

How could be the matrix constructed by using the following R code? m <- matrix(1:6, nrow = 2, ncol = 3)

A. row-wise
B. column-wise
C. any manner
D. data insufficient
Answer: _________
Question 26:

In which year R-Core group was formed?

A. 1993
B. 1996
C. 1997
D. 1998
Answer: _________
Question 27:

In . . . . . . . . Insightful purchased the S language from Lucent for $2 million.

A. 2002
B. 2003
C. 2004
D. 2005
Answer: _________
Question 28:

What will be the output of the following R function? cat("Everybody", "is", "a", “warrior”,sep="*")

A. "Everybody", "is", "a" , "warrior"
B. Everybody*is*a*warrior
C. Everybody", "is", "a" , "warrior
D. "Everybody*is*a*warrior"
Answer: _________
Question 29:

A list is represented as a vector but can contain objects of . . . . . . . .

A. Same class
B. Different class
C. Similar class
D. Any class
Answer: _________
Question 30:

Full Form of GUI is . . . . . . . .

A. Guided User Interface
B. Graphical User Interface
C. Guided Used Interface
D. Graphical User Interval
Answer: _________
Question 31:

What is the class defined in the following R code? y<-c(FALSE,2)

A. Character
B. Numeric
C. Logical
D. Integer
Answer: _________
Question 32:

Which of the following statement is alternative to . . . . . . . . ?solve

A. help(solve)
B. print(solve)
C. bind(solve)
D. matrix(solve)
Answer: _________
Question 33:

How can we define 'infinity' in R language?

A. Inf
B. Sup
C. Und
D. NaN
Answer: _________
Question 34:

The copyright for the primary source code for R is held by the . . . . . . . . Foundation.

A. A
B. S
C. C
D. R
Answer: _________
Question 35:

What is the output of getOption("defaultPackages") in R studio?

A. Installs a new package
B. Shows default packages in R
C. Error
D. Nothing will print
Answer: _________
Question 36:

R functionality is divided into a number of . . . . . . . .

A. Packages
B. Functions
C. Domains
D. Classes
Answer: _________
Question 37:

In order to use the R-related functionality in Dundas BI, you must have access to an existing . . . . . . . .

A. Console
B. Terminal
C. Packages
D. R server
Answer: _________
Question 38:

Command lines entered at the console are limited to about . . . . . . . . bytes.

A. 3000
B. 4095
C. 5000
D. 6000
Answer: _________
Question 39:

The R-help and . . . . . . . . mailing lists have been highly active for over a decade now.

A. R-mail
B. R-devel
C. R-dev
D. R-del
Answer: _________
Question 40:

R language has superficial similarity with . . . . . . . .

A. C
B. Python
C. MATLAB
D. SAS
Answer: _________
Question 41:

How many atomic vector types does R have?

A. 5
B. 6
C. 8
D. 10
Answer: _________
Question 42:

What is the length of b? b <- 2:7

A. 4
B. 5
C. 6
D. 0
Answer: _________
Question 43:

What will be the output of the following R function? d <- diag(5, nrow=2, ncol=2)
d

A. 5 xa0 xa0 1 0 xa0 xa0 5
B. 5 xa0 xa0 0 5 xa0 xa0 5
C. 5 xa0 xa0 0 15 xa0 xa0 5
D. 5 xa0 xa0 0 0 xa0 xa0 5
Answer: _________
Question 44:

The dimension attribute is itself an integer vector of length . . . . . . . .

A. 1
B. 2
C. 3
D. 4
Answer: _________
Question 45:

A single element of a character vector is referred as . . . . . . . .

A. Character string
B. String
C. Data strings
D. Raw data
Answer: _________
Question 46:

What will be the output of the following R program? r<-0:10
r[2]

A. 0
B. 1
C. 2
D. 3
Answer: _________
Question 47:

Which Package contains most fundamental functions to run R?

A. root
B. child
C. base
D. parent
Answer: _________
Question 48:

R is technically much closer to the Scheme language than it is to the original . . . . . . . . language.

A. B
B. C
C. C++
D. S
Answer: _________
Question 49:

What is NaN called?

A. Not a Number
B. Not a Numeric
C. Number and Number
D. Number a Numeric
Answer: _________
Question 50:

What is the primary purpose of R programming language?

A. Web Development
B. Data Analysis
C. Game Development
D. Mobile App Development
Answer: _________
Question 51:

In R, what does the function length() do?

A. Returns the sum of elements
B. Returns the number of elements
C. Sorts the elements
D. Computes the mean
Answer: _________
Question 52:

How is a comment denoted in R?

A. // Comment
B. /* Comment */
C. # Comment
D. -- Comment
Answer: _________
Question 53:

What does the function install.packages() do in R?

A. Load a package
B. Uninstall a package
C. Install a new package
D. Update all packages
Answer: _________
Question 54:

Which of the following is a correct variable name in R?

A. 123_variable
B. variable_name_123
C. my-variable
D. 1st_variable
Answer: _________
Question 55:

What does RStudio provide for R programming?

A. A programming language
B. An integrated development environment
C. A statistical model
D. A data storage format
Answer: _________
Question 56:

What is the purpose of the function Sys.Date() in R?

A. Display current date and time
B. Extract system information
C. Retrieve the current date
D. Convert date to character
Answer: _________
Question 57:

Which of the following is a valid R data type?

A. String
B. Boolean
C. Complex
D. All of the above
Answer: _________
Question 58:

How is a data frame created in R?

A. df <- c(1, 2, 3)
B. data.frame(x = 1:3, y = c('A', 'B', 'C'))
C. createDataFrame(1, 2, 3)
D. matrix(1:3, nrow = 1, ncol = 3)
Answer: _________
Question 59:

Which of the following is "Recommended" package in R?

A. util
B. lang
C. stats
D. spatial
Answer: _________
Question 60:

What is the class defined by the following R code? y<-c(2,”t”)

A. Character
B. Numeric
C. Logical
D. Integer
Answer: _________
Question 61:

What will be the output of the following R code? x <- c(3, 7, NA, 4, 7)
y <- c(5, NA, 1, 2, 2)
x + y

A. Symbol
B. Missing Data
C. 5
D. 15.5
Answer: _________
Question 62:

R is published under the . . . . . . . . General Public License version.

A. A
B. B
C. C
D. GNU
Answer: _________
Question 63:

In 2004, . . . . . . . . purchased the S language from Lucent for $2 million.

A. Insightful
B. Amazon
C. IBM
D. TCS
Answer: _________
Question 64:

What is the mode of 'a' in the following R code? a <- c(1,” a”, FALSE)

A. Numeric
B. Character
C. Integer
D. Logical
Answer: _________
Question 65:

. . . . . . . . provides a point-and-click interface to many basic statistic problems.

A. Commander
B. GUI
C. Console
D. Terminal
Answer: _________
Question 66:

What will be the output of the following R function? paste("Everybody", "is", “a” , "warrior")

A. "Everybody", "is", "a" , "warrior"
B. Everybody is a warrior
C. Everybody", "is", "a" , "warrior
D. "Everybody is a warrior"
Answer: _________
Question 67:

How to install for a package and all of the other packages on which for depends?

A. install.packages (for, depends = TRUE)
B. R.install.packages ("for", depends = TRUE)
C. install.packages ("for", depends = TRUE)
D. install ("for", depends = FALSE)
Answer: _________
Question 68:

. . . . . . . . function is used to watch for all available packages in library.

A. lib()
B. fun.lib()
C. libr()
D. library()
Answer: _________
Question 69:

Is It possible to inspect the source code of R?

A. Yes
B. No
C. Can't say
D. Some times
Answer: _________
Question 70:

Which of the following packages does not contain in "base" R system?

A. utils, graphics
B. mesh, compiler
C. splines, stats4
D. grDevices, datasets
Answer: _________
Question 71:

In the expression x <- 4 in R, what is the class of 'x' as determined by the `class()' function?

A. Character
B. Numeric
C. Integer
D. Word
Answer: _________
Question 72:

Functionality of R is divided into a number of . . . . . . . .

A. Functions
B. Domains
C. Packages
D. Files
Answer: _________
Question 73:

What will be the output of the following R code? x <- (“a”, “b”)
as.logical(x)

A. a b
B. "a" "b"
C. 1 1
D. Error
Answer: _________
Question 74:

What is the mode of b in the following R code? b <- c(TRUE, TRUE, 1)

A. Numeric
B. Character
C. Integer
D. Logical
Answer: _________
Question 75:

Which of the following command is used to print an object "x" in R?

A. printf(x)
B. print(x)
C. printx
D. print[x]
Answer: _________
Question 76:

What will be the output of the following R code? a <- (“a” , “b”)
mode(a)

A. Character
B. Numeric
C. Complex
D. Integer
Answer: _________
Question 77:

If commands are stored in an external file, say commands.R in the working directory work, they may be executed at any time in an R session with the command . . . . . . . .

A. source("commands.R")
B. exec("commands.R")
C. execute("commands.R")
D. exect("command.R")
Answer: _________
Question 78:

Which of the following will start the R program?

A. $ R
B. > R
C. * R
D. @ R
Answer: _________
Question 79:

What will be the output of the following R function? nchar()

A. no. of characters
B. first 5 characters
C. last 5 characters
D. Does not exist
Answer: _________
Question 80:

What is the meaning of the following R function? print( sqrt(2) )

A. 1.414314
B. 1.414214
C. Error
D. 14.1414
Answer: _________
Question 81:

What is the function to set row names for a data frame?

A. row.names()
B. colnames()
C. col.names()
D. column name cannot be set for a data frame
Answer: _________
Question 82:

R is mostly used in . . . . . . . .

A. Problem solving
B. Statistics
C. Probability
D. All of the mentioned
Answer: _________
Question 83:

What will be the output of the following R function? ab <- list(1, 2, 3, "X", "Y", "Z")
dim(ab) <- c(3,2)
print(ab)

A. 1 xa0 "X" 2 xa0 "Y" 3 xa0 " Z"
B. 1 xa0 "X" 2 xa0 "Y" 3 xa0 " Y"
C. 1 xa0 "W" 2 xa0 "Y" 3 xa0 " Z"
D. Error
Answer: _________
Question 84:

. . . . . . . . programming language is a dialect of S.

A. B
B. C
C. R
D. K
Answer: _________
Question 85:

. . . . . . . . text editor provides more general support mechanisms via ESS for working interactively with R.

A. EAC
B. Emacs
C. Shell
D. ECAP
Answer: _________
Question 86:

Which of the following is a base package for R language?

A. util
B. lang
C. tools
D. spatial
Answer: _________
Question 87:

What is the function to set column names for a matrix?

A. names()
B. colnames()
C. col.names()
D. column name cannot be set for a matrix
Answer: _________
Question 88:

What will be the output of the following R code? x<- c (“a”,” b”)
as.numeric(x)

A. [1] 1 2
B. [1] TRUE TRUE
C. [1] NA NA (Warning message: NAs introduced by coercion)
D. [1] NAN
Answer: _________
Question 89:

Files containing R scripts ends with extension . . . . . . . .

A. .S
B. .R
C. .Rp
D. .SP
Answer: _________
Question 90:

R has many functions regarding . . . . . . . .

A. Statistics, Biotechnology
B. Probability, Microbiology
C. Distributions, Physics
D. Statistics, Probability, Distributions
Answer: _________
Question 91:

In R language, a vector is defined that it can only contain objects of the . . . . . . . .

A. Same class
B. Different class
C. Similar class
D. Any class
Answer: _________
Question 92:

Which of the following can be used to display the names of (most of) the objects which are currently stored within R?

A. object()
B. objects()
C. list()
D. class()
Answer: _________
Question 93:

Which language is best for the statistical environment?

A. C
B. R
C. Java
D. Python
Answer: _________
Question 94:

What will be the output of the following R function? Sys.Date()

A. Tomorrow date
B. Present date
C. Some date
D. Yesterday date
Answer: _________
Question 95:

In 1991, R was created by Ross Ihaka and Robert Gentleman in the Department of Statistics at the University of . . . . . . . .

A. John Hopkins
B. California
C. Harvard
D. Auckland
Answer: _________
Question 96:

What will be the output of the following R function? d <- date()
d

A. Prints todays date
B. Prints some date
C. Prints exact present time and date
D. Error
Answer: _________
Question 97:

What will be the output of the following R code? options(digits = 16)
20/6

A. 3.33
B. 3.333
C. 3.3333333
D. 3.3333333333333333
Answer: _________
Question 98:

Elementary commands in R consist of either . . . . . . . . or assignments.

A. utilstats
B. language
C. expressions
D. packages
Answer: _________
Question 99:

What will be the output of the following R code? > x <- 1
> print(x)

A. 1
B. 2
C. 3
D. 5
Answer: _________
Question 100:

Collection of objects currently stored in R is called as . . . . . . . .

A. package
B. workspace
C. list
D. task
Answer: _________
Question 101:

You can download "base" R system from . . . . . . . .

A. A
B. B
C. CRAN
D. D
Answer: _________
Question 102:

Matrices can be created by row-binding with the help of the following function.

A. rjoin()
B. rbind()
C. rowbind()
D. rbinding()
Answer: _________
Question 103:

If the code is stored in the external file, which of the following function is used to call them to a working directory?

A. exec()
B. source()
C. execute()
D. sourcefile()
Answer: _________
Question 104:

Which function is used to automatically vectorize?

A. lapply()
B. kapply()
C. mapply()
D. happly()
Answer: _________
Question 105:

How can we define 'undefined value' in R language?

A. Inf
B. Sup
C. Und
D. NaN
Answer: _________
Question 106:

What is the function used to test objects (returns a logical operator) if they are NA?

A. is.na()
B. is.nan()
C. as.na()
D. as.nan()
Answer: _________
Question 107:

Which is simpler for statistical programming?

A. C
B. Java
C. R
D. No language
Answer: _________
Question 108:

The longer programs are called . . . . . . . .

A. Files
B. Structures
C. Scripts
D. Data
Answer: _________
Question 109:

The primary source code copyright for R is held by the . . . . . . . .

A. R Foundation
B. S Foundation
C. R and S foundation
D. C Foundation
Answer: _________
Question 110:

Which of the following is default prompt for UNIX environment?

A. >
B. >>
C. <
D. <<
Answer: _________
Question 111:

The open source . . . . . . . . software is available for Unix, Linux, and Windows platforms.

A. Rserve
B. BServe
C. CServe
D. Dserve
Answer: _________
Question 112:

What is output of getOption("defaultPackages") in R studio?

A. Installs a new package
B. Shows default packages in R
C. Error
D. Nothing will print
Answer: _________
Question 113:

. . . . . . . . will divert all subsequent output from the console to an external file.

A. sink
B. div
C. exp
D. exc
Answer: _________
Question 114:

Which of the following is used for Statistical analysis in R language?

A. RStudio
B. Studio
C. Heck
D. KStudio
Answer: _________
Question 115:

Which of the following is a "Recommended" package in R?

A. Util
B. Lang
C. Stats
D. Spatial
Answer: _________
Question 116:

The entities that R creates and manipulates are known as . . . . . . . .

A. objects
B. task
C. container
D. packages
Answer: _________
Question 117:

Which of the following describes R language?

A. Free
B. Paid
C. Available for free trial only
D. Testing
Answer: _________
Question 118:

How is a list created in R?

A. list(a = 1, b = "hello", c = TRUE)
B. c(1, "hello", TRUE)
C. data.frame(a = 1, b = "hello", c = TRUE)
D. matrix(c(1, "hello", TRUE), nrow = 1)
Answer: _________
Question 119:

What does the R function median() compute?

A. Median of a numeric vector
B. Mean of a numeric vector
C. Standard deviation of a numeric vector
D. Sum of a numeric vector
Answer: _________
Question 120:

How do you install a package in R from the CRAN repository using the install.packages() function?

A. install.packages("package_name")
B. install.package("package_name")
C. install_cran_package("package_name")
D. add.package("package_name")
Answer: _________
Question 121:

In R, how do you access the help documentation for a specific function, e.g., mean()?

A. help(mean)
B. ?mean
C. info(mean)
D. get.help(mean)
Answer: _________
Question 122:

What does the lengths() function do in R?

A. Returns the number of elements in each list element
B. Computes the lengths of strings in a character vector
C. Calculates the length of a numeric vector
D. Counts the number of elements in a list
Answer: _________
Question 123:

How is a character string defined in R?

A. "Hello, World!"
B. 'Hello, World!'
C. c("Hello", "World")
D. char("Hello, World!")
Answer: _________
Question 124:

What does the R function table() do?

A. Creates a contingency table
B. Displays the first few rows of a data frame
C. Produces a summary of data
D. Sorts a vector
Answer: _________
Question 125:

How is the data frame column Age selected in R?

A. data$Age
B. data[,"Age"]
C. data[["Age"]]
D. data.column("Age")
Answer: _________
Question 126:

What is the purpose of the search() function in R?

A. Displays the search path for loaded packages
B. Searches for a file in the working directory
C. Searches for a keyword in the help
D. Displays the search history
Answer: _________
Question 127:

In R, how is the mean of a numeric vector calculated using the mean() function?

A. mean(vector)
B. calculate.mean(vector)
C. vector.mean(vector)
D. avg(vector)
Answer: _________
Question 128:

What does the R function read.csv() do?

A. Print the CSV file
B. Read data from a CSV file
C. Create a CSV file
D. Convert data to CSV format
Answer: _________
Question 129:

How do you assign a value to a variable in R?

A. var = 10
B. assign(10, var)
C. var <- 10
D. set var = 10
Answer: _________
Question 130:

Which of the following operators is used for exponentiation in R?

A. **
B. ^
C. //
D. %^%
Answer: _________
Question 131:

In R, what does the function help.start() do?

A. Open R documentation
B. Display a help menu
C. Start an interactive help system
D. Load help files into memory
Answer: _________
Question 132:

What does the function summary() do in R?

A. Display a summary of data
B. Print the source code of a function
C. Generate a random sample
D. Provide a summary statistics
Answer: _________
Question 133:

What does the R function seq(1, 10, by = 2) produce?

A. 1, 3, 5, 7, 9
B. 1, 2, 3, 4, 5
C. 1, 4, 7, 10
D. 2, 4, 6, 8, 10
Answer: _________
Question 134:

How do you check the class of an object in R?

A. class(object)
B. type(object)
C. typeof(object)
D. obj_class(object)
Answer: _________
Question 135:

What is the purpose of the R function rnorm(100, mean = 0, sd = 1)?

A. Generate 100 random numbers from a normal distribution with mean 0 and SD 1
B. Generate a sequence from 1 to 100 with mean 0 and SD 1
C. Create a normal distribution plot
D. Compute the cumulative distribution function
Answer: _________
Question 136:

Which operator is used for element-wise multiplication in R?

A. *
B. %*%
C. %%%
D. %^%
Answer: _________
Question 137:

In R, what is the purpose of the rep() function?

A. Repeat elements of a vector or a sequence
B. Replace elements in a vector
C. Resize a data frame
D. Represent a sequence
Answer: _________
Question 138:

What will be the output of the following R function? Sys.time()

A. Tomorrow date and time
B. Present date and time
C. Some date
D. Yesterday date and time
Answer: _________
Question 139:

Version of R released to the public in 2000 was . . . . . . . .

A. 1.0.0
B. 1.0.3
C. 2.0.1
D. 1.1.0
Answer: _________
Question 140:

At higher level one "limitation" of R is that its functionality is based on . . . . . . . .

A. Consumer demand
B. User contributions
C. User contributions and Consumer demand
D. Lower level contributions
Answer: _________
Question 141:

What will be the output of the following R program? y <- 0:5
vector(y)
y[3]

A. Error in vector(y): invalid 'mode' argument
B. 1
C. 4
D. 3
Answer: _________
Question 142:

. . . . . . . . hosts many add-on packages that can be used to extend the functionality of R.

A. CRAN
B. GNU
C. R studio
D. 450
Answer: _________
Question 143:

What are the typeof(x) and mode(x) in the following R syntax? x<-1:3

A. Numeric, Integer
B. Integer, Numeric
C. Integer, Integer
D. Numeric, Numeric
Answer: _________
Question 144:

R files has an extension . . . . . . . .

A. .R
B. .S
C. .Rp
D. .c
Answer: _________
Question 145:

How do you create an integer suppose 5 in R?

A. 5L
B. 5l
C. 5i
D. 5d
Answer: _________
Question 146:

Why learning R becomes tough?

A. Special files
B. Functions
C. Packages
D. Special Cases
Answer: _________
Question 147:

Advanced users can write . . . . . . . . code to manipulate R objects directly.

A. C, C++
B. C++, Java
C. Java, C
D. Java
Answer: _________
Question 148:

Which of the following operator is used to create integer sequences?

A. :
B.
C. ~
Answer: _________
Question 149:

In R, how is a matrix created using the matrix() function?

A. matrix(1:9, nrow = 3, ncol = 3)
B. create.matrix(1:9, rows = 3, columns = 3)
C. [1, 2, 3 4, 5, 6 7, 8, 9]
D. mat(1:9, 3, 3)
Answer: _________

Answer Key

1: A
2: D
3: B
4: C
5: D
6: A, F, K, O, R, W, Z, ^
7: A
8: C
9: C
10: A
11: B
12: A
13: D
14: C
15: A, F, K, O, R, W, Z, ^
16: A
17: A
18: C
19: A
20: A
21: A
22: D
23: A
24: A
25: B
26: C
27: C
28: B
29: B
30: B
31: B
32: A
33: A
34: D
35: B
36: A
37: D
38: B
39: B
40: A
41: B
42: C
43: D
44: B
45: A
46: B
47: C
48: D
49: A
50: B
51: B
52: C
53: C
54: B
55: B
56: C
57: D
58: B
59: D
60: A
61: B
62: D
63: A
64: B
65: A
66: D
67: C
68: D
69: A
70: B
71: B
72: A
73: D
74: A
75: B
76: A
77: A
78: A
79: A
80: B
81: A
82: D
83: A
84: C
85: B
86: C
87: B
88: C
89: B
90: D
91: A
92: B
93: B
94: B
95: D
96: C
97: D
98: C
99: A
100: B
101: C
102: B
103: B
104: C
105: D
106: A
107: C
108: C
109: A
110: A
111: A
112: B
113: A
114: A
115: D
116: A
117: A
118: A
119: A
120: A
121: B
122: A
123: A
124: A
125: B
126: A
127: A
128: B
129: C
130: B
131: C
132: A
133: A
134: A
135: A
136: A
137: A
138: B
139: A
140: C
141: A
142: A
143: B
144: A
145: A
146: D
147: A
148: A
149: A