1. What is data preprocessing in R?
A) Cleaning and preparing data for analysis
B) Creating new datasets
C) Visualizing data patterns
D) Installing R packages
Show Explanation
2. What is data wrangling?
A) Data visualization
B) Data cleaning and structuring
C) Data storage
D) Data collection
Show Explanation
3. Which function is used to order data in R?
A) sort()
B) arrange()
C) order()
D) rank()
Show Explanation
4. What does filtering data mean in R?
A) Removing all data
B) Sorting data alphabetically
C) Converting data types
D) Selecting rows based on conditions
Show Explanation
5. Which function can be used to filter data frames in R?
A) subset()
B) filter()
C) select()
D) choose()
Show Explanation
6. What does a histogram show in R?
A) Relationship between two variables
B) Distribution of a single variable
C) Time series data
D) Categorical data counts
Show Explanation
7. Which function creates a histogram in R?
A) hist()
B) histogram()
C) plot()
D) bar()
Show Explanation
8. What does a box plot display in R?
A) Mean and standard deviation
B) Correlation coefficients
C) Five-number summary
D) Frequency distribution
Show Explanation
9. Which function creates a box plot in R?
A) box()
B) boxplot()
C) plot()
D) summary()
Show Explanation
10. What type of data is best displayed using bar plots in R?
A) Continuous numerical data
B) Time series data
C) Correlation data
D) Categorical data
Show Explanation
11. Which function creates bar plots in R?
A) barplot()
B) bar()
C) plot()
D) chart()
Show Explanation
12. What is ggplot2 in R?
A) A data manipulation package
B) A data visualization package
C) A statistical testing package
D) A machine learning package
Show Explanation
13. Which function starts a ggplot in R?
A) ggplot()
B) plot()
C) graph()
D) chart()
Show Explanation
14. What does aes() do in ggplot2?
A) Adds titles to plots
B) Creates animations
C) Maps variables to visual properties
D) Saves plots to files
Show Explanation
15. Which geom is used to create scatter plots in ggplot2?
A) geom_line()
B) geom_point()
C) geom_bar()
D) geom_histogram()
Show Explanation
16. What is a QQ plot used for in R?
A) Showing correlations
B) Displaying time series
C) Creating bar charts
D) Checking data distribution normality
Show Explanation
17. Which function creates a QQ plot in base R?
A) qqnorm()
B) qqplot()
C) qq()
D) quantile()
Show Explanation
18. Which function calculates correlation in R?
A) correlation()
B) corr()
C) cor()
D) relate()
Show Explanation
19. Which function performs a t-test in R?
A) ttest()
B) t.test()
C) test.t()
D) student.test()
Show Explanation
20. What does the aggregate() function do in R?
A) Combines data frames
B) Sorts data
C) Filters data
D) Applies functions to grouped data
Show Explanation
21. Which function is used to join data frames in R?
A) merge()
B) join()
C) combine()
D) bind()
Show Explanation
22. What does rbind() do in R?
A) Removes rows
B) Reorders rows
C) Combines data frames by rows
D) Renames rows
Show Explanation
23. What does cbind() do in R?
A) Creates new columns
B) Combines data frames by columns
C) Counts columns
D) Removes columns
Show Explanation
24. What does complete.cases() identify in R?
A) All cases in dataset
B) Incomplete cases
C) Missing values
D) Rows with no missing values
Show Explanation
25. Which function removes missing values in R?
A) na.omit()
B) remove.na()
C) delete.na()
D) drop.na()
Show Explanation
26. What does the scale() function do in R?
A) Resizes plots
B) Measures data size
C) Standardizes variables
D) Scales graphics
Show Explanation
27. Which function converts continuous variables to categorical in R?
A) convert()
B) cut()
C) factor()
D) group()
Show Explanation
28. What does the reshape() function do in R?
A) Changes data types
B) Resizes data frames
C) Removes duplicates
D) Transforms data between wide and long formats
Show Explanation
29. Which function identifies duplicate rows in R?
A) duplicated()
B) duplicate()
C) dup()
D) repeat()
Show Explanation
30. What does the with() function do in R?
A) Creates new objects
B) Removes objects
C) Evaluates expressions within data frame context
D) Combines multiple objects
Show Explanation
31. What does the attach() function do in R?
A) Attaches files to emails
B) Adds data frame to search path
C) Connects to databases
D) Links external libraries
Show Explanation
32. What is the opposite of attach() in R?
A) remove()
B) delete()
C) unload()
D) detach()
Show Explanation
33. Which function is used to modify columns in a data frame?
A) transform()
B) modify()
C) change()
D) alter()
Show Explanation
34. What does the within() function do in R?
A) Checks if values are within range
B) Creates subsets
C) Evaluates and modifies data frame expressions
D) Finds values within groups
Show Explanation
35. What does the by() function do in R?
A) Sorts data
B) Applies functions to data subsets
C) Filters data
D) Groups data
Show Explanation
36. Which function applies functions to vector subsets in R?
A) apply()
B) lapply()
C) sapply()
D) tapply()
Show Explanation
37. What does lapply() return in R?
A) A list
B) A vector
C) A matrix
D) A data frame
Show Explanation
38. What does sapply() do compared to lapply() in R?
A) Works slower
B) Simplifies the result
C) Works with strings only
D) Applies to single elements
Show Explanation
39. What is mapply() used for in R?
A) Creating maps
B) Mapping variables
C) Applying functions to multiple arguments
D) Plotting geographical data
Show Explanation
40. What does the split() function do in R?
A) Separates strings
B) Divides numbers
C) Breaks data frames
D) Divides data into groups
Show Explanation
41. Which function reverses the split() operation in R?
A) unsplit()
B) combine()
C) merge()
D) join()
Show Explanation
42. What does the stack() function do in R?
A) Creates data stacks
B) Piles up data
C) Converts wide data to long format
D) Stacks multiple datasets
Show Explanation
43. Which function reverses the stack() operation in R?
A) destack()
B) unstack()
C) widen()
D) spread()
Show Explanation
44. What does the melt() function do in R?
A) Melts ice data
B) Combines datasets
C) Removes data
D) Transforms wide data to long format
Show Explanation
45. Which function transforms long data to wide format in R?
A) cast()
B) spread()
C) widen()
D) expand()
Show Explanation
46. Which function gets or sets column names in R?
A) columns()
B) names()
C) colnames()
D) headers()
Show Explanation
47. What does rownames() do in R?
A) Counts rows
B) Gets or sets row names
C) Creates new rows
D) Removes rows
Show Explanation
48. Which function returns the number of rows in R?
A) rows()
B) count.rows()
C) length.rows()
D) nrow()
Show Explanation
49. What does ncol() return in R?
A) Number of columns
B) Column names
C) New columns
D) Column types
Show Explanation
50. What does the View() function do in R?
A) Creates views of data
B) Prints data to console
C) Opens data in a viewer window
D) Saves data views
Show Explanation