0% found this document useful (0 votes)
2 views14 pages

Data Science Using R

The document contains a comprehensive set of questions and answers related to the R programming language, covering topics such as data types, functions, control structures, and data manipulation. Each question is presented with multiple-choice options, and the correct answer is indicated. This resource serves as a study guide for individuals looking to enhance their knowledge and skills in R.
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)
2 views14 pages

Data Science Using R

The document contains a comprehensive set of questions and answers related to the R programming language, covering topics such as data types, functions, control structures, and data manipulation. Each question is presented with multiple-choice options, and the correct answer is indicated. This resource serves as a study guide for individuals looking to enhance their knowledge and skills in R.
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/ 14

Q.

No
. Question Option A Option B Option C Option D Answer
1 What is the full form of R in the context of data analysis? Regression R Project Randomization Runtime R Project

2 Where can R be downloaded from? CRAN Github SourceForge PyPI CRAN

3 Which of the following is NOT a commonly used IDE for R? RStudio Jupyter Notebook Notepad++ PyCharm Notepad++

4 What is the command to install a package in R? install.pkg() install.packages() library() load.pkg() install.packages()

5 How do you check the working directory in R? get.dir() getwd() dir.get() pwd() getwd()

6 Which of these is a basic data type in R? String Dictionary Tuple Data Frame String

What is the R command to view the first few rows of a


7 head() top() show() tail() head()
dataset?

8 What symbol is used to assign values to variables in R? <- = -> := <-

9 What does NA represent in R? Non-assignable value Not Available (Missing) Numeric Array Null Attribute Not Available (Missing)

10 How do you combine elements into a vector in R? combine() c() vector() concat() c()

11 What function creates a matrix in R? matrix() mat() mat.create() array() matrix()

Which function helps in checking the structure of an object in


12 structure() str() check() type() str()
R?
Which data structure can store elements of different data
13 Vector Matrix List Array List
types?

14 How do you subset a vector to extract specific elements? sub() extract() [] {} []

15 What is the default way to read CSV files in R? read_csv() read.csv() import_csv() load_csv() read.csv()

16 What function is used to create a data frame in R? data.frame() create_df() frame() new.data.frame() data.frame()

17 Which package is primarily used for data manipulation in R? dplyr ggplot2 tidyr readr dplyr

18 How do you install the dplyr package? install.dplyr() install.packages() library(dplyr) install_dplyr() install.packages()

19 What does the select() function in dplyr do? Select rows Select columns Filter rows Rename columns Select columns

Which function in dplyr is used to filter rows based on a


20 subset() where() filter() select() filter()
condition?
Which function is used to arrange data in ascending or
21 order() arrange() sort() organize() arrange()
descending order?
Modify an existing
22 What does the mutate() function in dplyr do? Create new columns Delete columns Rename columns Create new columns
column

23 How do you rename columns in a data frame using dplyr? rename() colnames() set_names() modify_col() rename()

24 How can missing values be identified in R? check.NA() is.na() NA() na_check() is.na()

Using row and column Using logical


25 Which of the following is NOT a method to subset a matrix? Using [ ] Using $ Using $
indices conditions

26 What is the primary object type for storing tabular data in R? Data Frame List Array Vector Data Frame

How do you calculate the mean of a vector ignoring NA mean(x,


27 mean(x, na.rm=TRUE) mean.na(x) avg(x, na.rm=TRUE) mean(x, na.rm=TRUE)
values? remove.na=TRUE)
Groups data for Groups data for
28 What does the group_by() function in dplyr do? Filters grouped data Sorts grouped data Renames groups
summary summary

29 Which function in dplyr is used for summarizing data? summary() summarize() aggregate() summ() summarize()

30 What function loads an external package in R? load() library() install() require() library()

31 How do you write data to a CSV file in R? write.csv() save_csv() export_csv() save() write.csv()

What is the function to check the number of rows in a data


32 nrow() row_count() numrows() count.rows() nrow()
frame?

33 How do you check the data type of an object in R? typeof() type() datatype() class() typeof()

34 Which of these is used to concatenate strings in R? cat() concat() paste() join() paste()

35 Which function converts a data frame column into a factor? as.factor() convert.factor() make.factor() to_factor() as.factor()

36 How do you remove missing values from a vector? remove.na() na.omit() omit.na() drop_na() na.omit()

37 What is the default separator when reading a CSV file in R? Comma Tab Space Semicolon Comma

Which function provides a summary of each column in a data


38 describe() summary() colsummary() summarize() summary()
frame?
Dimensions of an Dimensions of an
39 What does the dim() function return? Number of rows Number of columns Structure of data
object object

40 How do you combine two data frames vertically in R? combine() rbind() cbind() vbind() rbind()

How do you merge two data frames by a common column in


41 merge() join() combine() connect() merge()
R?
Applies a function to Applies a function to
42 What does the apply() function do in R? Filters rows Renames columns Groups data
margins of an array margins of an array

43 How do you list all objects in the current workspace? list() ls() objects() show_objects() ls()

44 How can you remove an object from the workspace? delete(obj) rm(obj) remove(obj) del(obj) rm(obj)

Avoids using $ for Avoids using $ for


45 What is the purpose of the with() function in R? Combines data frames Subsets data Summarizes data
columns columns
Which function in dplyr is used to select distinct rows in a data
46 unique() distinct() select_distinct() filter_distinct() distinct()
frame?

47 What does %>% represent in dplyr? Pipe operator Logical OR Logical AND Concatenation Pipe operator

48 How do you check installed R packages? installed.packages() check.packages() list.packages() packages.list() installed.packages()

49 How do you remove a column from a data frame in R? drop() select(-column_name) remove_column() delete.column() select(-column_name)

50 How do you add a new column to a data frame in R? mutate() add_column() append_column() cbind() mutate()

Matches a pattern in a Matches a pattern in a


51 What is the use of the grep() function in R? Renames strings Filters columns Converts to factor
string string

52 How can you group data based on a column in dplyr? arrange() group_by() filter() summarize() group_by()

Counts rows in each Calculates unique Counts rows in each


53 What does n() do in a dplyr summarization? Computes the mean Groups by count
group values group

54 How do you load a CSV file as a data frame? load.csv() read.csv() import_csv() load.data() read.csv()

55 Which of the following is not a data type in R? Integer Character Tuple Logical Tuple

56 What function is used to create sequences in R? seq() range() sequence() seq.range() seq()

57 Which of these methods cannot be used to subset data? Logical conditions Using indices Using $ Using @ Using @

Filters rows based on Filters rows based on


58 What does the filter() function do in dplyr? Filters columns Removes duplicates Sorts data
conditions conditions

59 What is the primary purpose of the tidyr package? Data visualization Data manipulation Data cleaning Data import/export Data cleaning

Which function is used to calculate the standard deviation in


60 var() mean() sd() summary() sd()
R?

Error Hello TRUE NULL Hello


1 What is the result of if(TRUE) print("Hello")?

The else statement is executed when the if condition is: TRUE FALSE NULL Undefined FALSE
2
Which keyword is used to exit a loop prematurely? stop break next exit break
3

What does the next statement do in a loop? Skips current iteration Stops the loop Restarts the loop Exits the loop Skips current iteration
4
Repeat commands for
The for loop in R is used to: Iterate over elements Infinite looping Recursive operations Iterate over elements
5 specific times
Executes until a Executes for a fixed Executes until a
What is the purpose of a while loop? Executes indefinitely Executes only once
6 condition is met number condition is met

What will for(i in 1:3) print(i) output? NULL Error 123 Prints nothing 123
7
function() funct() function()
How do you create a user-defined function in R? def() keyword lambda() keyword
8 keyword keyword keyword

Which function checks argument names in R? argnames() formals() match.args() argument() match.args()
9
Arguments are Arguments are Arguments are always Arguments are
What does "lazy evaluation" mean in R functions? Arguments are ignored
10 evaluated eagerly evaluated as needed NULL evaluated as needed
Pass unknown Limit function Pass unknown
The ... argument in a function is used to: End function execution Repeat arguments
11 arguments parameters arguments

What is the output of apply(matrix(1:9, 3), 1, sum)? 12 15 18 6 15 24 15 18 21 6 12 18 6 12 18


12
lapply() returns: A vector A data frame A list A matrix A list
13
sapply() simplifies the output of lapply()
A data frame A matrix A vector NULL A vector
14 into:

Which function is used for splitting data into subsets? divide() split() subset() tapply() split()
15

The tapply() function applies a function to: Rows Columns Groups Individual elements Groups
16

Which function calculates row sums in a matrix? apply() rowSums() colSums() rowMeans() rowSums()
17
Which function allows simultaneous iteration over multiple
mapply() tapply() rapply() capply() mapply()
18 arguments?

What is the output of mean(c(2, 4, 6))? 4 6 2 NULL 4


19

The split() function is particularly useful for: Grouping data Merging data Sorting data Flattening lists Grouping data
20
Which control structure is best used when the number of
for loop while loop repeat loop break loop while loop
21 iterations is not known in advance?
What happens if the condition in a while loop never becomes
Stops immediately Infinite loop Skips iterations Executes once Infinite loop
22 FALSE?

What is the purpose of return() in an R function? To stop the loop To return a value To skip an argument To restart the function To return a value
23
Which of the following is not a valid R control structure? repeat do-while if-else for do-while
24
Element-wise
The apply() function is mainly used for: Row-wise operations Array/matrix operations Conditional execution Array/matrix operations
25 operations
colMeans() calculates: Column means Row means Element means Group means Column means
26

The result of sapply(list(1:3, 4:6), mean) is: A list A vector A matrix NULL A vector
27

What does split(1:10, rep(1:2, each = 5)) return? A vector A list A matrix NULL A list
28
Which loop function is best for applying a function across
mapply() tapply() rapply() sapply() mapply()
29 multiple objects at once?
What does the following function return? function(x = 1, y) x +
Error x+y x NULL Error
30 y
What is the output of if(FALSE) { print("Yes") } else {
Yes No Error NULL No
31 print("No") }?

Which function is used to get cumulative sums of a vector? sum() cumsum() rowSums() cummean() cumsum()
32

What does the names() function do for lists or vectors? Assigns dimensions Assigns/returns names Changes length Returns classes Assigns/returns names
33
Checks function Displays function Changes function Returns function Displays function
What is the use of the formals() function?
34 arguments arguments arguments output arguments

Lazy evaluation delays argument evaluation until: Argument definition Argument use Argument pass Argument return Argument use
35
apply() can operate on: Lists Vectors Arrays NULL Arrays
36

Which function can split a data frame by factors? split() subset() divide() group() split()
37
Generate repeated Generate repeated
The replicate() function is used to: Repeat vectors Create multiple loops None of the above
38 simulations simulations

What is the default margin in apply() for a matrix? 1 2 c(1, 2) 0 c(1, 2)


39
tapply() requires which of the following
Vector only Function only Factor and function List and vector Factor and function
40 arguments?

The mapply() function is a multivariate version of: lapply() sapply() tapply() apply() lapply()
41

In a custom function, default argument values are specified: Using "=" Using "<-" Using "->" Using ":" Using "="
42

Which function calculates cumulative products in R? cumprod() cumsum() cummean() None of the above cumprod()
43

The dim() function can be applied to: Vectors Matrices and arrays Data frames only Scalars Matrices and arrays
44
Which function returns row indices where a condition is met? rowSums() which() where() apply() which()
45

What will split(mtcars, mtcars$cyl) do? Split into cylinders Error Split into groups Split into lists Split into groups
46

Which of these loop functions does not simplify results? sapply() vapply() lapply() apply() lapply()
47

Which loop function works for vectors with length constraints? vapply() lapply() sapply() rapply() vapply()
48

Which loop is guaranteed to execute at least once? for while repeat None of these repeat
49
Return object
What is the role of cat() in R? Combine vectors Print to the console Create data frames Print to the console
50 structure
A vector of squared
What is returned by lapply(1:3, function(x) x^2)? A list of squared values A matrix NULL A list of squared values
51 values

Can ifelse() return different types of values? Yes No Only numeric values Only logical values Yes
52

Which function is used to repeat an action indefinitely? for while repeat mapply() repeat
53
Check mode of a Check length of a
The typeof() function is used to: Check type of a variable Check dimensions Check type of a variable
54 variable variable

The t() function in R is used to: Transpose a matrix Calculate mean Multiply elements None of the above Transpose a matrix
55
Depends on margin Depends on margin and
What does apply() return when used on a data frame? A vector A matrix A data frame
56 and function function

Which function calculates column means efficiently? rowMeans() colMeans() apply() tapply() colMeans()
57

Which of these supports anonymous functions? apply() lapply() sapply() All of the above All of the above
58
Which R function checks if all elements of a vector satisfy a
all() any() sum() mean() all()
59 condition?

How can you extract the first element of each group in a list? lapply(list, first) sapply(list, "[[", 1) apply(list, 1) None of the above sapply(list, "[[", 1)
60
What is the primary purpose of data visualization in
1 Data storage Data presentation Data transformation Data cleaning Data presentation
descriptive analytics?

2 Which R function is commonly used to create bar charts? plot() barplot() hist() pie() barplot()

Relationships between Frequency Relationships between


3 A scatter plot is best suited for visualizing: Categories Trends
variables distributions variables

4 In R, which function is used to add a title to a plot? main() title() add.title() plot.title() main()

5 What does the pch parameter control in R plots? Line width Marker type Color of the plot Size of the plot Marker type
Using the barcol Using the color Using the barColor
6 How can you change the color of a bar in a bar chart in R? Using the col argument Using the col argument
argument function argument

7 Which function is used to create line graphs in R? line() lines() plot() graph() lines()

Which library in R is specifically designed for advanced data


8 dplyr ggplot2 tidyr base ggplot2
visualization?

9 What does the legend() function in R do? Adds a legend to a plot Sets plot labels Adjusts color settings Creates line graphs Adds a legend to a plot

Which argument is used to adjust the size of points in a scatter


10 size cex pch col cex
plot in R?

11 In a line graph, what does the type = "l" argument signify? Add points Draw a line Add a legend Set line width Draw a line

Setting the zoom Rescaling the plot


12 How do you zoom into a specific region of a plot in R? Using zoom() Adjusting xlim and ylim Adjusting xlim and ylim
argument window
Comparing Comparing categorical Visualizing multivariate Visualizing Visualizing multivariate
13 Parallel coordinates plots are used for:
distributions variables data geographical data data

14 Which package is used in R for creating geographical maps? maps ggplot2 mapdata All of the above All of the above

15 Which function in R is used to add grid lines to a plot? grid() abline() lines() points() grid()

Highlighted as separate
16 How do you represent missing data in plots in R? NA points removed Transparent points All of the above All of the above
category

17 Which function is used to create a histogram in R? barplot() hist() scatter() pie() hist()

18 Which argument adjusts the legend position in ggplot2? pos legend.pos legend.position position legend.position

19 Which R function is used to create boxplots? plot() boxplot() bplot() ggboxplot() boxplot()

Adding a title to the Formatting the Adding a title to the


20 The ggtitle() function in ggplot2 is used for: Adding labels to axes Adding subtitles
plot legend plot

21 What is the default shape of points in ggplot2 scatter plots? Circle Triangle Square Cross Circle

22 Which function is used in ggplot2 to set axis labels? labs() xlabel() ylab() set_axis() labs()

23 In R, which function combines multiple plots into one window? par() layout() grid.arrange() combine() grid.arrange()

Creates multi-panel Creates multi-panel


24 What does the facet_wrap() function in ggplot2 do? Splits data into groups Adjusts axis limits Adds a title to the plot
plots plots
What is a major advantage of using ggplot2 over base R Better data
25 Easier customization Faster execution Less memory usage Easier customization
plotting? manipulation
Which argument is used to add transparency to points in a
26 alpha transparency opacity cex alpha
scatter plot?
27 The coord_flip() function in ggplot2 is used for: Rotating labels Flipping axes Changing color scales Reversing data order Flipping axes
geom_bar(size = geom_bar(heigh
28 How do you adjust the size of a bar in ggplot2 bar charts? geom_bar(size) geom_bar(width) geom_bar(width)
c()) t)

29 Which function in ggplot2 is used to add lines to a plot? geom_lines() geom_line() geom_path() geom_add() geom_line()

30 Which function is used to save plots created with ggplot2? save_plot() ggsave() save() plot.save() ggsave()

Adjusting plot Adding data to the Adjusting plot


31 What is the purpose of the theme() function in ggplot2? Adjusting data values Adjusting axes limits
aesthetics plot aesthetics

32 Which function in ggplot2 is used to create density plots? geom_density() density_plot() geom_area() geom_smooth() geom_density()

33 How do you represent a continuous variable as color in ggplot2? Using fill Using aes(color) Using aes(size) Using aes(shape) Using aes(color)

Which R package is commonly used for interactive


34 ggplot2 leaflet plotly Both B and C Both B and C
visualizations?
Sets manual scales for Sets manual scales for Sets manual scales for Sets manual scales for Sets manual scales for
35 What does the scale_fill_manual() function do in ggplot2?
points fill size shape fill
Interactive Interactive
36 What is the primary use of the plotly package in R? Data cleaning Statistical modeling Plot formatting
visualizations visualizations
Which function is used to visualize geographical data in the
37 addCircleMarkers() addMarkers() addPolygons() All of the above All of the above
leaflet package?

38 How do you add custom icons to a map in the leaflet package? add_custom() addCustomIcons() icon() addIcons() icon()

39 What type of plot does the ggmap package primarily support? Bar plots Line graphs Geographical maps Histograms Geographical maps

40 What is the main function of geom_boxplot() in ggplot2? Creating scatter plots Creating bar charts Creating box plots Creating line graphs Creating box plots

Which function in ggplot2 is used to adjust the plot


41 theme() adjust_bg() set_background() modify_bg() theme()
background?
Adding statistical Mapping data to Mapping data to
42 In ggplot2, what is the purpose of aes()? Adjusting plot width Adding legends
transformations aesthetics aesthetics
Which visualization method is best for exploring relationships
43 Bar chart Boxplot Scatter plot Pie chart Scatter plot
between two continuous variables?

44 What does the fill aesthetic control in ggplot2? Point size Line width Color of filled areas Data transparency Color of filled areas

45 What is the default theme in ggplot2? theme_gray() theme_bw() theme_minimal() theme_classic() theme_gray()

46 Which function in base R creates pie charts? piechart() pie() chart_pie() pie_graph() pie()

47 Which argument is used to add grid lines in a ggplot2 plot? grid() theme(panel.grid) panel_grid() grid_lines() theme(panel.grid)
48 Which function creates a heatmap in base R? heat() heatmap() geom_heat() plot_heat() heatmap()

49 How can you visualize frequency distribution in ggplot2? geom_histogram() geom_boxplot() geom_density() geom_bar() geom_histogram()

Creating circular bar


50 What is the use of coord_polar() in ggplot2? Creating pie charts Both A and B None of the above Both A and B
plots
Which argument in ggplot2 adjusts the size of the plot
51 size scale adjust_size element_size size
elements?

52 Which function adds a smooth line to a scatter plot in ggplot2? geom_path() geom_smooth() geom_line() geom_curve() geom_smooth()

53 In ggplot2, how do you set the x-axis limits? xrange() xlim() x_limits() coord_x() xlim()

54 Which visualization technique is best for showing proportions? Scatter plot Bar chart Pie chart Line graph Pie chart

55 What does the labs() function allow you to do? Change plot titles Modify axis labels Both A and B None of the above Both A and B

Inside the ggplot() Inside the ggplot()


56 How do you specify the dataset in ggplot2? Using data() Using dataset() Using set_data()
function function

57 Which of the following creates a vertical bar chart in ggplot2? geom_vbar() geom_col() geom_bar() geom_vert() geom_bar()

58 What is the default coordinate system in ggplot2? Cartesian Polar Logarithmic Geographical Cartesian

59 Which function in ggplot2 modifies legend properties? legend() theme() modify_legend() set_legend() theme()

60 Which argument adjusts the angle of axis text in ggplot2? text.angle angle.axis axis.text.angle angle axis.text.angle

1 Which function in R calculates the square root of a number? sqrt() abs() log() round() sqrt()
Calculate the absolute Calculate the absolute
2 The function abs() in R is used to: Calculate logarithm value Round off a number Find square root value

3 What is the purpose of the mean() function in R? Calculate median Calculate variance Calculate mean Calculate sum Calculate mean
Which function in R computes the standard deviation of a
4 dataset? sd() var() sqrt() summary() sd()
Both minimum and Both minimum and
5 The function range() in R returns: The range of a dataset The minimum value The maximum value maximum values maximum values

6 Which function is used to compute variance in R? sd() mean() var() range() var()
Basic statistical Cumulative frequency Basic statistical
7 The summary() function in R provides: summary Frequency distribution Box-plot visualization distribution summary
Compute standard
8 What does the scale() function in R do? Normalize data Find the mean deviation Calculate variance Normalize data
9 Which of the following functions calculates correlation in R? cor() cov() sd() var() cor()
Summarize a dataset Plot cumulative Summarize a dataset
10 A boxplot is used to: Display frequencies visually distribution Create pie charts visually

11 What is the output of the cov() function in R? Variance Correlation matrix Covariance matrix Standard deviation Covariance matrix
Show frequency Represent Show frequency
12 What is the primary use of a histogram? Compare categories distribution Visualize relationships proportions distribution
Which type of plot is ideal for visualizing the relationship
13 between two continuous variables? Histogram Scatterplot Boxplot Pie chart Scatterplot

14 In R, which function is used to create a pie chart? pie() barplot() hist() plot() pie()

15 What does the quantile() function in R calculate? Mean Quartiles Standard deviation Range Quartiles

16 The log10() function in R computes: Natural logarithm Base-10 logarithm Exponential function Square root Base-10 logarithm

17 Which function generates random numbers in R? random() rnorm() runif() Both B and C Both B and C
Generate random
18 The function set.seed() in R is used to: numbers Set a random seed Solve distributions Normalize a dataset Set a random seed
Which function simulates random sampling for a binomial
19 distribution in R? rbinom() rnorm() rpois() rexp() rbinom()
Solve binomial Simulate Poisson Simulate Poisson
20 What is the purpose of rpois() in R? problems distribution Normalize data Create histograms distribution
Which R function generates random numbers for a normal
21 distribution? rnorm() rbinom() runif() rexp() rnorm()
Exponential random Poisson random Normal random Uniform random Exponential random
22 What does rexp() in R generate? numbers numbers numbers numbers numbers

23 Which function creates a bar chart in R? hist() barplot() pie() boxplot() barplot()
Cumulative frequency Cumulative frequency
24 What type of table displays cumulative frequency distribution? Frequency table Contingency table table Summary table table
Which R function is used to calculate the product of all
25 elements in a vector? prod() sum() mean() range() prod()

26 What is a key feature of a box-and-whisker plot? Frequency distribution Quartiles and outliers Mean and median Random samples Quartiles and outliers

27 What is the output of the min() function in R? Minimum value Maximum value Range Mean Minimum value
How does the summary() function handle categorical Displays frequency Calculates mean and Displays frequency
28 variables? Shows quartiles distribution variance Ignores them distribution

29 Which plot is best for visualizing proportions of categories? Pie chart Histogram Scatterplot Boxplot Pie chart
30 What does the max() function in R return? Maximum value Minimum value Average value Standard deviation Maximum value
Rounds a number to an Rounds a number to Rounds a number to
31 What does the round() function in R do? integer specified decimals Finds the range Normalizes a dataset specified decimals
Which R function creates random numbers from a uniform
32 distribution? runif() rnorm() rbinom() rexp() runif()

33 What is the default number of bins in R's hist() function? 5 10 15 20 10


Compute correlation Generate random Compute correlation
34 What is the primary use of the cor() function? Compute variance coefficient numbers Create scatterplots coefficient

35 Which argument in rnorm() specifies the mean? sd lambda mean center mean

36 What does the rbinom() function's size argument represent? Number of trials Probability of success Number of bins Size of plot Number of trials

37 Which distribution is simulated using rpois()? Exponential Poisson Binomial Normal Poisson
Which function visualizes cumulative frequency distributions in
38 R? hist() barplot() pie() ecdf() ecdf()

39 How is a scatterplot created in R? scatter() plot(x, y) hist(x, y) boxplot(x, y) plot(x, y)

40 What is the default base of the log() function in R? e (natural log) 2 10 None of the above e (natural log)

41 What does the sd() function in R compute? Sum


Generate random Variance Standard deviation Correlation Standard deviation
Generate random
numbers from an Generate random numbers from an
42 What is the purpose of rexp() in R? exponential Generate normal data Poisson data Scale data exponential

43 Which R function is used to compute covariance? cor() cov() var() summary() cov()

44 Which argument in rpois() specifies the rate parameter? lambda prob mean size lambda

45 How can the axis limits of a histogram be adjusted in R? Using xlim() Using ylim() Both A and B Using grid() Both A and B
Compute the arithmetic Compute standard Compute the arithmetic
46 What is the purpose of the mean() function? Compute the median mean deviation Compute mode mean
Which plot is best for visualizing data spread and potential
47 outliers? Histogram Boxplot Bar Chart Pie Chart Boxplot

48 How is a normal distribution simulated in R? Using rnorm() Using rpois() Using runif() Using rexp() Using rnorm()

49 What does the sum() function in R return? Total of elements Mean value Count of elements Product of elements Total of elements

50 Which argument in hist() specifies the number of bins? bin breaks bins split breaks
Showing a frequency Visualizing summary Simulating random Visualizing summary
51 The boxplot() function is used for: table statistics Creating scatter plots numbers statistics

52 How is the cumulative frequency of a dataset calculated? Using cumsum() Using cumprod() Using sum() Using range() Using cumsum()

53 What is the use of the prod() function in R? Compute mean Compute product Compute range Compute variance Compute product

54 Which R function calculates quartiles? quantile() summary() scale() sd() quantile()


Compute standard
55 How is the var() function used in R? Compute variance deviation Compute correlation Compute quartiles Compute variance
Provide basic summary Provide basic summary
56 What is the role of the summary() function? Compute range stats Compute median Generate plots stats

57 Which R function is used to display frequency distribution? freq() table() hist() barplot() table()

58 Which plot would best represent proportions? Histogram Bar Chart Pie Chart Scatter Plot Pie Chart
How are random numbers generated for exponential
59 distribution? Using rpois() Using rbinom() Using rexp() Using runif() Using rexp()
What is the purpose of setting a seed in random number Generate cumulative
60 generation? Ensure reproducibility Change randomness Increase randomness distribution Ensure reproducibility

S.N
o. Questions
Explain the role of basic arithmetic operations and standard
functions like abs(), sqrt(), log(), and round() in data analysis.
1 Provide examples of their applications in R.
Discuss the use of statistical functions such as mean(), var(),
sd(), and quantile() in summarizing data. How do these
2 functions help in understanding the distribution of a dataset?
What is the purpose of the summary() function in R? Illustrate
how it provides a comprehensive overview of both numeric
3 and categorical data.
Describe the differences between a frequency distribution
table and a cumulative frequency distribution table. How can
4 these be constructed and visualized in R?
Explain the purpose of various plots like bar charts, pie charts,
histograms, and scatterplots in data visualization. Discuss
5 scenarios where each is most effective.
What is a Box-Whisker Plot? Explain its components, such as
the median, quartiles, and outliers, and provide an example of
6 how to create one in R.
Describe the process of simulating random numbers in R. How
do functions like runif(), rnorm(), and rpois() differ, and what
7 are their specific use cases?
Explain the importance of setting a random seed using
set.seed() in simulations. How does it ensure reproducibility in
8 random number generation?
Discuss how R can be used to solve problems related to
binomial, Poisson, normal, and exponential distributions.
9 Provide examples of functions like rbinom(), rpois(), rnorm(),
How can correlation and covariance be computed in R using
cor() and cov()? Discuss the differences between these two
10 measures and their significance in data analysis.
Explain the role of data visualization in descriptive analytics.
How does it help in identifying patterns and trends? Provide
1 examples of common visualization methods used.
Describe the differences between bar charts, line graphs, and
scatter plots. In what scenarios would you use each type of
2 visualization?
How can you edit charts and graphs in R using colors, size, and
legends? Provide examples demonstrating these
3 customizations.

Discuss the importance of rescaling and zooming in plots. How


4 do xlim() and ylim() in R facilitate better visualization?
What are Parallel Coordinates Plots, and how are they used to
visualize multivariate data? Provide an example to illustrate
5 their application.
Explain the process of visualizing geographical data in R.
Discuss the libraries commonly used for this purpose, such as
6 leaflet and ggmap.
Discuss how legends enhance the interpretability of plots.
Explain how to customize legends in ggplot2 using appropriate
7 functions and arguments.
How do colors affect the readability and interpretation of data
visualizations? Explain how to use color gradients to represent
8 variables in ggplot2.
Describe the applications of data visualization in real-world
scenarios such as business, healthcare, and environmental
9 studies. Provide examples of how visualizations aid decision-
What are the common challenges faced in creating effective
data visualizations? Discuss strategies to overcome these
10 challenges, with a focus on R's plotting libraries.

Explain the working of the if-else control structure in R with an


1 example. How does it handle logical conditions?
Describe the differences between for loops and while loops in
R. Provide examples to illustrate scenarios where each would
2 be appropriate.

What is the purpose of the next and break statements in R?


3 Explain their behavior within a loop using code snippets.
How do you create a custom function in R? Discuss the role of
function arguments, default values, and the use of return() in
4 returning results.
What is lazy evaluation in R functions? Provide an example to
show how R evaluates function arguments only when they are
5 used.
Explain the purpose of the ... (ellipsis) argument in R functions.
How does it help in extending functionality? Provide an
6 example.
Discuss the apply() function in R. How does it simplify
operations over matrices or arrays? Include examples
7 demonstrating row-wise and column-wise operations.

What are lapply() and sapply() functions in R? Compare their


8 usage, output types, and scenarios where each is suitable.
Explain how the split() function is used to divide a data frame
or vector into groups. Provide an example where data is
9 grouped by a factor and analyzed using tapply().
Discuss the role of mapply() in R. How does it differ from
lapply() and sapply()? Provide an example where mapply() is
10 used to iterate over multiple arguments simultaneously.

You might also like