Explore topic-wise MCQs in R Programming.

This section includes 36 Mcqs, each offering curated multiple-choice questions to sharpen your R Programming knowledge and support exam preparation. Choose a topic below to get started.

1.

___________ remove all the variables from the workspace.

A. rm(x)
B. rm(list=ls())
C. ls()
D. attach(mat)
Answer» C. ls()
2.

_____ list the variables in the workspace.

A. rm(x)
B. rm(list=ls())
C. ls()
D. attach(mat)
Answer» D. attach(mat)
3.

Which of the following is Mac menu command?

A. browse.workspace
B. browse.works
C. browser.workspace
D. a statistical transformation
Answer» B. browse.works
4.

Which of the following sort a dataframe by the order of the elements in B?

A. x[rev(order(x$B)),]
B. x[ordersort(x$B),]
C. x[order(x$B),]
D. x[rev(x$B),]
Answer» B. x[ordersort(x$B),]
5.

Which of the following statement is another way to get a subset?

A. subsetcon(dataset,logical)
B. data.df[data.df=logical]
C. sub(dataset,logical)
D. subcon(dataset,logical)
Answer» C. sub(dataset,logical)
6.

which of the following statement chose those objects meeting a logical criterion?

A. sub(dataset,logical)
B. subset(dataset,logical)
C. subsetcon(dataset,logical)
D. subcon(dataset,logical)
Answer» C. subsetcon(dataset,logical)
7.

Which of the following statement read a tab or space delimited file?

A. read.table(filename,header=TRUE)
B. read.CSV(filename,header=TRUE)
C. read.table(filename,header=FALSE)
D. read.tableall(filename,header=TRUE)
Answer» B. read.CSV(filename,header=TRUE)
8.

Which of the following statement can read csv files?

A. read.table(filename,header=TRUE,sep=’,’)
B. read.csv(filename,header=TRUE,sep=’,’)
C. read.tab(filename,header=TRUE,sep=’,’)
D. read.tab(filename,header=False,sep=’,’)
Answer» B. read.csv(filename,header=TRUE,sep=’,’)
9.

Which of the following code create a n item vector of random normal deviates?

A. x1 <- c(snorm(n))
B. x1 <- c(pnorm(n))
C. x1 <- c(rnorm(n))
D. x1 >- c(norm(n))
Answer» D. x1 >- c(norm(n))
10.

Which of the following code create n samples of size “size” with probability prob from the binomial?

A. z <- rinom(n,size,prob)b) z <- rbinom(n,size,prob)c) z <- binom(n,size,prob)d) z >- nom(n,size,pro
B. z <- rbinom(n,size,prob)
C. z <- binom(n,size,prob)
D. z >- nom(n,size,prob)
Answer» C. z <- binom(n,size,prob)
11.

Which command is used for displaying date in the format dd/mm/yyyy ?

A. date +%m
B. date +%h
C. date +”%d/%m/%Y”
D. date +”%h %m”
Answer» D. date +”%h %m”
12.

What are meta-characters?

A. special characters having predefined meaning to the shell
B. special symbols
C. shell symbols
D. command symbols
Answer» B. special symbols
13.

What is the output of who command?

A. display information about users who are currently logged in.
B. display file hierarchy
C. display administrator information
D. display processes
Answer» B. display file hierarchy
14.

Which command is used for displaying date and calendar in UNIX?

A. date and cal
B. DATE and CAL
C. date and calendar
D. dt and cl
Answer» B. DATE and CAL
15.

What are Commands?

A. specific instructions for performing a particular task
B. part of the operating system
C. part of the shell
D. special instructions
Answer» B. part of the operating system
16.

____________REMOVE_ALL_THE_VARIABLES_FROM_THE_WORKSPACE?$

A. rm(x)
B. rm(list=ls())
C. ls()
D. attach(mat)
Answer» C. ls()
17.

WHICH_COMMAND_IS_USED_FOR_DISPLAYING_DATE_AND_CALENDAR_IN_UNIX??$

A. date and cal
B. DATE and CAL
C. date and calendar
D. dt and cl
Answer» B. DATE and CAL
18.

What are meta-characters?$

A. special characters having predefined meaning to the shell
B. special symbols
C. shell symbols
D. command symbols
Answer» B. special symbols
19.

What_is_the_output_of_who_command?$

A. display information about users who are currently logged in.
B. display file hierarchy
C. display administrator information
D. display processes
Answer» B. display file hierarchy
20.

Which_command_is_used_for_displaying_date_in_the_format_dd/mm/yyyy_?

A. date +%m
B. date +%h
C. date +”%d/%m/%Y”
D. date +”%h %m”
Answer» D. date +‚Äö√Ñ√∂‚àö√ë‚àöœÄ%h %m‚Äö√Ñ√∂‚àö√ë‚àöœÄ
21.

_____ list the variables in the workspac?

A. rm(x)
B. rm(list=ls())
C. ls()
D. attach(mat)
Answer» D. attach(mat)
22.

Which command is used to display the documentation of commands in UNIX?

A. help
B. search
C. whatis
D. man
Answer» E.
23.

Which of the following is Mac menu command ?

A. browse.workspace
B. browse.works
C. browser.workspace
D. a statistical transformation
Answer» B. browse.works
24.

How can we specify more than one command in the command line at the same time?

A. using ;
B. using >
C. using ==
D. not possible
Answer» B. using >
25.

Which of the following sort a dataframe by the order of the elements in B

A. x[rev(order(x$B)),].
B. x[ordersort(x$B),].
C. x[order(x$B),].
D. all of the mentioned
Answer» B. x[ordersort(x$B),].
26.

Which of the following is not a valid option of uname?

A. -a
B. -s
C. -v
D. -z
Answer» E.
27.

Which of the following statement is another way to get a subset ?

A. subsetcon(dataset,logical)
B. data.df[data.df=logical].
C. sub(dataset,logical)
D. none of the mentioned
Answer» C. sub(dataset,logical)
28.

Options are also arguments but begin with a -.

A. True
B. False
Answer» B. False
29.

which of the following statement chose those objects meeting a logical criterion ?

A. sub(dataset,logical)
B. subset(dataset,logical)
C. subsetcon(dataset,logical)
D. none of the mentioned
Answer» C. subsetcon(dataset,logical)
30.

The sequences of directories that a shell searches while looking for a command is specified in the PATH variable.

A. True
B. False
Answer» B. False
31.

Which of the following statement read a tab or space delimited file ?

A. read.table(filename,header=TRUE)
B. read.CSV(filename,header=TRUE)
C. read.table(filename,header=FALSE)
D. read.tableall(filename,header=TRUE)
Answer» B. read.CSV(filename,header=TRUE)
32.

Which command is used for extracting the details of the operating system?

A. cd
B. echo
C. uname
D. wc
Answer» D. wc
33.

Which of the following statement can read csv files ?

A. read.table(filename,header=TRUE,sep=’,’)
B. read.csv(filename,header=TRUE,sep=’,’)
C. read.tab(filename,header=TRUE,sep=’,’)
D. none of the mentioned
Answer» B. read.csv(filename,header=TRUE,sep=‚Äö√Ñ√∂‚àö√ë‚àö¬•,‚Äö√Ñ√∂‚àö√ë‚àö¬•)
34.

In how many categories, commands of UNIX operating system classified?

A. 1
B. 2
C. Many
D. 0
Answer» C. Many
35.

Which of the following code create a n item vector of random normal deviates ?

A. x1 <- c(snorm(n))
B. x1 <- c(pnorm(n))
C. x1 <- c(rnorm(n))
D. all of the mentioned
Answer» D. all of the mentioned
36.

Which of the following code create n samples of size “size” with probability prob from the binomial ?

A. z <- rinom(n,size,prob)
B. z <- rbinom(n,size,prob)
C. z <- binom(n,size,prob)
D. all of the mentioned
Answer» C. z <- binom(n,size,prob)