0% found this document useful (0 votes)
5 views

R_Programming_List of Experiments_update (1)

The document outlines the syllabus for a Computer Laboratory course on R Programming at SRI Balaji University, Pune. It includes a comprehensive list of experiments divided into two units, covering topics such as data types, control structures, vector and matrix operations, and data frame manipulations. Each experiment consists of specific programming tasks aimed at developing practical skills in R programming.

Uploaded by

Rohit Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

R_Programming_List of Experiments_update (1)

The document outlines the syllabus for a Computer Laboratory course on R Programming at SRI Balaji University, Pune. It includes a comprehensive list of experiments divided into two units, covering topics such as data types, control structures, vector and matrix operations, and data frame manipulations. Each experiment consists of specific programming tasks aimed at developing practical skills in R programming.

Uploaded by

Rohit Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

SRI BALAJI UNIVERSITY, PUNE

SCHOOL OF COMPUTER STUDIES (SCS)


SYBCA Sem IV (Batch 2024 – 28)
Course Title: Computer Laboratory – Basics of R Programming Lab
Course Code: BCA2304DS07
List of Experiments
Unit # 1
1. Installation and Running R and RStudio for Windows
2. Basics datatypes, variables, comments, input from user, print function.
a) Create a program that assigns values to variables of different data types (numeric,
character, logical, and complex). Print the values and their data types.
b) Write a program that demonstrates the use of both single-line and multi-line
comments. Include some code with comments explaining its functionality.
c) Write a program that prompts the user to enter their name and age, and then prints a
greeting message that includes their name and age.
d) Write a program that calculates and prints the area of a rectangle. The length and
width of the rectangle should be taken as input from the user.
3. Type Casting
a) Write a program that takes a string input from the user representing a number. Convert
it into a numeric value and print the result. Handle any errors if the conversion is not
possible.
4. Implement all arithmetic Operations on various data types
5. Implement all relational Operations on various data types
6. Implement all logical Operations on various data types
7. Implement all miscellaneous Operations on various data types
8. Implementation of if, if-else, if-else ladder, or nested if
a) Write an R program to accept the percentage from the user and display the grade
according to the following criteria.
b) Write an R program to find the validity of a triangle
c) Write an R program to check whether the entered character is a vowel or consonant.
d) Write an R program to identify the character type (lowercase/ uppercase/ digit/ special
character)
e) Write an R program to check the divisibility by 2, 3, or both for a number.
9. Implementation of Switch statement
a) Write an R program to display the season as per the choice of month.
b) Write an R program to display the area of a specific 2D shape entered by user.
c) Write an R program to design a simple calculator for the functions like (+, -, *, /, mod,
exp, sqrt, percentage, etc.)
d) Write an R program to display the grade obtained by student as per the earned marks.
10. Implementation of loops (Repeat, While, For) without/with nesting.
a) Write a program that calculates the sum of numbers from 1 to n using a for loop,
where n is taken as input from the user.
b) Write a program that takes a number as input and prints the factorial of that number
using a while loop.
c) Write a program that prints a multiplication table for a number provided by the user
using a nested for loop.
d) Write an R program that checks if a given number (input by the user) is a prime
number.
e) Write an R program that calculates the sum of all even numbers between 1 and 100
using while loop.
f) Write an R program to generate the first 15 terms of the Fibonacci sequence using a
for loop.
g) Write an R program to calculate the factorial of a given number using a repeat loop.

Unit # 2
11 Solve basic operations on Vectors.
a) Write an R code to create a vector containing numbers from 1 to 10.
b) Display the output and find the length of created vector.
12 Accessing elements of Vector
a) Create a vector containing elements multiple of 5.
b) Access and display all the elements except the 5th element of Vector.
13. Vector indexing with conditions
a) Create a Vector consisting of seven elements ranging from 2 to 50. Extract all
elements greater than 15.
b) Replace all the elements less than 15 with zero.
14. Write R code for the following operations on Vector.
a) Combine two vectors with the same datatypes and different datatypes.
b) Append three new elements to the existing vector.
c) Element-wise multiplication of two vectors.
d) Reverse a Vector.
e) Check for the presence of an element in a Vector.
f) Find the sum and product of elements of a Vector.
g) Create a logical vector for an existing Vector.
15 Apply inbuilt functions on Vectors
a) Sort elements of a vector in increasing and decreasing order.
b) Apply filter to the elements of a vector (based on conditions).
c) Extract all the elements of a vector greater than 25.
d) Extract all the elements that are duplicate in nature.
e) Find the sum, mean & median for the elements of a vector.
16 Matrix Operations
a) Generate /create a matrix with 3 rows and 3 columns of consequetive numbers starting
from 6.
b) Access following
i) Second elements of second row.
ii) Third row
iii) Second column
iv) Modify the last element of matrix with 62.
c) Apply element-wise addition, multiplication, division, and subtraction on two vectors.
17 Find the following for matrix
a) Dimension of a matrix.
b) Determinant of a matrix.
c) Inverse of a matrix.
d) Design diagonal & Identity matrix.
e) Find the sum and mean of a rows and columns for a matrix.
f) Find the combination of two matrices concerning the rows and columns.
Data Frames Operations:
18. Create a data frame for students' information with the headings student_id, student_name,
phone, email_id, address, program, year, CGPA, and number_of_backlogs. Create data frame
of size 10. Perform the following on this data frame.
a) Access column CGPA.
b) Access the information on 5th student
c) Identify the details of students whose CGPA is more than 7.5
d) Add two columns SGPA and Marks to the above data frame.
e) Rename the column Marks to Scores.
f) Add information about 3 new students.
g) Create another data frame with the heads student_id, student_names, father_name, and
mother name. Now merge this new data frame with the previously created data frame.
19. Apply the following operations on the data frame.
a) Create a data frame and convert it to a .csv file.
b) Create a data frame from a CSV file.
c) Transpose of a data frame
d) Find the mean of the column CGPA from the first data frame using $, [[]], and column
index methods.
20. Operations on Factors

You might also like