Week 4 Overview
This wraps up the content for week 4. Now we require some practice! You should head back to our Moodle site to check out your assessment for this week.
This week we’ll see how we can use the dplyr and tidyr packages to do common data mainpulations (filtering, selecting columns, etc.) and to change the format of a dataset (long to wide). Then we look at how we can connect R to a database and learn about SQL style joins.
Week 4 Additional Readings/Learning Materials
Manipulating Data
SQL Joins
Week 4 Learning Objectives
Upon completion of this week, students will be able to:
Manipulating Data
use logical statements and indexing vectors to subset common data objects using common functions such as
[, subset, or dplyr::filter functions (CO 2, 3, 4)list favorable things to look for in an R package (CO 2, 3)
- describe the general purpose of the tidyverse package
- outline the difference between require and library
- explicitly use functions from a particular package using the :: operator
- discuss the idea of masking of R functions and objects
describe the uses of and program with functions from the dplyr package(CO 2, 3, 4)
- explain the benefits of using the dplyr package over base R methods
- program with the arrange, filter, select, and rename functions from the dplyr package
- optimize selecting variables from a data frame using the select function’s options (such as starts_with)
- combine functions in the dplry package to subset and summarize a data set in R
- describe the uses of and program with the mutate, group_by, and summarise functions in the dplyr R package
- combine functions in the dplry package to subset and summarize a data set in R
program using the chain of commands or chaining/piping operators (CO 1, 4)
Other Data Manipulations
utilize the tidyr package to manipulate data (CO 2)
- change data between wide to long formats
- split or combine columns using the tidyr package
Other ways to connect R to data
explain the general process of connecting R to a database, connect R to a database, and request data (CO 2)
- define the term SQL and RDBMS
- compare terminology between statistics and SQL (tables vs data sets, etc.)
- extract SQL code from dplyr commands
- write very basic SQL code to select and merge data
- describe why the collect function is required when using R to query a database
- determine the appropriate type of join to extract information of interest from given tables
Use the table of contents on the left or the arrows at the bottom of this page to navigate to the next learning material!