Question Bank in R – PROGRAMMING By RVS
UNIT-1
1. List the data structures in R with examples.
2. Write syntax of if else in R.
3. Write any 3 math functions in R.
4. Explain Datatypes in R
5. List the differences between vector and list.
6. Calculate the cummulative sum and cummulative product for the given data 23, 1, 7, -2, 8,
7. 10, 17
8. Explain in detail about dataframe and arrays with example R code.
9. Write R code to generate first n terms of a Fibonacci series
10. Create a 3-dimensional array in R.
11. Find the minimum and maximum for 14, 23, 16, 20, 0, -17, 100
12. Create a simple matrix with 3X3 size in R.
13. Find the factorial of 6. Find the mean, median, standard deviation of
14. 2,4,9,10,14,28,52.
15. Explain dnorm() function
16. What is a vector in R? Explain operations on vectors.
17. Write R function to check whether the given number is prime or not
18. Explain the functioning of lapply() and tapply() in a R program with one example
19. What is variable scope?
20. Distinguish between max( ) and pmax( ) functions.
2. Write syntax of if else in R.
3. Write any 3 math functions in R.
4. Explain Datatypes in R
5. List the differences between vector and list.
6. Calculate the cummulative sum and cummulative product for the given data 23, 1, 7, -2, 8,
7. 10, 17
8. Explain in detail about dataframe and arrays with example R code.
9. Write R code to generate first n terms of a Fibonacci series
10. Create a 3-dimensional array in R.
11. Find the minimum and maximum for 14, 23, 16, 20, 0, -17, 100
12. Create a simple matrix with 3X3 size in R.
13. Find the factorial of 6. Find the mean, median, standard deviation of
14. 2,4,9,10,14,28,52.
15. Explain dnorm() function
16. What is a vector in R? Explain operations on vectors.
17. Write R function to check whether the given number is prime or not
18. Explain the functioning of lapply() and tapply() in a R program with one example
19. What is variable scope?
20. Distinguish between max( ) and pmax( ) functions.
221.
R pmax Function
pmax() function returns the
parallel maxima vector of multiple vectors or matrix.
pmax(..., na.rm = FALSE)
...: Numeric or character
arguments
na.rm: whether missing
values should be removed
> x <- c(3, 26, 122,
6)
> y <- c(43,2,54,8)
> z <- c(9,32,1,9)
> pmax(x,y,z)
[1] 43 32
122 9
222.
Explain about quote( ) function.
Justify the following: “R functions are first-class objects”. Please explain.
ReplyDelete