wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

21MS3014_Test_1_Quiz

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

Blood group values like "A", "B", "AB", "O" are stored in a dataset. Identify the appropriate datatype to store this data.

a)

factor

b)

character

c)

numeric

d)

logical

2.

Choose the suitable data that can be represented using 'character' data type from the folllowing.

a)

Region

b)

Price

c)

Phone Number

d)

Discount

3.

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.

a)

students$Grade

b)

students[ , c(Grade)]

c)

students[, Grade]

d)

students["Grade"]

4.

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.

a)

left_join(music, games, by = "student_id")

b)

outer_join(music, games, by = "student_id")

c)

inner_join(music, games, by = "student_id")

d)

full_join(music, games, by = "student_id")

5.

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.

a)

left_join(music, students, by = "student_id")

b)

left_join(students, music, by = "student_id")

c)

inner_join(students, music, by = "student_id")

d)

full_join(students, music, by = "student_id")

6.

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.

a)

left_join(students, games, by = "student_id")

b)

anti_join(students, games, by = "student_id")

c)

right_join(students, music, by = "student_id")

d)

full_join(students, games, by="student_id")

7.

Identify the function that returns the number of rows and columns in a data frame.

a)

nrow()

b)

ncol()

c)

count()

d)

dim()

8.

Identify the function that finds the missing values in a column of a data frame.

a)
b)

is.missing()

c)

is.void()

d)

is.empty()

9.

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'.

a)

count(product$availability)

b)

cnt(product$availability)

c)

unique(product$availability)

d)

table(products$availability)

10.

Identify the function that can be used to identify duplicate rows.

a)

duplicated()

b)

duplicates()

c)

check_duplicates()

d)

dup()

11.

Name the observations that deviate significantly from other data values in a dataset.

a)

outliers

b)

mean

c)

mode

d)

distractors

12.

Choose the function that searches for a pattern in a data frame.

a)

find()

b)

find_pattern()

c)

grepl()

d)

search()

13.

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.

a)

tapply()

b)

sapply()

c)

lapply()

d)

apply()

14.

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.

a)

left_join(orders, customers, by = "customer_id")

b)

right_join(orders, customers, by = "customer_id")

c)

anti_join(orders, customers, by = "customer_id")

d)

full_join(orders, customers, by = "customer_id")

15.

Select the function that displays the names of the features or attributes in a dataset.

a)

names()

b)

col()

c)

cols()

d)

name()

16.

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?

a)

Missing Completely at Random

b)

Missing at Random

c)

Missing not at Random

d)

Sampling Error

17.

Identify an approach that is used to handle outliers.

a)

Z-Score Normalization

b)

One-Hot Encoding

c)

Min-Max Scaling

d)

Interquartile Range (IQR) Method

18.

Which of the following charts is used to identify outiers?

a)

Box Plot

b)

Bar chart

c)

Bubble Plot

d)

HC Plot

19.

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?

a)

tapply()

b)

sapply()

c)

lapply()

d)

apply()

20.

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?

a)

tapply()

b)

sapply()

c)

apply()

d)

lapply()