JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech IV Year R PROGRAMMING Previous Question Paper (July - 2023 - 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
What is meant by scope of a variable? Illustrate.
Answer
The scope of a variable refers to the region of the code where a variable is accessible and can be modified. In R, variables can have global scope (accessible anywhere) or local scope (defined within a function). For example, a variable defined inside a function is local to that function and cannot be accessed outside it.
What are the different modes of executing a R program? Describe them.
Answer
R programs can be executed in three primary modes:
- Interactive Mode: Commands are typed directly into the R console and executed immediately.
- Batch Mode: R scripts (saved as .R files) are executed from the command line or terminal without an interactive interface.
- Integrated Development Environment (IDE) Mode: Using tools like RStudio, where code is written in a script editor and executed via a console interface.
Write a program in R to display the current date and time.
Answer
Sign in to view the complete answer paper.
Distinguish between vectors and arrays.
Answer
Sign in to view the complete answer paper.
Which function is used to find the number of elements present in a list? Give an example.
Answer
Sign in to view the complete answer paper.
What is a data frame? How can we create it? Give an example.
Answer
Sign in to view the complete answer paper.
Define a contingency table and give an example.
Answer
Sign in to view the complete answer paper.
Illustrate the working of do.call().
Answer
Sign in to view the complete answer paper.
How can we remove a specific object? Explain.
Answer
Sign in to view the complete answer paper.
In what way can we create class using S. Demonstrate with a program?
Answer
Sign in to view the complete answer paper.
Part B
With the help of an example program, explain the various logical operators supported by language R.
Answer
Sign in to view the complete answer paper.
What is a variable? Why we need them? List and explain the rules to be followed to define them.
Answer
Sign in to view the complete answer paper.
Give a brief description of the role of factors in R programming.
Answer
Sign in to view the complete answer paper.
Write a R program to find the given year is a leap year or not.
Answer
Sign in to view the complete answer paper.
Which statement is used to execute an infinite loop? Explain it with an example program.
Answer
Sign in to view the complete answer paper.
Write an R program to print the even numbers present up to 20 in reverse order.
Answer
Sign in to view the complete answer paper.
Write an R program to find the biggest number among four numbers.
Answer
Sign in to view the complete answer paper.
How can we initialize the values to an array? Explain with example program.
Answer
Sign in to view the complete answer paper.
With the help of syntax and examples, explain the various operations of a list.
Answer
Sign in to view the complete answer paper.
How can we access the list components and values? Explain.
Answer
Sign in to view the complete answer paper.
What are the various functions that can be applied to lists? Explain them.
Answer
Sign in to view the complete answer paper.
Explain, how can we apply the rbind() and lbind() functions?
Answer
Sign in to view the complete answer paper.
List and explain the various functions that can be applied with factors.
Answer
Sign in to view the complete answer paper.
Write and explain the various functions used for statistical distribution.
Answer
Sign in to view the complete answer paper.
Suppose we have m independent events, and the jth 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.
Write and explain the working of S generics.
Answer
Sign in to view the complete answer paper.
What is meant by inheritance? In what way is it useful in solving problems using programming languages?
Answer
Sign in to view the complete answer paper.
How can we plot histograms? Explain with a simple example program.
Answer
Sign in to view the complete answer paper.
How can we calculate mean, median and standard deviation? Demonstrate with example.
Answer
Sign in to view the complete answer paper.