Jawaharlal Nehru Technological University Hyderabad
Jawaharlal Nehru Technological University Hyderabad B.Tech IV R PROGRAMMING Previous Question Paper (July - 2021 - R16)
Answer any Five Questions. All Questions Carry Equal Marks.
Main
R functionality is divided into number of packages. Briefly discuss them.
Answer
R functionality is organized into a modular system of packages, which are collections of functions, data, and compiled code. These are categorized into three main groups:
- Base Packages: These are automatically loaded when R starts and provide the fundamental functionality, including core data manipulation, arithmetic, and basic graphics.
- Recommended Packages: These are included with the standard R distribution but must be loaded explicitly using the library() function. Examples include MASS and nlme.
- Contributed Packages: These are developed by the community and hosted on repositories like CRAN, Bioconductor, or GitHub. They extend R's capabilities for specialized tasks such as machine learning, web scraping, and advanced data visualization.
What are the limitations of R?
Answer
Despite its power, R has several notable limitations:
- Memory Management: R is an in-memory language, meaning it loads the entire dataset into RAM. This makes it difficult to process datasets that exceed the available system memory.
- Performance: Being an interpreted language, R is generally slower than compiled languages like C++ or Java for computationally intensive loops.
- Security: R lacks built-in security features, making it unsuitable for embedding in web applications without additional infrastructure.
- Inconsistent Syntax: Due to its evolution from the S language, R has some inconsistencies in function naming and argument ordering, which can be confusing for beginners.
Illustrate explicit coercion of R objects.
Answer
Sign in to view the complete answer paper.
How are complex numbers handled in R?
Answer
Sign in to view the complete answer paper.
Discuss the principal functions reading data into R and functions for writing data to files.
Answer
Sign in to view the complete answer paper.
Explain the scoping rules of variables.
Answer
Sign in to view the complete answer paper.
Compare and contrast matrices with vectors.
Answer
Sign in to view the complete answer paper.
Illustrate common vectorized operations.
Answer
Sign in to view the complete answer paper.
How to find runs of consecutive 1’s in binary data vector? Write code to find runs of length 2 in (1, 0, 0, 1, 1, 1, 0, 1, 1) and discuss the output.
Answer
Sign in to view the complete answer paper.
Illustrate selection function which on vectors.
Answer
Sign in to view the complete answer paper.
Discuss the applications of recursive lists.
Answer
Sign in to view the complete answer paper.
How to merge data frames? Explain with an example.
Answer
Sign in to view the complete answer paper.
Demonstrate the usage of aggregate and cut functions on tables and factors.
Answer
Sign in to view the complete answer paper.
Suppose we have n independent events, and the ith event has the probability pi of occurring. Write R code to find the probability of exactly one of these events occurring. [Read the input from the user into vector]
Answer
Sign in to view the complete answer paper.
“R is very much object oriented program in outlook.” Support or oppose this statement with proper justification.
Answer
Sign in to view the complete answer paper.
Implement a generic function on S3 class.
Answer
Sign in to view the complete answer paper.
Write suitable R code to perform statistical analysis on the following odor data in a chemical process:
| Odor | Temperature | Ratio | Height |
|---|---|---|---|
| 66 | -1 | -1 | 0 |
| 58 | -1 | 0 | -1 |
| 65 | 0 | -1 | -1 |
| -31 | 0 | 0 | 0 |
| 39 | 1 | -1 | 0 |
| 17 | 1 | 0 | -1 |
| 7 | 0 | 1 | -1 |
| -35 | 0 | 0 | 0 |
| 43 | -1 | 1 | 0 |
| -5 | -1 | 0 | 1 |
| 43 | 0 | -1 | 1 |
| -26 | 0 | 0 | 0 |
| 49 | 1 | 1 | 0 |
| -40 | 1 | 0 | 1 |
| -22 | 0 | 1 | 1 |
Answer
Sign in to view the complete answer paper.