0% found this document useful (0 votes)
18 views3 pages

R-Programming Practice Exercises 2025

The document outlines a comprehensive R programming practice activity divided into four sections. It covers fundamental concepts such as arrays, data frames, and various R objects, along with practical exercises involving data manipulation, statistical analysis, and visualization. Additionally, it includes tasks related to importing datasets from external sources and performing descriptive and inferential statistics.

Uploaded by

Guru Gondabal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views3 pages

R-Programming Practice Exercises 2025

The document outlines a comprehensive R programming practice activity divided into four sections. It covers fundamental concepts such as arrays, data frames, and various R objects, along with practical exercises involving data manipulation, statistical analysis, and visualization. Additionally, it includes tasks related to importing datasets from external sources and performing descriptive and inferential statistics.

Uploaded by

Guru Gondabal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

R Programming Practice Activity

Section-1: Introductory Practice activity


1. Describe about ‘array’ function in R programming code
2. Describe about Arrays and Matrices
3. Describe about R data frames
4. Describe about R objects namely Vectors
5. Describe about the R Objects Lists and Factors
6. Describe with illustrations about the Logical and Assignment Operators
7. Discuss with illustration about the Arithmetic and Relational Operators
8. Explain about ‘data frame’ with suitable R programming
9. Explain how data frames will be created after creating the vectors in R programming.
10. Explain the procedures of vector element sorting with R
11. Give all the data types of a variable in a valid R program
12. How R programming is more advantageous than other statistical computing soft wares
13. Provide some valid and invalid syntax of R program code for defining variables.
14. What are the chief characteristics of R programming?
15. What are the types of Data in R programming?
16. Write about data reshaping in R programming
17. Write about different aspects of Variables in R programming
18. Write about different R-functions
19. Write about different windows and their functions of R studio
20. Write about R-Loops
21. Write about R-Strings
22. Write about the functions and arguments in R programming
23. Write the steps of installing R software on to your desktop

Section-2: Data sets from R-Flat form


24. Describe the procedures of extracting data from the data frame, including extraction of specific rows,
specific columns while writing and executing in R programming.
25. Provide some illustrative program codes and the outputs regarding various matrix
computations. Provide R code and outputs on how the expansion of data can be done by
adding rows and adding columns to a data frame.
26. Writ the codes and get the outputs for creating a new Data Frame with some specific variables,
getting top 6 and bottom 6 records, and know the name so the variables in the data Aids2 of MASS
data package.
27. Write a program code in R and also present the respective results to get user defined
functions of finding different types of means using a data of your choice from MASS
package
28. Write a program code in R and also present the respective results to get user defined
functions of finding sums, sum of squares, product sum of two vectors, square root of sums
of squares when the data set deals with two variables
29. Write a program code of finding descriptive statistics say Min, Max, IQR, Range, Median, Mean,
number of observations (size), Variance, Standard Deviation, etc. to the suitable variables for the data
set Animals of MASS data package.
30. Write a program code to find the values of correlation coefficient, intercept and regression
coefficient in a fitting of regression line for any data of your choice in MASS.
Page 1 of 3
31. Write a simple program code and give the output of it in creation of vector with
characteristics and numeric values and also describe the programme code by using the
function “seq( )” and c( ) for numerical and characteristic elements
32. Write R program code and obtain the output for any sampled data to Compute and test the
significance of correlation coefficients of different types
33. Write R program code and obtain the output for any sampled data to Compute and test the
significance of correlation coefficients of different types
34. Write the program code and obtain the outputs for any 6 built in statistical functions and
summary of data cars93 from the data package MASS using R.
35. Write the program code in R for finding A.M., G.M. and HM with user defined function and
also get the outputs with some sample data.
36. Write the program codes and out get the outputs of Quartile deviation and standard
deviation for two variables of any data in MASS package

Section-3: Data Sets to be Created on own


37. Create two data frames X and Y with variables A, B, C, D as,
(i) Merge A and B with rows alignment and get the data frame X
(ii) Merge C and D with column Alignments and get the data frame Y
38. Create a data frame by name “student” containing the following details:
Age: 20, 20, 21, 23, 21, 20, 23, 24, 21
Gender: M, M, F, F, F, M, M, F, F
CGPA: 4.3, 5.2, 8.1, 8.9, 9.2, 4.6, 6.7, 7.5, 5.6
(i) Display the records (rows) corresponding to Males.
(ii) Obtain the average CGPA for students above 21 years of age
39. Create a data frame by name “Student Bio Profile” containing the variables detailed below:
Age: 25 23 24 23 22 21 23 24 23 22 24 23 25 20 21
Weight: 67 65 65 59 58 69 71 74 72 75 76 77 78 65 69
Height: 5.2 5.8 5.9 5.5 5.6 5.1 5.9 5.5 5.8 5.7 6.0 6.1 5.9 5.8 6.1
(i). Find the Variance, Mean, CV and Median of Age, Weight, Height
(ii). Find the correlation coefficients between each two variables of Age, Weight and Height
and comment on the significance of correlation
40. The following data relate to the height (in centimeters) of two groups of randomly selected people.
Group 1: 121, 132, 137, 150, 161, 135, 162, 155
Group 2: 122, 124, 132, 130, 140, 137, 138, 129
(i) Draw a box plot of the height of the two groups.
(i) Test the significance of difference between the average heights of two groups
41. The following data related to the height (in centimeters) of male and female groups of randomly
selected people.
Male 165 156 157 161 143 156 169 178 177 165 176 180
Female 145 156 155 153 156 155 154 153 155 158 159 160
(i) Draw a box plot of the height of both males and female.
(ii) Test the significance of difference between the average heights of Male and female
42. Create a data frame by name “Student Bio Profile” containing the variables detailed below:
Age(years): 25 26 24 26 22 21 26 24 26 22 24 26 25 20 21
Gender: M F M M M M M F F F F M M F M
Weight(kg): 67 65 65 59 58 69 71 74 72 75 76 77 78 65 69

Page 2 of 3
Height(feet): 5.2 5.8 5.9 5.5 5.6 5.1 5.9 5.5 5.8 5.7 6.0 6.1 5.9 5.8 6.1
Skin Colour: F D F F D F D D D F F F D D D
+ - - - + + + + + - + +
Blood Group: O A B B B A O A A B B O O+ A- B-
Find the average heights, Average weights, average age of Males and females separately and
test the significance of difference between Males & Females
43. Get the data set Animals from the package Mass of R and (i) find the correlation between the
variables brain weight and body weigh; (ii) Plot the scatter diagram for Log(body weight) and
log (brain weight)
44. Create a data frame with at least one numerical vector and one characteristic vector with a length
of 15 elements and find the (i) Largest and smallest values of them; (ii) Model values; (iii)
Medians; (iv) Summary values of variables
45. Create a data frame by name “Student Bio Profile” containing the variables detailed below:
Age: 25 23 24 23 22 21 23 24 23 22 24 23 25 20 21
Gender: M F M M M M M F F F F M M F M
Weight: 67 65 65 59 58 69 71 74 72 75 76 77 78 65 69
Height: 5.2 5.8 5.9 5.5 5.6 5.1 5.9 5.5 5.8 5.7 6.0 6.1 5.9 5.8 6.1
Skin Colour: F D F F D F D D D F F F D D D
Blood Group: O A B B B A O A A B B O O+ A- B-
+ - - - + + + + + - + +

(i). Find the frequencies of Gender, Skin Colour and Blood Group using R code
(ii). Find the summary statistics of age, weight and height
46. Create a data frame by name “student” containing the following details: Age: 22, 20, 21, 24,
21, 25, 23, 24, 20; Gender: M, M, F, F, F, M, M, F, F; Height: 165, 164, 177, 168, 178, 169,
160, 163, 171. With the above data frame,
(i) Display the records (rows) corresponding to Females.
(ii) Obtain the average heights of Male and Female students.
(iii) Find the mean ages of male and female
(iv) Find standard deviations of heights of male and females
47. Twelve patients gave the following results for percentage absorbed on two days:
Day 1: 35.5 16.6 13.6 42.5 39 29.5 28.5 36.0 19.7 42.0 30.3 24.5
Day 2: 27.6 15.1 12.9 30.5 23.1 14.5 35.5 27.5 16.1 18.9 32.5 24.5
Calculate Pearson’s correlation and spearman’s rank correlation coefficient.

Section-4: Data sets to be imported from Excel CSV files


48. Import the data from the BP Patients data. Explore all the Descriptive statistics for the
categorical and Continuous scaled data variables. The data Link:
https://mail.google.com/mail/u/1/#sent/QgrcJHsbcVNzhvspHzzVTQPdXLBFLzGkjDV?pro
jector=1&messagePartId=0.1
49. Import the data by name Cancer -Blood Profile Data from the following link:
https://mail.google.com/mail/u/1/#sent/KtbxLzfhZJWxZtNXrcCMjJSBLfcHmDBrqq?proje
ctor=1&messagePartId=0.1 do all the maximum possible Descriptive statistics, Relational
Statistics, Inferential Statistics.
50. Import the data by name Cancer-Metal & Lipid Profile Data from the following link:
https://mail.google.com/mail/u/1/#sent/KtbxLvHgQfwGzjRLPLCMHdVwvGtwplGMbV?p
rojector=1&messagePartId=0.1 Perform ANOVA, Explore maximum possible Descriptive
statistics, Relational Statistics, Inferential Statistics, Predictive and Prescriptive Statistics.

Page 3 of 3

You might also like