Big Data Analysis / Data Mining 2025-FA Quiz 2

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Catherine Halcomb
Catherine Halcomb
Community Contributor
Quizzes Created: 1497 | Total Attempts: 6,776,099
| Questions: 8 | Updated: Jan 27, 2026
Please wait...
Question 1 / 9
🏆 Rank #--
Score 0/100
1. Which function is used to concatenate matrices vertically (by rows) in R?

Explanation

In R, the function `rbind()` is specifically designed to concatenate matrices or data frames vertically, meaning it stacks them on top of each other by rows. When using `rbind()`, the number of columns in the matrices must match. This function is essential for combining datasets where you want to maintain the structure of the original data while expanding the number of rows. Other options like `cbind()` are used for horizontal concatenation, while functions like `bind_rows()` are part of the dplyr package and serve a similar purpose but are not base R functions.

Submit
Please wait...
About This Quiz
Programming Quizzes & Trivia

This quiz assesses your understanding of R programming concepts, focusing on data manipulation and matrix operations. Key skills evaluated include matrix concatenation, dataframe filtering, and list access methods, essential for anyone looking to enhance their data analysis capabilities in R.

2.
You may optionally provide this to label your report, leaderboard, or certificate.
2. What does the following R code accomplish? mat <- matrix(1:9, nrow = 3, ncol = 3) mat[, 2]

Explanation

The R code creates a 3x3 matrix named 'mat' filled with numbers from 1 to 9. The expression `mat[, 2]` uses the comma to indicate that all rows should be selected from the second column. This syntax specifically targets the second column, returning all its elements, which are the values in that column across all rows of the matrix. Therefore, the operation effectively extracts the second column of 'mat'.

Submit
3. Which code snippet retrieves the first two rows of the students dataframe?

Explanation

The code snippet `students[1:2, ]` retrieves the first two rows of the students dataframe by using row indexing. The syntax `students[row_index, column_index]` allows you to specify which rows and columns to access. In this case, `1:2` indicates the first and second rows, while the comma followed by a space indicates that all columns are included. This results in a subset of the dataframe containing only the specified rows.

Submit
4. Consider a dataframe df with columns 'name' and 'score'. How can you filter rows where 'score' is greater than 80?

Explanation

In R, to filter rows in a dataframe based on a condition, the syntax involves using the dataframe name followed by square brackets. The condition is specified within the brackets. The expression `df$score > 80` accesses the 'score' column, and the condition filters for scores greater than 80. The comma at the end indicates that we want to keep all columns for the filtered rows. Thus, `df[df$score > 80, ]` effectively retrieves all rows where the score exceeds 80, maintaining the correct structure of the dataframe.

Submit
5. How to access the third element of a list named my_list?

Explanation

In R, lists are accessed using double square brackets for indexing. The syntax `my_list[[3]]` retrieves the third element of the list, as R uses 1-based indexing. Other options listed, such as `my_list[3]`, return a sub-list instead of the element itself, while `my_list$3` and `my_list(3)` are incorrect as `$` is used for named elements and parentheses are for function calls, not for indexing. Therefore, the proper method to access the third element is by using double square brackets.

Submit
6. Which function is used to create a dataframe in R?

Explanation

In R, the function `data.frame()` is specifically designed to create data frames, which are essential for storing tabular data. This function allows users to combine different types of variables (like numeric, character, etc.) into a structured format, making it easy to manipulate and analyze data. Other options listed, such as `data()` and `df()`, do not serve this purpose, while `create.df()` is not a standard R function. Thus, `data.frame()` is the appropriate choice for creating data frames in R.

Submit
7. What does the function 'summary()' do in R?

Explanation

The 'summary()' function in R is designed to provide a concise overview of the main characteristics of a dataset. It generates descriptive statistics such as mean, median, minimum, maximum, and quartiles for numerical data, and frequency counts for categorical data. This function is essential for quickly assessing the distribution and key features of the data, making it a valuable tool for exploratory data analysis.

Submit
8. Which package is commonly used for data manipulation in R?

Explanation

dplyr is a powerful R package specifically designed for data manipulation. It provides a set of functions that enable users to perform common data manipulation tasks such as filtering, selecting, arranging, and summarizing data efficiently. Its syntax is intuitive and allows for a clear and concise way to handle data frames, making it a popular choice among data analysts and statisticians. By using dplyr, users can streamline their data processing workflows, enhancing productivity and clarity in their analyses.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (8)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which function is used to concatenate matrices vertically (by rows) in...
What does the following R code accomplish? mat <- matrix(1:9, nrow...
Which code snippet retrieves the first two rows of the students...
Consider a dataframe df with columns 'name' and 'score'. How can you...
How to access the third element of a list named my_list?
Which function is used to create a dataframe in R?
What does the function 'summary()' do in R?
Which package is commonly used for data manipulation in R?
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!