JNTU

JNTU B.Tech IV R PROGRAMMING Previous Question Paper (December - 2020 - R16)

B.Tech | IV | II | R16 | December - 2020

Answer PaperPaper Code: 138GTMaximum Marks: 75Time: 2 Hours

Answer any Five Questions. All Questions Carry Equal Marks.

Main

1

Elaborate the steps in installing R in windows OS.

15 marks

Answer

Installing R on a Windows operating system involves a straightforward process of downloading the base distribution from the Comprehensive R Archive Network (CRAN) and executing the installer. Follow these steps:

  1. Navigate to the official CRAN website at https://cran.r-project.org/.
  2. Select the Download R for Windows link.
  3. Click on the base subdirectory link, which contains the primary installer for Windows.
  4. Click the Download R-x.x.x for Windows link (where x.x.x represents the latest version number) to initiate the download of the executable (.exe) file.
  5. Once the download is complete, locate the file in your downloads folder and double-click it to run the installer.
  6. Select your preferred language and click OK.
  7. Follow the setup wizard by clicking Next through the information screen, destination location selection, and component selection.
  8. Choose whether to customize startup options (typically, selecting No (accept defaults) is recommended for standard installations).
  9. Select the folder name for the Start Menu and choose additional tasks such as creating a desktop icon.
  10. Click Next to begin the installation process. Once the progress bar completes, click Finish.

After installation, you can launch R by clicking the newly created shortcut on your desktop or by searching for R in the Windows Start menu. It is also highly recommended to install RStudio as an Integrated Development Environment (IDE) to provide a more user-friendly interface for writing code, managing packages, and visualizing data.

2

Discuss various arithmetic operators and logical operators in R.

15 marks

Answer

Arithmetic and logical operators are fundamental components in R for performing mathematical calculations and evaluating boolean conditions, respectively.

Arithmetic Operators are used to perform mathematical operations on numeric vectors. R supports the following standard operators:

  • + (Addition): Adds two numbers or vectors element-wise.
  • - (Subtraction): Subtracts the second operand from the first.
  • * (Multiplication): Multiplies two operands.
  • / (Division): Divides the first operand by the second.
  • ^ or ** (Exponentiation): Raises the first operand to the power of the second.
  • %% (Modulus): Returns the remainder of the division of the first operand by the second.
  • %/% (Integer Division): Returns the quotient of the division, discarding the remainder.

These operators are vectorized, meaning they apply to each element of a vector automatically.

Logical Operators are used to combine or negate boolean values (TRUE/FALSE). They are essential for control flow and data subsetting:

  • & (Element-wise AND): Returns TRUE only if both corresponding elements are TRUE.
  • && (Logical AND): Evaluates only the first element of vectors and returns a single TRUE/FALSE result. It is typically used in control flow statements like if.
  • | (Element-wise OR): Returns TRUE if at least one of the corresponding elements is TRUE.
  • || (Logical OR): Evaluates only the first element of vectors and returns a single TRUE/FALSE result.
  • ! (Logical NOT): Inverts the logical value (TRUE becomes FALSE and vice versa).

The distinction between single and double operators is critical: single operators (&, |) perform vectorized operations across entire vectors, whereas double operators (&&, ||) are short-circuiting and operate only on the first element, making them suitable for scalar conditions in programming logic.

3

Illustrate how to define and call a function in R using an example program in R.

15 marks

Answer

Sign in to view the complete answer paper.

4

How to add and delete vector elements in R programming? Illustrate with an example.

15 marks

Answer

Sign in to view the complete answer paper.

5

With sample script in R, explain various operations performed using list.

15 marks

Answer

Sign in to view the complete answer paper.

6

Explain various matrix operations performed in R using sample script.

15 marks

Answer

Sign in to view the complete answer paper.

7

List and explain various mathematical functions available in R programming.

15 marks

Answer

Sign in to view the complete answer paper.

8

Describe the generic functions and methods for classes in S.

15 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of R PROGRAMMING from JNTU for B.Tech ECE IV II, December - 2020, R16.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in R PROGRAMMING

Loading Question Papers

Fetching data from database...