Experiment 1
1. Which language is R an open source version of?
2. From which site we can download r programming application?
3. Name at least two programming paradigms in which you can write R code.
4. What is the command to create a vector of the numbers from 8 to 27? (Note: values may
vary)
5. What are the basic data types in R?
6. How do you define a function in R?
7. What is the difference between a vector and a list in R?
8. What is the name of the function used to search for help within R?
9. What is the name of the function used to search for R-related help on the Internet?
10. What is the operator used for integer division?
11. How would you check if a variable, x, is equal to pi?
12. Describe at least two ways of assigning a variable.
13. Which of the five numbers 0, Inf, -Inf, NaN, and NA are infinite?
14. Which of the five numbers 0, Inf, -Inf, NaN, and NA are considered not missing?
15. How did you implement the arithmetic operations (e.g., addition, subtraction, multiplication,
division) in your calculator?
16. What are the names of the three built-in classes of numbers?
17. What function would you call to find out the number of levels of a factor?
18. How might you convert the string “6.283185” to a number? (Note: values may vary)
19. Name at least three functions for inspecting the contents of a variable.
20. What is a variable in R, and how do you assign a value to it?
21. What functions are used to inspect the names of rows and columns in a data frame?
Experiment 2 and Experiment 3
22. How would you create a vector containing the values 0, 0.25, 0.5, 0.75, and 1? (Note:
values may vary)
23. Describe two ways of naming elements in a vector.
24. What are the dimensions of a matrix, and how do you check them?
25. How can you transpose a matrix in R?
26. What is the purpose of the dim attribute in an array?
27. What are some practical applications of arrays in R?
28. How do you check if an object is a vector, matrix, or array in R?
Experiment 4 and Experiment 5
29. Define Sieve of Eratosthenes.
30. How do you stop a repeat loop executing?
31. What is recursive function in R
32. What happens if you pass NA as a condition to if?
33. What are the types of loops available in R?
34. What is short-circuit evaluation in R, and how does it apply to && and ||?
35. What is the difference between a for loop and a while loop?
36. What is the use of [Link]() function in R?
37. Define cat() function. How is it different from print()?
38. Write the output of seq(3, n).
39. Define stop() function in R.
Experiment 6
40. Define Data sets.
41. Write the command to find all the datasets built into R and the packages on your machine?
42. What is the package name for dataset ‘mammals’?
43. Write command to find all the information of a dataset(example (airquality)?
44. How to print entire dataset mtcars
45. ______ command return first few rows and _______ command returns last few rows of given
dataset.
46. ______ command return variables(columns) and _______ command returns members(rows) of
given dataset.
47. What is scatter plot in R?
48. What are different plotting systems in R? Explain all of them
49. Write steps to install packages of ggplot2.
50. How can you define Covariance between two variables?
51. How can you define Correlation between two variables?
Experiment 7 and Experiment 8
52. What is the length of this list?
list(alpha = 1, list(beta = 2, gamma = 3, delta = 4), eta = NULL)
53. Assume 5 students of TJIT semester 3rd . Assign their USNs, Names, Branches and assigned
clubs. Create data frame for the same.
54. Consider above data frame and select all the students of ISE branch.
55. How do you create a data frame in R?
56. What function would you use to check the structure of a data frame?
57. How can you filter rows in a data frame based on a condition?
Experiment 9
58. What is CSV file?
59. Write command to create CSV file in folder of your system.
Experiment 10
1. How to install package ‘moments’?
2. Define skewness of a Histogram in R programming