Search Header Logo

Data Frame Operations in R

Authored by Hieba Mahmod

Computers

6th - 10th Grade

Used 2+ times

Data Frame Operations in R
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function combines data frames row-wise?

combine()

rbind()

addrow()

cbind()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you rename a column?

df$1 <- 'name'

colnames(df)[1] <- 'name'

names(df)[1] <- 'name'

rename(df, 'name')

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What function do you use to bind columns from two data frames?

rbind()

cbind()

merge()

addcol()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which code removes the second column from a data frame df?

df[, -2]

df[-2, ]

remove(df, 2)

drop(df, 2)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you view the first few rows of a data frame in R?

top(df)

head(df)

preview(df)

df[1:5, ]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If df <- df[-1, ], what happens?

First row removed

First column removed

Row added

Nothing

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you add a new column to a data frame?

new<- cbind(df, num=c(1,2,3))

add(df, 1,2,3)

merge(df)

update(df)

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?