0% found this document useful (0 votes)
5 views1 page

R Experiments

The document outlines a series of R programming tasks, including generating even numbers, checking for sparse matrices, and performing various mathematical operations such as summing elements and calculating factorials. It also includes statistical analysis tasks, such as testing the mean scores of students and comparing mileage between two types of gasoline. Additionally, it involves creating user-defined functions for sorting and searching within vectors.

Uploaded by

satyamshivam.in
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

R Experiments

The document outlines a series of R programming tasks, including generating even numbers, checking for sparse matrices, and performing various mathematical operations such as summing elements and calculating factorials. It also includes statistical analysis tasks, such as testing the mean scores of students and comparing mileage between two types of gasoline. Additionally, it involves creating user-defined functions for sorting and searching within vectors.

Uploaded by

satyamshivam.in
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

Write a R program to generate the even numbers from 1 to 30


2. Write a R program to check whether the given matrix is sparse matrix or not. (The
number of zeros in the matrix must be greater than the other elements in sparse matrix)
3. Write a script that read two vectors V1 and V2 containing values (49, 21, 34, 53, 11) and
(14, 49, 53, 34, 81). Find out the values of V1 that are not present in V2.
4. Write a R program to search a number in a list
5. Write a R program to sum the matrix elements
6. Write a R program to sum even numbers and odd numbers between 1 and 20.
7. Write a R program to check whether the given number is Armstrong number or not.
8. Write a R program to calculate Factorial of a number
9. Write a R program to display the Fibonacci series
10. Create a function that finds out the sum of digits of the given number passed to the
function
11. Write a R program to check whether the given number is vowel or not
12. Create a user defined function that finds the sum, mean, median, variance of a number
vector
13. Create a user defined function that perform bubble sort in R
14. Create a user defined function that perform selection sort in R
15. Create a user defined function that performs binary search on a numeric vector.
16. A professor wants to know if her introductory statistics class has a good grasp of basic
math. Six students are chosen at random from the class and given a math proficiency test.
The professor wants the class to be able to score above 70 on the test. The six students get
the following scores:62, 92, 75, 68, 83, 95. Can the professor have 90% confidence that
the mean score for the class on the test would be above 70.
17. We want to compare the heights in inches of two groups of individuals. Here are the
measurements:
X: 175, 168, 168, 190, 156, 181, 182, 175, 174, 179
Y: 120, 180, 125, 188, 130, 190, 110, 185, 112, 188
18. A study was performed to test wether cars get better mileage on premium gas than on
regular gas. Each of 10 cars was first filled with regular or premium gas, decided by a
coin toss, and the mileage for the tank was recorded. The mileage was recorded again for
the same cars using other kind of gasoline. Determine wether cars get significantly better
mileage with premium gas.
Mileage with regular gas: 16,20,21,22,23,22,27,25,27,28
Mileage with premium gas: 19, 22,24,24,25,25,26,26,28,32

You might also like