Professional Documents
Culture Documents
Practical 2. R Variables & Operators
Practical 2. R Variables & Operators
Q.2 Create a vector containing the numbers 1 to 100 with different ways.
Q.3 Write and explain the method and output of the following codes:
a<-c(1, 2, 3, 4, 5)
3.141593
bmi
age
daysPerMonth
firstFivePrimeNumbers
Q.6 Make a vector of 1,2,3,5 and 10 using c(), and assign it to the vec variable.
Q.9 Make a character vector of the gene names PAX6,ZIC2,OCT4 and SOX2. Print the class of the
vector.
Q.11 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.
Q.12 Write a R program to compute sum, mean and product of a given vector element with 5
numeric values.
Q.13 Explain the difference between | , || , & and && with the help of a program.
Q.14 Write a program to explain the arithmetic, logical & relational operators.