NEW
Font size
Worksheets21MS3014_Test_1_Quiz
Total questions: 20
Worksheet time: 11mins
Blood group values like "A", "B", "AB", "O" are stored in a dataset. Identify the appropriate datatype to store this data.
factor
character
numeric
logical
Choose the suitable data that can be represented using 'character' data type from the folllowing.
Region
Price
Phone Number
Discount
Answer the questions based on the given data frame:
students <- data.frame(
ID = c(101, 102, 103, 104, 105),
Name = c("Anu", "Bala", "Chitra", "Deepak", "Esha"),
Marks = c(85, 72, 90, 65, 78),
Grade = c("A", "B", "A", "C", "B")
)
A student wants to display the Grade column as a list for further calculations. Choose the most appropriate method.
students$Grade
students[ , c(Grade)]
students[, Grade]
students["Grade"]
Consider the following data frames: students(student_id, name, department); music(student_id, name, instrument); games(student_id, name, game). Identify the command that would list students who are there in both music and games.
left_join(music, games, by = "student_id")
outer_join(music, games, by = "student_id")
inner_join(music, games, by = "student_id")
full_join(music, games, by = "student_id")
Consider the following data frames: students(student_id, name, department); music(student_id, name, instrument); games(student_id, name, game). Choose the join that would list students in music club.
left_join(music, students, by = "student_id")
left_join(students, music, by = "student_id")
inner_join(students, music, by = "student_id")
full_join(students, music, by = "student_id")
Consider the following data frames: students(student_id, name, department); music(student_id, name, instrument); games(student_id, name, game). Choose the join that would list students in not in the games club.
left_join(students, games, by = "student_id")
anti_join(students, games, by = "student_id")
right_join(students, music, by = "student_id")
full_join(students, games, by="student_id")
Identify the function that returns the number of rows and columns in a data frame.
nrow()
ncol()
count()
dim()
Identify the function that finds the missing values in a column of a data frame.
Consider the following data frame: product <- data.frame(
product_code = c(101, 102, 103, 104, 105),
product_name = c("Laptop", "Mouse", "Keyboard", "Monitor", "Printer"),
category = c("Electronics", "Accessories", "Accessories", "Electronics", "Electronics"),
price = c(55000, 800, 1500, 12000, 9000),
availability = c("In Stock", "In Stock", "Out of Stock", "In Stock", "Out of Stock")
)
Identify the function that would display how many items are 'in stock' and how many items are 'out of stock'.
count(product$availability)
cnt(product$availability)
unique(product$availability)
table(products$availability)
Identify the function that can be used to identify duplicate rows.
duplicated()
duplicates()
check_duplicates()
dup()
Name the observations that deviate significantly from other data values in a dataset.
outliers
mean
mode
distractors
Choose the function that searches for a pattern in a data frame.
find()
find_pattern()
grepl()
search()
Identify the function that is used to find the average price of each brand in a product table that contains the columns: product_code, product_name, brand, price.
tapply()
sapply()
lapply()
apply()
Consider these dataframes for answering the questions:
orders <- data.frame(order_id = c(1, 2, 3), customer_id = c(101, 102, 103), amount = c(250, 300, 150) )
customers <- data.frame( customer_id = c(101, 102, 104), customer_name = c("Anu", "Bala", "Chitra") ). Display the orders without matching customer details.
left_join(orders, customers, by = "customer_id")
right_join(orders, customers, by = "customer_id")
anti_join(orders, customers, by = "customer_id")
full_join(orders, customers, by = "customer_id")
Select the function that displays the names of the features or attributes in a dataset.
names()
col()
cols()
name()
A health researcher is collecting data on individuals’ daily alcohol consumption. Some participants choose not to disclose their alcohol intake. It is suspected that those who consume very high amounts of alcohol are more likely to skip this question because they feel uncomfortable reporting it. What type of missing data does this scenario represent?
Missing Completely at Random
Missing at Random
Missing not at Random
Sampling Error
Identify an approach that is used to handle outliers.
Z-Score Normalization
One-Hot Encoding
Min-Max Scaling
Interquartile Range (IQR) Method
Which of the following charts is used to identify outiers?
Box Plot
Bar chart
Bubble Plot
HC Plot
An HR manager has employee performance scores along with their department names. He needs to determine the average performance score for each department to support promotion decisions. Which R function should be used?
tapply()
sapply()
lapply()
apply()
A marketing analyst stores campaign performance data (click rates) for different regions in a list. He wants to compute the average click rate for each region while keeping the results structured as a list for further detailed analysis. Which function should he use?
tapply()
sapply()
apply()
lapply()
