DSCI 100 REVIEW TIPS ANSWERS AND QUESTIONS
SET A+
✔✔col_names = FALSE - ✔✔removes col names when reading in a file
✔✔Steps to use SQLite Database - ✔✔canlang <- dbConnect
dbListTables
table <- tbl(canlang, "table name")
✔✔Steps to use PostgreSQL Database - ✔✔canlang <-
dbConnect(RPostgres::Postgres(), dbname = "db", host = "fakeserver.ca", port = 1234,
user = "user", password = "pass")
dbListTables
table <- tbl(canlang, "table name")
✔✔write_csv(dataset, "name.csv") - ✔✔writes a csv given a dataset and name
✔✔vectors - ✔✔An ordered collection of one or more values of the same data types
Can use c() to create a vector
✔✔Lists - ✔✔An ordered collection of one or more values of possibly different data
types
✔✔Pivot longer - ✔✔pivot_longer(cols = , names_to = , values_to = )
✔✔Pivot wider - ✔✔Use pivot_wider(names_from = , values_from = )
✔✔Seperate - ✔✔separate(dataframe, col = , into = , sep = )
separates values in a col into two or more cols based on a separator
✔✔Summarize - ✔✔summarize(dataframe, ...)
, creates new col(s) that summarize other cols
✔✔Group by - ✔✔group_by(datafram, col = )
groups a column by all of its values
usually used before simmarize
✔✔Map - ✔✔map(vector/list, function)
by default outputs a list
applies a function onto that list/vector
✔✔Scatter plot - ✔✔Visualize the relation ship between two quantitative variables
✔✔Line plot - ✔✔Visualize trends with respect to an independent
✔✔Bar plot - ✔✔Visualize comparisons of amounts
✔✔Histogram - ✔✔Visualize the distributions of one quantitative variable
✔✔Facet grid - ✔✔facet_grid(rows/cols = vars(col/row name))
for creating a plot with multiple subplots
✔✔Benefits of using a github rpo - ✔✔- Easier to collaborate with partners
- Keeps logs of pervious versions
- accessibility across many devices
✔✔Version control - ✔✔The process of keeping a record of changes to documents.
Records are kept of changes, who made them, and when.
✔✔Git vs Github - ✔✔Git: version control system
Github: provides hosting for git repos
✔✔Steps to using github on juypter notebook - ✔✔1. create a repo and link to you
jupyter notebook
2. add files to commit
3. commit
4. push commit
✔✔Classification - ✔✔using one or more variable to predict the value of a categorical
variable
SET A+
✔✔col_names = FALSE - ✔✔removes col names when reading in a file
✔✔Steps to use SQLite Database - ✔✔canlang <- dbConnect
dbListTables
table <- tbl(canlang, "table name")
✔✔Steps to use PostgreSQL Database - ✔✔canlang <-
dbConnect(RPostgres::Postgres(), dbname = "db", host = "fakeserver.ca", port = 1234,
user = "user", password = "pass")
dbListTables
table <- tbl(canlang, "table name")
✔✔write_csv(dataset, "name.csv") - ✔✔writes a csv given a dataset and name
✔✔vectors - ✔✔An ordered collection of one or more values of the same data types
Can use c() to create a vector
✔✔Lists - ✔✔An ordered collection of one or more values of possibly different data
types
✔✔Pivot longer - ✔✔pivot_longer(cols = , names_to = , values_to = )
✔✔Pivot wider - ✔✔Use pivot_wider(names_from = , values_from = )
✔✔Seperate - ✔✔separate(dataframe, col = , into = , sep = )
separates values in a col into two or more cols based on a separator
✔✔Summarize - ✔✔summarize(dataframe, ...)
, creates new col(s) that summarize other cols
✔✔Group by - ✔✔group_by(datafram, col = )
groups a column by all of its values
usually used before simmarize
✔✔Map - ✔✔map(vector/list, function)
by default outputs a list
applies a function onto that list/vector
✔✔Scatter plot - ✔✔Visualize the relation ship between two quantitative variables
✔✔Line plot - ✔✔Visualize trends with respect to an independent
✔✔Bar plot - ✔✔Visualize comparisons of amounts
✔✔Histogram - ✔✔Visualize the distributions of one quantitative variable
✔✔Facet grid - ✔✔facet_grid(rows/cols = vars(col/row name))
for creating a plot with multiple subplots
✔✔Benefits of using a github rpo - ✔✔- Easier to collaborate with partners
- Keeps logs of pervious versions
- accessibility across many devices
✔✔Version control - ✔✔The process of keeping a record of changes to documents.
Records are kept of changes, who made them, and when.
✔✔Git vs Github - ✔✔Git: version control system
Github: provides hosting for git repos
✔✔Steps to using github on juypter notebook - ✔✔1. create a repo and link to you
jupyter notebook
2. add files to commit
3. commit
4. push commit
✔✔Classification - ✔✔using one or more variable to predict the value of a categorical
variable