Jawaharlal Nehru Technological University Hyderabad
Jawaharlal Nehru Technological University Hyderabad B.Tech IV R PROGRAMMING Previous Question Paper (June - 2024 - R16)
Note: i) Question paper consists of Part A, Part B. ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions. iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.
Part A
How can we assign a value to a variable? Give example.
Answer
In R, values are assigned to variables using the assignment operators <-, =, or ->. The <- operator is the most commonly used and idiomatic way to assign values in R.
In this example, the numeric value 10 is assigned to the variable named x.
Distinguish between interactive and batch mode of executing R program.
Answer
The distinction between interactive and batch modes in R programming lies in how the user interacts with the interpreter and how the execution process is managed:
- Interactive Mode: In this mode, the user enters commands directly into the R console or an IDE like RStudio. The interpreter executes each command immediately after it is entered and displays the result. This is ideal for exploratory data analysis, debugging, and testing code snippets in real-time.
- Batch Mode: In this mode, the R script is saved as a file (typically with a .R extension) and executed as a single unit by the operating system or a scheduler. The user does not interact with the code during execution, and the output is usually redirected to a log file or console output stream. This is preferred for running long-running processes, automated reporting, or production scripts where human intervention is not required.
Write a program in R to display the current date and day.
Answer
Sign in to view the complete answer paper.
Explain the role of indexing in R programming.
Answer
Sign in to view the complete answer paper.
How can we create a list? Give an example.
Answer
Sign in to view the complete answer paper.
Explain the role of NA with respect to data frames in R.
Answer
Sign in to view the complete answer paper.
Why we are using the tabdom function.
Answer
Sign in to view the complete answer paper.
Give a brief description of the marginal values of a variable.
Answer
Sign in to view the complete answer paper.
What is a class? In what way it differs from the method?
Answer
Sign in to view the complete answer paper.
Distinguish between ls() and rm().
Answer
Sign in to view the complete answer paper.
Part B
Define a variable. List and explain the rules to be followed to define it.
Answer
Sign in to view the complete answer paper.
Write and explain the basic classification of objects in R.
Answer
Sign in to view the complete answer paper.
Write and explain the different types of coercion in R.
Answer
Sign in to view the complete answer paper.
How can we represent the categorial data? Explain with an example.
Answer
Sign in to view the complete answer paper.
With the help of a syntax and example program, explain how to test a condition and act on it.
Answer
Sign in to view the complete answer paper.
Write an R program to find the sum of odd and even numbers present between 1 to 20.
Answer
Sign in to view the complete answer paper.
Which statement is used to execute a loop a fixed number of times? Explain it with a program.
Answer
Sign in to view the complete answer paper.
How can we represent matrices using R? Demonstrate with an example program.
Answer
Sign in to view the complete answer paper.
With the help of an example program, explain how we can add and delete elements into a list.
Answer
Sign in to view the complete answer paper.
How many types of apply functions are there? Explain them with respect to data frames.
Answer
Sign in to view the complete answer paper.
What is a data frame? How can we create it? List and explain the various matrix-like operations that can be performed on it. Explain them with an example program.
Answer
Sign in to view the complete answer paper.
Write a program in R to find the smallest and largest element present in the table.
Answer
Sign in to view the complete answer paper.
List and explain the matrix / array like operations on tables.
Answer
Sign in to view the complete answer paper.
Explain the working of aggregate and cut functions with respect to tables.
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. What is the probability of exactly one of these events occurring?
Answer
Sign in to view the complete answer paper.
How can we present the data in the form of a histogram? Demonstrate with example.
Answer
Sign in to view the complete answer paper.
What is a generic function? List their advantages and disadvantages over normal functions.
Answer
Sign in to view the complete answer paper.
Define inheritance. In what way is it useful in programming languages? Explain.
Answer
Sign in to view the complete answer paper.
What is meant by code profiling? Illustrate with an example.
Answer
Sign in to view the complete answer paper.