Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

R Programing

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

ECHELON INSTITUTE OF TECHNOLOGY

Department of Computer Science & Engineering


Title of Assignment: R Programming (OEC-CS-701(III))
Course: B.Tech, 7th semester Session: Jul 2023-Dec. 2023
Date of Issue:28th August, 2023 Date of Submission: 1st September. 2023
Course Unit included: 1st Max. Marks: 30 Assignment Number: 1st
--------------------------------------------------------------------------------------------------------------------------
Learning Outcomes:

LO1: Understand the basic concepts of object oriented programming.


LO2: Understand and implement various examples of exception handling.

Question No.1

Installation of R studio and understand the Environment for “R”. [5]


Question No.2
Discuss R Programming with its features, pros and cons. And state your reason why it is
different with other programming language? [5]

Question No.3

Define importance of Packages with code of examples(any 5 programs).

[10]

Question No.4

Write a R program to create the system's idea of the current date with and without time. [10]

R Programming Code :

print("System's idea of the current date with and without time:")


print(Sys.Date()) print(Sys.time())

2) Write a R program to take input from the user (name and age) and display the values.
Also print the version of R installation.

R Programming Code :

name = readline(prompt="Input your name: ") age =


readline(prompt="Input your age: ") print(paste("My name is",name,
"and I am",age ,"years old.")) print(R.version.string)
3) Write a R program to get the details of the objects in memory.

R Programming Code :

name = "Python";

n1 = 10;

n2 = 0.5

nums = c(10, 20, 30, 40, 50, 60)

print(ls())

print("Details of the objects in memory:")

print(ls.str())

4) Write a R program to create a sequence of numbers from 20 to 50 and find the mean of
numbers from 20 to 60 and sum of numbers from 51 to 91.

R Programming Code :

print("Sequence of numbers from 20 to 50:") print(seq(20,50))


print("Mean of numbers from 20 to 60:")

print(mean(20:60))

print("Sum of numbers from 51 to 91:")

print(sum(51:91))

5) Write a R program to create three vectors numeric data, character data and logical data.
Display the content of the vectors and their type.

R Programming Code :

a = c(1, 2, 5, 3, 4, 0, -1, -3) b = c("Red", "Green", "White") c = c(TRUE, TRUE, TRUE,


FALSE, TRUE, FALSE) print(a) print(typeof(a)) print(b) print(typeof(b)) print(c)
print(typeof(c))
Course Outcome Evaluation Matrix:
Qns-1 Qns-2 Qns-3 Qns-4

CO-1 √ √ √ √
CO-2

CO-3

CO-4

Assignment prepared by: Ms. Suman


Verified/Approved by HOD: Dr. Jugnesh Kumar

Suman
Signature of Faculty

You might also like