R Programming Questions and Answers – Functions – 4

«
»

This set of R Programming Language Multiple Choice Questions & Answers (MCQs) focuses on “Functions – 4”.

1. Which package can be integrated with dplyr for large fast tables?
a) Table
b) Data, dplyr
c) Data.table
d) Dplyr.table
View Answer

Answer: c
Explanation: Data.table package can be integrated with dplyr for large fast tables. dplyr package is used to speed up data frame management code. dplyr is a package for data manipulation, written and maintained regularly by Hadley Wickham.
advertisement

2. In the base graphics system, which function is used to add elements to a plot?
a) Boxplot()
b) Text()
c) Boxplot() or Text()
d) Treat()
View Answer

Answer: c
Explanation: In the base graphics system, boxplot or text function is used to add elements to a plot.

3. What are the different types of sorting algorithms available in R language?
a) Bubble
b) Selection
c) Merge
d) All sorts
View Answer

Answer: d
Explanation: Bucket Sort, Selection Sort, Quick Sort, Bubble Sort, Merge Sort is the different sorts available in R language. Each and Every sorting algorithm is available in R.
advertisement
advertisement

4. What is the command used to store R objects in a file?
a) save (x, file=”x.Rdata”)
b) save (x, file=x.Rdata)
c) save (x, file=”x.Rdata”);
d) save (x, file=”x.data”)
View Answer

Answer: a
Explanation: The function save() can be used to save one or more R objects to a specified file (in .RData or .rda type file formats). The function can be read back from the file using the function load(). Note that if you save your data with save(), it cannot be restored under a different name.

5. ___________ can be used for storing the data for long-term.
a) HDLS
b) HDFS
c) HDLSV
d) HSSLV
View Answer

Answer: b
Explanation: The Hadoop Distributed File System (HDFS) is the primary data storage system used in Hadoop applications. The Hadoop Distributed File System ( HDFS ) is a distributed file system designed for a run on commodity hardware.
advertisement

6. MapReduce jobs submitted from either Oozie, Pig or Hive can be used to encode, improve and sample the data sets from _________ into R.
a) HDLS
b) HDFS
c) HDLSV
d) HSSLV
View Answer

Answer: b
Explanation: MapReduce jobs submitted from either Oozie, Pig or Hive can be used for encode, improve and sample the data sets from HDFS into R. This helps to leverage complex analysis tasks with the subset of data prepared in R.

7. What will be the output of log (-5.8) when executed on R console?
a) NAN
b) NA
c) Error
d) 0.213
View Answer

Answer: a
Explanation: Executing the above on R console or terminal will display a warning sign that NaN (Not a Number) will be produced in R console because it is not possible to take a log of a negative number(-).
advertisement

8. How is a Data object represented internally in R language?
a) unclass (as.time (“2018-12-28″))
b) unclass (as.dat (“2018-12-28″))
c) unclass (as.D (2018-12-28))
d) unclass (as.Date (“2018-12-28″))
View Answer

Answer: d
Explanation: unclass returns (a copy of) its argument with its class information removed. Unclass with an object is to remove from a class or category.

9. Which package in R supports the exploratory analysis of genomic data?
a) Adegenat
b) Adegenet
c) Adegnet
d) Adezenet
View Answer

Answer: b
Explanation: Adegenet package in R supports the exploratory analysis of genomic data. R has a large number of in-built functions and the user can create their own functions. In R, a function is an object so the R interpreter is able to pass control to the function.
advertisement

10. __________ can contain heterogeneous inputs.
a) Matrix
b) Data Frames
c) Matrix and Data Frames
d) Does not exists
View Answer

Answer: b
Explanation: Data frame can contain heterogeneous inputs while a matrix cannot. In the matrix, only similar data types can be stored whereas in a data frame there can be different data types like characters, integers or other data frames.

Sanfoundry Global Education & Learning Series – R Programming Language.

Here’s the list of Best Reference Books in R Programming Language .

To practice all areas of R Programming Language, Here is complete set of 1000+ Multiple Choice Questions and Answers.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter