1
STT 180 Exam 1 Questions and Answers (100%
Correct Answers) Already Graded A+
Is a dplyr function that chooses rows matching a set of criteria Ans:
filter()
ex. flights %>%
© 2026 Assignment Expert
filter(air_time > 60)
Is a dplyr function that chooses rows using indices Ans: slice()
Guru01 - Stuvia
ex. slice(mtcars, 1:3)
Is a function of dplyr that chooses columns by name Ans: select()
ex. mtcars %>%
select(mpg, hp, wt)
Grabs a column as a vector Ans: pull()
ex. mtcars %>%
pull(1) or pull(cyl)
rename specific columns Ans: rename()
, For Expert help and assignment handling,
2
ex. mtcars %>%
rename(NewName = OldName)
reorder rows in ascending and descending order Ans: arrange()
ex. mtcars %>%
arrange(cyl) ##Ascending
© 2026 Assignment Expert
arrange(cyl,mpg) ##Reorders both
arrange(desc(cyl)) ##Descending
Guru01 - Stuvia
adds new variables to the data frame Ans: mutate()
ex. mtcars %>%
mutate(new_variable = mpg/5)
creates a new data frame with new variables Ans: transmute()
ex. mtcars%>%
transmute(new_var = mpg/5)
filters for unique rows (so it gets rid of duplicates) Ans: distinct()