Q61
Q61 Which dplyr function is used to summarize multiple values into a single value?
summarize()
collect()
condense()
reduce()
Q62
Q62 What is the purpose of the group_by() function in dplyr?
To split a data frame into groups based on one or more variables
To arrange groups in a specific order
To merge two groups
To compare groups
Q63
Q63 What does the arrange() function in dplyr do when applied to a data frame?
It arranges the rows in descending order
It arranges the rows based on the values in one or more columns
It randomly arranges the rows
It converts the rows into columns
Q64
Q64 Which function in dplyr is best for changing the names of columns in a data frame?
rename()
alter()
change()
modify()
Q65
Q65 How can you combine two data frames vertically using dplyr?
bind_rows()
merge()
concat()
union()
Q66
Q66 What dplyr function would you use to join two data frames by columns when the columns have different names in each frame?
join()
merge()
full_join()
left_join(), with the by argument specifying the matching columns
Q67
Q67 How do you create a new column in a data frame that calculates the logarithm of an existing column in dplyr?
mutate(log_column = log(existing_column))
create(log_column = log(existing_column))
add(log_column = log(existing_column))
set(log_column = log(existing_column))
Q68
Q68 Why might changes made by mutate() in dplyr not appear in the original data frame?
mutate() does not modify in place
mutate() syntax errors
mutate() used on an empty data frame
mutate() is not supported for data frames
Q69
Q69 What could cause summarize() in dplyr to return fewer rows than expected when using a group_by() statement?
Incorrect grouping
Exclusion of NA values in groups
Overly restrictive aggregation functions
Summarize is case-sensitive
Q70
Q70 What is ggplot2 primarily used for in R?
Database management
Statistical analysis
Data visualization
Machine learning
Q71
Q71 Which ggplot2 function is used to create a scatter plot?
ggsave()
ggplot() + geom_point()
ggplot() + geom_line()
ggplot() + geom_histogram()
Q72
Q72 In ggplot2, what does the aes() function specify?
Data sources
Aesthetics mappings
Plot dimensions
Saving options
Q73
Q73 What is the purpose of the facet_wrap() function in ggplot2?
To wrap text labels
To create multi-panel plots
To apply themes to plots
To adjust plot margins
Q74
Q74 How does theme() function affect a ggplot2 plot?
It changes the data source for the plot
It modifies aesthetic attributes
It alters plot appearance by modifying non-data components
It adjusts data alignment
Q75
Q75 Which function saves a ggplot2 plot to a file?
ggsave()
ggplot_save()
save_ggplot()
export()
Q76
Q76 To add a linear regression line to a scatter plot in ggplot2, which function would you use?
geom_smooth(method = "lm")
geom_line()
geom_path()
geom_segment()
Q77
Q77 How do you add labels to the axes in a ggplot2 plot?
labs(x = "X-axis label", y = "Y-axis label")
annotate()
labels()
axis_lab()
Q78
Q78 What does setting the alpha parameter in ggplot2 accomplish?
It adjusts the plot's aspect ratio
It changes the data points' color
It sets the transparency of elements
It scales the axes
Q79
Q79 If a ggplot2 plot appears empty, what might be a common issue?
Missing data
Incorrect data mappings in aes()
Data not loaded into R
All listed issues
Q80
Q80 What could cause the colors in a ggplot2 plot to not display as expected?
Incorrect color names in the aes() function
Incompatible color values
Misconfigured display settings
Both incorrect color names and incompatible color values
Q81
Q81 What function is used to calculate the mean of a numeric vector in R?
mean()
average()
median()
sum()
Q82
Q82 Which function in R provides a summary of the central tendency, dispersion, and shape of a dataset’s distribution?
summary()
describe()
info()
data_summary()
Q83
Q83 In R, what does the sd() function calculate?
Standard deviation
Sum of deviations
Sample distribution
Standard data
Q84
Q84 What is the purpose of the cor() function in R?
To perform correlation analysis between two or more variables
To compare datasets
To merge data frames
To create plots
Q85
Q85 How do you test for normality of a dataset in R?
Using the norm.test() function
Using the shapiro.test() function
Using the normality() function
Using the gauss.test() function
Q86
Q86 What R function is used to generate a linear model for regression analysis?
lm()
linear()
regression()
model()
Q87
Q87 How can you generate a frequency table of a categorical variable in R?
table()
freq()
categorical()
group()
Q88
Q88 What is the R command to calculate the median of a numeric vector?
median()
middle()
center()
mean()
Q89
Q89 How do you perform a t-test to compare the means of two groups in R?
t.test(data$group1, data$group2)
compare.means(data$group1, data$group2)
groups.ttest(data$group1, data$group2)
test.t(data$group1, data$group2)
Q90
Q90 What might be the reason if lm() fails to fit a model in R?
Incorrect data types
Missing data
Both incorrect data types and missing data
None of the above