Data Analytics With R - BDS306C - LAB - Full
Data Analytics With R - BDS306C - LAB - Full
Data Analytics With R - BDS306C - LAB - Full
DEPARTMENT OF AI & ML
Compiled by
DEPARTMENT OF AI & ML
YENEPEOYA INSTITUTE OF TECHNOLOGY
MANGALORE
Name:
USN:
YENEPOYA INSTITUTE OF TECHNOLOGY
Affiliated to VTU, Recognized by GOK, Approved by AICTE
NH , dar, ijar t, d idri 74
www.yit.edu.in
DEPARTMENT OF AI & ML
2
COURSE OUTCOMES
Course Outcomes: At the end of this course, students are able to:
CO1: Describe the structures of R Programming
CO2: Illustrate the basics of Data Preparation with real world examples
CO3: Apply the Graphical Packages of R for visualization
CO4: Apply various Statistical Analysis methods for data analytics.
COURSE
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2 PSO3 PSO4
OUTCOMES
CO1 3 3 3
CO2 3 3 3 3
CO3 3 3 3 3
CO4 3 3 3 3
4
Mapping of ‘Graduate Attributes’ (GAs) and ‘Program Outcomes’ (POs)
Graduate Attributes (GAs)
Program Outcomes (POs)
(As per Washington Accord
(As per NBA New Delhi)
Accreditation)
Apply the knowledge of mathematics, science, engineering fundamentals
Engineering Knowledge and an engineering specialization to the solution of complex engineering
problems
6
PROGRAM LIST
1 Sample Programs 1 – 22
Demonstrate the steps for installation of R and R Studio. Perform the following:
2
a) Assign different type of values to variables and display the type of variable.
Assign different types such as Double, Integer, Logical, Complex and Character
and understand the difference between each data type. 23 – 31
b) Demonstrate Arithmetic and Logical Operations with simple examples.
c) Demonstrate generation of sequences and creation of vectors.
d) Demonstrate Creation of Matrices
e) Demonstrate the Creation of Matrices from Vectors using Binding Function.
f) Demonstrate element extraction from vectors, matrices and arrays
Assess the Financial Statement of an Organization being supplied with 2
3
vectors of data: Monthly Revenue and Monthly Expenses for the Financial
Year. You can create your own sample data vector for this experiment)
Calculate the following financial metrics:
a) Profit for each month.
b) Profit after tax for each month (Tax Rate is 30%).
c) Profit margin for each month equals to profit after tax divided by revenue.
d) Good Months – where the profit after tax was greater than the mean for the
year. 32 – 35
e) Bad Months – where the profit after tax was less than the mean for the year.
f) The best month – where the profit after tax was max for the year.
g) The worst month – where the profit after tax was min for the year.
Note:
a) All Results need to be presented as vectors
b) Results for Dollar values need to be calculated with $0.01 precision, but need
to be presented in Units of $1000 (i.e 1k) with no decimal points
c) Results for the profit margin ratio need to be presented in units of % with no
decimal point.
d) It is okay for tax to be negative for any given month (deferred tax asset)
e) Generate CSV file for the data.
4 Develop a program to create two 3 X 3 matrices A and B and perform the
following operations a) Transpose of the matrix b) addition c) subtraction d)
36 – 39
multiplication
7
The built-in data set mammals contain data on body weight versus brain weight.
7
Develop R commands to:
a) Find the Pearson and Spearman correlation coefficients. Are they similar? 43 – 45
b) Plot the data using the plot command.
c) Plot the logarithm (log) of each variable and see if that makes a difference.
Develop R program to create a Data Frame with following details and do the
8
following operations.
a) Subset the Data frame and display the details of only those items whose price
is greater than or equal to 350.
b) Subset the Data frame and display only the items where the category is either
“Office Supplies” or “Desktop Supplies”
c) Create another Data Frame called “item-details” with three different fields
itemCode, ItemQtyonHand and ItemReorderLvl and merge the two frames
Let us use the built-in dataset air quality which has Daily air quality
9
measurements in New York, May to September 1973. Develop R program to
generate histogram by using appropriate arguments for the following
statements.
a) Assigning names, using the air quality data set.
b) Change colors of the Histogram 49 –50
c) Remove Axis and Add labels to Histogram
d) Change Axis limits of a Histogram
e) Add Density curve to the histogram
Design a data frame in R for storing about 20 employee details. Create a CSV
10
file named “input.csv” that defines all the required information about the
employee such as id, name, salary, start_date, dept. Import into R and do the
following analysis.
a) Find the total number rows & columns
b) Find the maximum salary 51 – 53
c) Retrieve the details of the employee with maximum salary
d) Retrieve all the employees working in the IT Department.
e) Retrieve the employees in the IT Department whose salary is greater than
20000 and write these details into another file “output.csv”
Using the built in dataset mtcars which is a popular dataset consisting of the
11
design and fuel consumption patterns of 32 different automobiles. The data was
extracted from the 1974 Motor Trend US magazine, and comprises fuel 54 - 56
consumption and 10 aspects of automobile design and performance for 32
automobiles (1973-74 models). Format A data frame with 32 observations on
8
11 variables : [1] mpg Miles/(US) gallon, [2] cyl Number of cylinders [3] disp
Displacement (cu.in.), [4] hp Gross horsepower [5] drat Rear axle
ratio,[6] wt Weight (lb/1000) [7] qsec 1/4 mile time, [8] vs V/S, [9] am
Transmission (0 = automatic, 1 = manual), [10] gear Number of forward gears,
[11] carb Number of carburetors
Develop R program, to solve the following:
a) What is the total number of observations and variables in the dataset?
b) Find the car with the largest hp and the least hp using suitable functions
c) Plot histogram / density for each variable and determine whether continuous
variables are normally distributed or not. If not, what is their skewness?
d) What is the average difference of gross horse power(hp) between
automobiles with 3 and 4 number of cylinders(cyl)? Also determine the
difference in their standard deviations.
e) Which pair of variables has the highest Pearson correlation?
Demonstrate the progression of salary with years of experience using a suitable
12
data set (You can create your own dataset). Plot the graph visualizing the best
fit line on the plot of the given data points. Plot a curve of Actual Values vs. 57 – 60
Predicted values to show their correlation and performance of the model.
Interpret the meaning of the slope and y-intercept of the line with respect to the
given data. Implement using lm function. Save the graphs and coefficients in
files. Attach the predicted values of salaries as a new column to the original
data set and save the data as a new CSV file.
Additional Programs
13 61
14 Viva Questions 62
9
Sample Programs:
1. Write a program to list the distinct values in a vector from a given vector.
Output:
2. Write a program to find the elements of a given vector that are not in another given
vector.
a = c(0, 10, 10, 10, 20, 30, 40, 40, 40, 50, 60)
b = c(10, 10, 20, 30, 40, 40, 50)
print("Original vector-1:")
print(a)
print("Original vector-2:")
print(b)
print("Elements of a that are not in b:")
result = setdiff(a, b)
print(result)
10
Output:
11
Output:
Output:
[1] "Original Vectors:"
> print(x)
[1] 10 20 30 20 20 25 9 26
> print("nth highest value in a given vector:")
12
[1] "nth highest value in a given vector:"
> print("n = 1")
[1] "n = 1"
>n=1
> print(sort(x, TRUE)[n])
[1] 30
> print("n = 2")
[1] "n = 2"
>n=2
> print(sort(x, TRUE)[n])
[1] 26
> print("n = 3")
[1] "n = 3"
>n=3
> print(sort(x, TRUE)[n])
[1] 25
> print("n = 4")
[1] "n = 4"
>n=4
> print(sort(x, TRUE)[n])
[1] 20
5. Write an R program to create a vector of a specified type and length. Create vector of
numeric, complex, logical and character types of length 6.
x = vector("numeric", 5)
print("Numeric Type:")
print(x)
c = vector("complex", 5)
print("Complex Type:")
print(c)
l = vector("logical", 5)
print("Logical Type:")
print(l)
13
chr = vector("character", 5)
print("Character Type:")
print(chr)
Output:
> x = vector("numeric", 5)
> print("Numeric Type:")
[1] "Numeric Type:"
> print(x)
[1] 0 0 0 0 0
> c = vector("complex", 5)
> print("Complex Type:")
[1] "Complex Type:"
> print(c)
[1] 0+0i 0+0i 0+0i 0+0i 0+0i
> l = vector("logical", 5)
> print("Logical Type:")
[1] "Logical Type:"
> print(l)
[1] FALSE FALSE FALSE FALSE FALSE
> chr = vector("character", 5)
> print("Character Type:")
[1] "Character Type:"
> print(chr)
[1] ""
"" "" "" ""
14
6. Write a program to find the factors of a given number
print_factors = function(n) {
print(paste("The factors of",n,"are:"))
for(i in 1:n) {
if((n %% i) == 0) {
print(i)
}}}
print_factors(4)
print_factors(7)
print_factors(12)
Output:
> print_factors(4)
[1] "The factors of 4 are:"
[1] 1
[1] 2
[1] 4
> print_factors(7)
[1] "The factors of 7 are:"
[1] 1
[1] 7
> print_factors(12)
[1] "The factors of 12 are:"
[1] 1
[1] 2
[1] 3
[1] 4
[1] 6
[1] 12
15
7. Write a script that will print "Even Number" if the variable x is an even number, otherwise
print "Not Even":
Output:
> x <- 3 # Change x to test
> if (x%%2 == 0){
+ print('Even Number')
+ }else{
+ print('Not Even')
+ }
[1] "Not Even"
8. Write a script that will print 'Is a Matrix' if the variable x is a matrix, otherwise print "Not
a Matrix". Hint: You may want to check out help (is.matrix)
x <- matrix()
if (is.matrix(x)){
print('Is a Matrix')
}else{
print("Not a Matrix")
}
16
Output:
> x <- matrix()
> if (is.matrix(x)){ print('Is a Matrix')
+ }else{
+ print("Not a Matrix")
+ }
[1] "Is a Matrix"
Output:
> A <- rbind (a1, a2, a3)
> # print the original matrix
> print(A)
[,1] [,2] [,3]
a1 3 2 5
a2 2 3 2
a3 5 2 4
17
> # Use the solve() function to calculate the inverse.
> T1 <- solve(A)
> # print the inverse of the matrix.
> print(T1)
a1 a2 a3
[1,] -0.29629630 -0.07407407 0.4074074
[2,] -0.07407407 0.48148148 -0.1481481
[3,] 0.40740741 -0.14814815 -0.1851852
Output:
> # determinant of matrix
> print(det(A))
[1] -28
t=seq(0,10,0.1)
y=sin(t)
plot(t,y,type="l", xlab="time", ylab="Sine wave")
18
Output:
library(ggplot2)
qplot(t,y,geom="path", xlab="time", ylab="Sine wave")
Output:
df <- data.frame(
Training = c("Strength", "Stamina", "other"),
Pulse = c(100, 150, 120),
Duration = c(60, 30, 45)
)
# print the dataframe
print(df)
19
Output:
> print(df)
Training Pulse Duration
1 Strength 100 60
2 Stamina 150 30
3 other 120 45
summary(df)
> summary(df)
14. Write a R program to use single brackets [ ], double brackets [[ ]] or $ to access columns
from a data frame:
df <- data.frame(
Training = c("Strength", "Stamina", "other"),
Pulse = c(100, 150, 120),
Duration = c(60, 30, 45)
)
20
# print the dataframe
print(df)
df[1]
df[["Training"]]
df$Training
Output:
> df[1]
Training
1 Strength
2 Stamina
3 other
> df[["Training"]]
[1] "Strength" "Stamina" "other"
> df$Training
[1] "Strength" "Stamina" "other"
15. Write a R program to use rbind() function to add new rows in a Data Frame:
df <- data.frame(
Training = c("Strength", "Stamina", "other"),
Pulse = c(100, 150, 120),
Duration = c(60, 30, 45)
)
# Add a new row
New_row_DF <- rbind(df, c("strength",110,110))
# Print the new row
New_row_DF
21
Output:
22
Program 1
AIM: Demonstrate the steps for installation of R and R Studio. Perform the following:
a) Assign different type of values to variables and display the type of variable. Assign
different types such as Double, Integer, Logical, Complex and Character and understand
the difference between each data type.
b) Demonstrate Arithmetic and Logical Operations with simple examples.
c) Demonstrate generation of sequences and creation of vectors.
d) Demonstrate Creation of Matrices.
e) Demonstrate the Creation of Matrices from Vectors using Binding Function.
f) Demonstrate element extraction from vectors, matrices and arrays.
Source code:
a) Assign different type of values to variables and display the type of variable. Assign
different types such as Double, Integer, Logical, Complex and Character and
understand the difference between each data type.
23
Output:
24
cat("Difference:", difference_result, "\n")
cat("Product:", product_result, "\n")
cat("Quotient:", quotient_result, "\n")
cat("Remainder:", remainder_result, "\n\n")
# Logical operations
logical_var1 <- TRUE
logical_var2 <- FALSE
Output:
Arithmetic Operations:
25
Sum: 15
Difference: 5
Product: 50
Quotient: 2
Remainder: 0
Logical Operations:
AND: FALSE
OR: TRUE
NOT: FALSE
26
Output:
#Example 1
V1 = c(10, 20, 30, 40, 50, 60)
print('Content of the vector 1:')
print(V1)
#Example 2
V2 = seq(2,15)
print ("Content of the vector 2:")
print (V2)
#Example 3
V3= sample (-50:50, 10, replace=TRUE)
print ("Content of the vector 3:")
27
print (V3)
Output:
[1] " Content of the vector 1: "
> print (V1)
[1] 10 20 30 40 50 60
[1] "Content of the vector 2:"
> print (V2)
[1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#Example 1
m1 = matrix(1:20, nrow=5, ncol=4)
print("5 × 4 matrix:")
print(m1)
#Example 2
cells = c(1,3,5,7,8,9,11,12,14)
rnames = c("Row1", "Row2", "Row3")
cnames = c("Col1", "Col2", "Col3")
m2 = matrix(cells, nrow=3, ncol=3, byrow=TRUE, dimnames=list(rnames, cnames))
print("3 × 3 matrix with labels, filled by rows: ")
print(m2)
print("3 × 3 matrix with labels, filled by columns: ")
m3 = matrix(cells, nrow=3, ncol=3, byrow=FALSE, dimnames=list(rnames, cnames))
print(m3)
28
Output:
[1] "5 × 4 matrix:"
> print(m1)
[1,] 1 6 11 16
[2,] 2 7 12 17
[3,] 3 8 13 18
[4,] 4 9 14 19
[5,] 5 10 15 20
> print(m2)
Row1 1 3 5
Row2 7 8 9
Row3 11 12 14
Row1 1 7 11
Row2 3 8 12
29
Row3 5 9 14
a<-c(1,2,3)
b<-c(4,5,6)
c<-c(7,8,9)
m<-cbind(a,b,c)
print("Content of the matrix:")
print(m)
Output:
[1] "Content of the said matrix:"
> print(m)
abc
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9
30
# Creating a matrix
my_matrix <- matrix(1:9, nrow = 3)
# Extracting the element in the second row and third column of the matrix
element_from_matrix <- my_matrix[2, 3]
print(paste("Element from matrix:", element_from_matrix))
# Creating a 3D array
my_array <- array(1:27, dim = c(3, 3, 3))
# Extracting the element in the second row, second column, and third depth of the array
element_from_array <- my_array[2, 2, 3]
print(paste("Element from array:", element_from_array))
Output:
31
Program 2
AIM: Assess the Financial Statement of an Organization being supplied with 2 vectors of
data: Monthly Revenue and Monthly Expenses for the Financial Year. You can create
your own sample data vector for this experiment) Calculate the following financial
metrics:
a. Profit for each month.
b. Profit after tax for each month (Tax Rate is 30%).
c. Profit margin for each month equals to profit after tax divided by revenue.
d. Good Months – where the profit after tax was greater than the mean for the year.
e. Bad Months – where the profit after tax was less than the mean for the year.
f. The best month – where the profit after tax was max for the year.
g. The worst month – where the profit after tax was min for the year.
Note:
a. All Results need to be presented as vectors
b. Results for Dollar values need to be calculated with $0.01 precision, but need to be
presented in Units of $1000 (i.e 1k) with no decimal points
c. Results for the profit margin ratio need to be presented in units of % with no decimal
point.
d. It is okay for tax to be negative for any given month (deferred tax asset)
e. Generate CSV file for the data.
# Tax Rate
tax_rate <- 0.3
# Identify Good Months, Bad Months, Best Month, and Worst Month
32
good_months <- which(profit_after_tax > mean_profit_after_tax)
bad_months <- which(profit_after_tax < mean_profit_after_tax)
best_month <- which.max(profit_after_tax)
worst_month <- which.min(profit_after_tax)
Output:
Monthly Revenue1 Monthly Revenue2
"50" "55"
Monthly Revenue3 Monthly Revenue4
"60" "58"
Monthly Revenue5 Monthly Revenue6
"62" "65"
Monthly Revenue7 Monthly Revenue8
33
"70" "75"
Monthly Revenue9 Monthly Revenue10
"78" "80"
Monthly Revenue11 Monthly Revenue12
"85" "90"
Monthly Expenses1 Monthly Expenses2
"35" "38"
Monthly Expenses3 Monthly Expenses4
"40" "42"
Monthly Expenses5 Monthly Expenses6
"45" "48"
Monthly Expenses7 Monthly Expenses8
"50" "52"
Monthly Expenses9 Monthly Expenses10
"55" "58"
Monthly Expenses11 Monthly Expenses12
"60" "62"
Profit1 Profit2
"15" "17"
Profit3 Profit4
"20" "16"
Profit5 Profit6
"17" "17"
Profit7 Profit8
"20" "23"
Profit9 Profit10
"23" "22"
Profit11 Profit12
"25" "28"
Program 3
35
Develop a program to create two 3 X 3 matrices A and B and perform the following
operations:
a) Transpose of the matrix b) Addition c) Subtraction d) Multiplication
for (i in 1:rows) {
row_input <- numeric()
for (j in 1:cols) {
prompt <- paste("Enter element at position [", i, ",", j, "]: ")
element <- as.numeric(readline(prompt))
row_input <- c(row_input, element)
}
36
cat("\nTranspose of Matrix B:\n")
print(t(B))
Output:
> A <- read_matrix(rows, cols)
> print(A)
[1,] 2 3 4
[2,] 5 6 7
[3,] 7 8 9
Matrix B:
>B
[,1] [,2] [,3]
[1,] 1 0 0
[2,] 0 1 0
[3,] 0 0 1
> print(t(A))
[1,] 2 5 7
[2,] 3 6 8
[3,] 4 7 9
> print(A + B)
[1,] 3 3 4
[2,] 5 7 7
[3,] 7 8 10
[1,] 2 3 4
[2,] 5 6 7
[3,] 7 8 9
> print(A - B)
38
[,1] [,2] [,3]
[1,] 1 3 4
[2,] 5 5 7
[3,] 7 8 8
Program 4
39
Develop a program to find the factorial of given number using recursive function calls.
Output:
> Enter a number to calculate factorial: 5
40
Program 5
Develop an R Program using functions to find all the prime numbers up to a specified
number by the method of Sieve of Eratosthenes.
42
Program 6
The built-in data set mammals containing data on body weight versus brain weight.
Develop R commands to:
a) Find the Pearson and Spearman correlation coefficients. Are they similar?
b) Plot the data using the plot command.
c) Plot the logarithm (log) of each variable and see if that makes a difference.
# c) Plot the logarithm (log) of each variable and see if that makes a difference
43
plot(log(mammals$body), log(mammals$brain),
xlab = "Log Body Weight", ylab = "Log Brain Weight",
main = "Log Body Weight vs Log Brain Weight")
Note: Pearson and Spearman correlation coefficients are two widely used statistical
measures when measuring the relationship between variables. The Pearson correlation
coefficient assesses the linear relationship between variables, while the Spearman
correlation coefficient evaluates the monotonic relationship.
Output:
Note: As we can see both the correlation coefficients give the positive correlation value
for body and brain of the mammals but the value given by them is slightly different
because Pearson correlation coefficients measure the linear relationship between the
variables while Spearman correlation coefficients measure only monotonic relationships,
relationship in which the variables tend to move in the same/opposite direction but not
necessarily at a constant rate whereas the rate is constant in a linear relationship.
44
45
Program 7
Develop R program to create a Data Frame with following details and do the following
operations.
a) Subset the Data frame and display the details of only those items whose price is greater
than or equal to 350.
b) Subset the Data frame and display only the items where the category is either “Office
Supplies” or “Desktop Supplies”.
c) Create another Data Frame called “item-details” with three different fields itemCode,
ItemQtyonHand and ItemReorderLvl and merge the two frames.
# a) Subset the Data frame for items whose price is greater than or equal to 350
highPricedItems <- subset(items, itemPrice >= 350)
cat("\nHigh Priced Items:\n")
print(highPricedItems)
46
# b) Subset the Data frame for items with category "Office Supplies" or "Desktop
Supplies"
officeDesktopItems <- subset(items, itemCategory %in% c("Office Supplies", "Desktop
Supplies"))
cat("\nOffice and Desktop Supplies:\n")
print(officeDesktopItems)
Output:
> # a) Subset the Data frame for items whose price is greater than or equal to 350
High Priced Items:
> print(highPricedItems)
itemCode itemCategory itemPrice
1 1001 Electronics 700
3 1003 Office Supplies 350
4 1004 USB 400
5 1005 CD Drive 800
> # b) Subset the Data frame for items with category "Office Supplies" or "Desktop
Supplies"
> print(officeDesktopItems)
itemCode itemCategory itemPrice
2 1002 Desktop Supplies 300
3 1003 Office Supplies 350
> # Merge the two Data Frames based on the common column "itemCode"
48
Program 8
Let us use the built-in dataset air quality which has Daily air quality measurements in
New York, May to September 1973. Develop R program to generate histogram by using
appropriate arguments for the following statements.
a) Assigning names, using the air quality data set.
b) Change colors of the Histogram
c) Remove Axis and Add labels to Histogram
d) Change Axis limits of a Histogram
e) Add Density curve to the histogram
Note: In this code, the par(mfrow = c(3, 2)) command sets up a 3x2 grid for plotting, and
par(mfrow = c(1, 1)) resets it to the default settings after all plots are done.
Output:
Program 9
50
AIM: Write a R program to create a 5 × 4 matrix, 3 × 3 matrix with labels and fill the
matrix by rows and 2 × 2 matrix with labels and fill the matrix by columns
# e) Retrieve the employees in the IT Department whose salary is greater than 20000
it_high_salary <- subset(it_department, salary > 20000)
Output:
52
# a) Find the total number of rows & columns
> cat("Total number of rows:", num_rows, "\n")
Total number of rows: 20
> cat("Total number of columns:", num_cols, "\n")
Total number of columns: 5
Program 10
53
AIM: Using the built in dataset mtcars which is a popular dataset consisting of the
design and fuel consumption patterns of 32 different automobiles. The data was extracted
from the 1974 Motor Trend US magazine, and comprises fuel consumption and 10
aspects of automobile design and performance for 32 automobiles (1973-74 models).
Format a data frame with 32 observations on 11 variables : [1] mpg Miles/(US) gallon,
[2] cyl Number of cylinders [3] disp Displacement (cu.in.), [4] hp Gross horsepower [5]
drat Rear axle ratio,[6] wt Weight (lb/1000) [7] qsec 1/4 mile time, [8] vs V/S, [9] am
Transmission (0 = automatic, 1 = manual), [10] gear Number of forward gears, [11] carb
Number of carburetors.
Output:
> # b) Find the car with the largest hp and the least hp
55
# d) Average difference of gross horsepower (hp) between automobiles with 3 and 4
cylinders (cyl)
58
Output:
salary_data
Experience Salary Predicted_Salary
1 1 29818.57 32382.14
2 2 32309.47 33834.01
3 3 39176.12 35285.88
4 4 36211.53 36737.74
5 5 37887.86 38189.61
6 6 44145.19 39641.47
7 7 41882.75 41093.34
8 8 38204.82 42545.21
9 9 41439.44 43997.07
10 10 43663.01 45448.94
11 11 50172.25 46900.80
12 12 49079.44 48352.67
13 13 50702.31 49804.54
14 14 51332.05 51256.40
15 15 50832.48 52708.27
16 16 59360.74 54160.13
17 17 56993.55 55612.00
18 18 51100.15 57063.87
19 19 60604.07 58515.73
20 20 58581.63 59967.60
59
> # Interpretation of slope and y-intercept
Interpretation of the linear regression model:
Slope (Coefficient for Experience): 1451.866
Y-Intercept: 30930.28
60
Additional Programs
1. Write an R Program to find the Factors of a Number.
2. Write an R Program to find the Factorial of a Number.
3. Write an R Program to find the Factorial of a Number Using Recursion.
4. Write an R program to convert Decimal into Binary using Recursion.
5. Write an R Program to check Armstrong Number.
6. Write an R Program to add Two Vectors.
7. Write an R program to Fibonacci Sequence Using Recursion in R.
8. Write an R Program to print the Fibonacci Sequence.
9. Write an R Program to find H.C.F. or G.C.D.
10. Write an R "Hello World" Program.
11. Write an R Program to check for Leap Year.
12. Write an R Program to find L.C.M.
13. Write an R Program to find Minimum and Maximum value in a Vector.
14. Write an R Program to print Multiplication Table
15. Write an R Program to generate Random Number from Standard Distributions
16. Write an R Program to sample from a Population
17. Write an R Program to make a Simple Calculator
18. Write an R Program to sort a Vector
19. Find Sum, Mean and Product of Vector in R Programming
20. Write an R Program to find Sum of Natural Numbers Using Recursion
21. Write an R Program to find the Sum of Natural Numbers
61
Viva Questions:
62