PLEASE MATCH YOUR ASSIGNMENT QUESTIONS ACCORDING TO YOUR SESSION
IGNOU MST-15 (June 2024 – June 2025) Assignment Questions
1. Attempt the following:
(a) Write the output of the following statements:
(i) rep(x=c(T,F,T,F), times=c(2,1,2,3))
(ii) 5%/%3; diag(3)
(b) Differentiate between the use of the sep and collapse arguments of the paste() function.
(c) Write R commands to create a bar plot of the following data by using arguments of the used function for filling up the bars and to give labels to the axis:
5, 10, 8, 7, 8, 5, 8, 7, 5, 8, 9, 6, 8, 8, 8
(d) Check whether the given loop is finite or infinite. If infinite, do the necessary changes in the written loop to make it finite.
x<-0
repeat{
print(x^2)
x<-x+1
if(x<5) print(x) }
2. The following data relates to the number of items produced per shift by two workers for a number of days.
(a) Write R command to create a list named LT with worker’s data. Also, after creating the list, do the following tasks:
(i) Use a suitable loop function to compute the mean of number of items produced by each worker in a single line command.
(ii) Extract the worker A data from it by using two different approaches.
(b) Write R command to create a data frame named DF with worker’s data and do the following tasks:
(i) Use suitable function to remove NA from the data and then create a scatter plot.
(ii) Write the known data obtained in step (i) to a .txt file named “WORK”.
3. Write R commands to:
(a) Create a function to compute ranks (in case of tied ranks) of the given data.
(b) Create a date object named Ddata consisting of the following dates.
26Jan2023, 15Aug2023, 02Oct2023, 05Sep2023
(c) Create an array of two dimension with following elements
Also, extract the row shown in the rectangular box.
(d) Create the graph of the following function.
4. (a) Create following two matrices A and B with following elements.
Write R commands to do the following tasks:
(i) Multiply the two matrices.
(ii) Combine the two matrices row-wise.
(iii) Create a function that computes the following expression:
A2+3*B
(b) Create a data frame named RData consisting of the following data:
Write R commands to:
(i) Compute the group wise means of x, y and z according to the groups defined by w column using apply family function.
(ii) Sort RData according the y column of it.
IGNOU MST-15 (January 2024 – December 2024) Assignment Questions
1. Attempt the following:
(a) Write the output of the following statements:
(i) rep(x=c(T,F,T,F), times=c(2,1,2,3))
(ii) 5%/%3; diag(3)
(b) Differentiate between the use of the sep and collapse arguments of the paste() function.
(c) Write R commands to create a bar plot of the following data by using arguments of the used function for filling up the bars and to give labels to the axis:
5, 10, 8, 7, 8, 5, 8, 7, 5, 8, 9, 6, 8, 8, 8
(d) Check whether the given loop is finite or infinite. If infinite, do the necessary changes in the written loop to make it finite.
x<-0
repeat{
print(x^2)
x<-x+1
if(x<5) print(x) }
2. The following data relates to the number of items produced per shift by two workers for a number of days.
(a) Write R command to create a list named LT with worker’s data. Also, after creating the list, do the following tasks:
(i) Use a suitable loop function to compute the mean of number of items produced by each worker in a single line command.
(ii) Extract the worker A data from it by using two different approaches.
(b) Write R command to create a data frame named DF with worker’s data and do the following tasks:
(i) Use suitable function to remove NA from the data and then create a scatter plot.
(ii) Write the known data obtained in step (i) to a .txt file named “WORK”.
3. Write R commands to:
(a) Create a function to compute ranks (in case of tied ranks) of the given data.
(b) Create a date object named Ddata consisting of the following dates.
26Jan2023, 15Aug2023, 02Oct2023, 05Sep2023
(c) Create an array of two dimension with following elements
Also, extract the row shown in the rectangular box.
(d) Create the graph of the following function.
4. (a) Create following two matrices A and B with following elements.
Write R commands to do the following tasks:
(i) Multiply the two matrices.
(ii) Combine the two matrices row-wise.
(iii) Create a function that computes the following expression:
A2+3*B
(b) Create a data frame named RData consisting of the following data:
Write R commands to:
(i) Compute the group wise means of x, y and z according to the groups defined by w column using apply family function.
(ii) Sort RData according the y column of it.