DSCI 100 FINAL STUDY GUIDE
load repr library - Answers - library(repr)
filter does what - Answers - gets a subset of rows from data frame meeting criteria
what does mutate do - Answers - - adds a new column from data frame
- overwrites/changes a column to a data frame
how do you make data reproducible? - Answers - use code to perform an analysis of the
data. all analysis should be done and stored with code, as opposed to excel.
advantages of a relative path - Answers - - reproducible
works from another computer without changes
tbl(conn, "projects") - Answers - gets table "projects" from conn connection in database.
creates usable data frame in R
fill in for planes that do NOT have 55 seats but who's year is earlier than 2000
tailnum_df <- planes|>
...(...)|>
filter(...&...) - Answers - - select
- tailnum
- seats!=55
- year<2000
fill in for the tailnum of planes that have 55 seats who's year is earlier than 2000
planes|> filter(...)|> select(...) - Answers - seats==55, year<2000
tailnum
trying to determine island from beak_depth and beak_length
penguins<-penguins|>
mutate(island=...(island))
knn_recipe<-recipe(...~..., ...=...) |>
...(all_predictors()) - Answers - - as_factor
- island
- beak_length+beak_width
- data
- penguins
when to use classification - Answers - when you're trying to find a categorical value
load repr library - Answers - library(repr)
filter does what - Answers - gets a subset of rows from data frame meeting criteria
what does mutate do - Answers - - adds a new column from data frame
- overwrites/changes a column to a data frame
how do you make data reproducible? - Answers - use code to perform an analysis of the
data. all analysis should be done and stored with code, as opposed to excel.
advantages of a relative path - Answers - - reproducible
works from another computer without changes
tbl(conn, "projects") - Answers - gets table "projects" from conn connection in database.
creates usable data frame in R
fill in for planes that do NOT have 55 seats but who's year is earlier than 2000
tailnum_df <- planes|>
...(...)|>
filter(...&...) - Answers - - select
- tailnum
- seats!=55
- year<2000
fill in for the tailnum of planes that have 55 seats who's year is earlier than 2000
planes|> filter(...)|> select(...) - Answers - seats==55, year<2000
tailnum
trying to determine island from beak_depth and beak_length
penguins<-penguins|>
mutate(island=...(island))
knn_recipe<-recipe(...~..., ...=...) |>
...(all_predictors()) - Answers - - as_factor
- island
- beak_length+beak_width
- data
- penguins
when to use classification - Answers - when you're trying to find a categorical value