Ait362 Programming in r, January 2024
Ait362 Programming in r, January 2024
RegNo.: Name:
PART A
Answer oll questions, each carries 3 mnrks. Marks
Write an R program to add 3 to each element in a given vector. Print the (3)
original and new vector.
2 List at least three special values in R? (3)
3 How to use sort functions in R? (3)
4 Explain how to import data from external files in R? (3)
5 Write any three functions available for binning numeric data in R. (3)
6 What are Common Distribution-Type Arguments? (3)
7 How is correlation and covariance done in R? (3)
8 Write the function and arguments for implementing PCA. (3)
OR
t2 a) Write an R program to check if a given number is prime or not. (7)
b) Write an R program to extract first two rows from a given data frame. (7)
Module II
l3 a) Write an R program to write the following data to a CSV file. (7)
Page lof3
1200AfT36205230t
OR
16 a) Write an R program to fit a Poisson distribution with the following data: (7)
Height 3 4 5 6 7 8
Weight 30 45 50 55 65 75
Page2of3
12(XrAlT362052301
total units, totaljrofit. write R codes to calculate and visualize the total sale
data for last year for each protuct and show it using a pie chart.
Page 3of3