0% found this document useful (0 votes)
27 views2 pages

R Programming QB

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)
27 views2 pages

R Programming QB

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
You are on page 1/ 2

R PROGRAMMING

QUESTION BANK -II


PART – A
1. Explain how the return() function works in R to return a value from a function. Give a
simple example where a function returns the sum of two numbers.
2. What will be the output of this R code?
 x <- c("a", "b", "c", "d")
 for(i in 1:4) {
+ ## Print out each element of 'x'
+ print(x[i])
+}
3. How does treating functions as objects in R enhance code flexibility?
4. Write a recursive function in R to calculate the factorial of a given positive integer.
5. Explain what replacement functions are in R and how they are utilized. Give a
example.
6. How can you customize the appearance of a graph in R using the ggplot2 package?
7. Classify how R can interface with other programming languages, such as Python or
C++, to enhance its functionality?
8. Difference between linear and non – linear model.
9. Write a brief example demonstrating how to use the kmeans function in R to cluster
a dataset?
10. Write a R program to find the sum of all even numbers between two given numbers
using for loop.
11. Write a R program that prints the fibonacci series.
12. Build a pie chart for the following expenditure information in the form of a vector:
Housing 600
Food 300
Clothes 150
Entertainment 100
Others 100

13. Illustrate with an example about recursive function in R.


14. Build a data frame which contains the following:
Player Name Score
AA 100
BB 200
CC 408
DD 19
Fetch players who scored more than 100 runs.
15. List some popular data visualization packages in R.
16. Compare supervised learning and unsupervised learning.
17. Differentiate between simple linear regression and multiple linear regression models.
18. Construct a bar plot for the temperatures in a week is given as
(35,42,38,25,28,36,40) also provide labels to axes.
19. What are the general list operations in R Program?
20. How to apply functions in matrix rows and columns?
21. List the arithmetic and Boolean operators?
22. Explain the tools for composing the code?
23. Define recursion in R Program?
24. What is returning value?
25. How to create the 3D plots with syntax and example?

PART – B
1. Apply different control flow structures in R to assess their impact on program
efficiency. How do if-else, for loops, and while loops perform in various scenarios, and
which is most suitable for specific tasks?
2. Explain how default values are used in R programming when defining functions. How
do default values affect the behavior of functions when arguments are omitted or not
provided?
3. Demonstrate how to create a 3D plot in R using sample data. How would you use
functions from libraries like plotly, rgl, or scatterplot3d to visualize three-dimensional
data, and what factors would you consider to ensure the plot is effectively presented?
4. Evaluate the performance of various time series forecasting models, such as ARIMA,
using an R dataset.
5. How would you analyze a time series dataset in R to check for stationarity using
functions from the tseries package? What visualizations (e.g., plot.ts(), ggplot2) would
you use to support your analysis?
6. Describe in detail about the implementation of principal compenent analysis (PCA)
7. Write a R program to create scatter plot, box plot, bar chat and explain the parameters
of each graph with neat examples.
8. Illustrate about linear models in R with suitable example.
9. Apply the concept of Exploratory data analysis in R using Diamond Dataset and
perform the following:
List the first 6 rows of the Dataset
List the dimensions of the Dataset
Visualize the data using any pairwise combination of variables
Create correlation matrix and round with 2 decimal places
Identify the missing values in the Dataset
10. Construct a R program to print numbers between 1 to 100 and skip the numbers which
are divisible by 3 and 5.
11. Explain with example about how to create 3D plots using R Programming.
12. Explain in detail about different types of clustering in R programming with suitable
examples.

You might also like