# IST 687 What is Data Science & R Overview

2020-01-08 14:29:30

## Today’s Agenda

• Introductions
• Course overview, infrastructure and expectations
• Breakout Rooms for Lab 1 (Pair Programming)
• Homework 1 Tips
• Next week’s agenda

## Introductions

• Name and Location
• Data science experience
• Expectations for the course (and concerns)

## Synchronous Sessions

• Intended to provide a space to ask questions, immediate feedback, and practice coding
• Lab Assignments are central to synchronous sessions and should be completed in-class
• Each person will work with a peer (Pair Programming) in a breakout room. Matching Doc.
• One person per group must upload their team’s document to the LMS the upcoming Friday by 11:59pm

## Lab 1: Basic R coding (vectors, conditionals)

• Goal: Write a piece of R code that you could use to teach a seven-year-old child about Boolean logic (AND, OR, NOT).

• Steps : (1) Brainstorm a scenario that could could use to implement boolean logic. (2) Find the appropitate notations for each conditional** (3) Write three conditional statements that will evaluate the three boolean conditionals.

## An example…

Let’s assume we have sheep (sallysheep and mollysheep) with different color fleece (black and white) and two pastures (pasture1 and pasture2). In this scenario we want to sort the sheep into the pastures based on their fleece matching the color accepted by the pasture.

sallysheep = "black"
mollysheep = "white"

pasture1 = "black"
pasture2 = "brown"

## An example…

Next, we shold compare any of the sheep objects, e.g., mollysheep and pasture objects, e.g., pasture1 using conditional to see the expression returns TRUE or FALSE.

mollysheep == pasture1

## [1] TRUE

we could even add multiple comparisons using Boolean logic. mollysheep == pasture1 & mollysheep == pasture2

## [1] FALSE

## An example…

Next we can print some statement based on whether the expressions returns TRUE or FALSE

if(sallysheep == pasture1) print("The fleece color matches the pasture color") else
print("The fleece color does not match the pasture color")
## [1] "The fleece color matches the pasture color"

## An example… (Part II)

if(mollysheep == pasture1 & mollysheep == pasture2)
print("The fleece colors match the pasture colors") else
print("At least one fleece color does not match the pasture color")
## [1] "At least one fleece color does not match the pasture color"

Lab Instructions
- Work with your partner to complete the lab
- A link to the .rmd can be found in the syllabus under week 1 section
- Be sure to include the names of all group members in the YAML header
- Need help??? Ping me on Zoom

## Week 1 overview

• R/R Studio e.g., using base R functions such as mean() and length()
• Creating objects and assigning values e.g., name <- "Corey" or age <- 31
• Vector math e.g., age + 5
• Boolean logic e.g., &,|, and !
• Writing conditionals statements e.g., ifelse()

## Next Week

• Asynchronous Session
• Submit your lab and homwork 1 via the LMS. Be sure to include names in the YAML header. All documents must be in either a .docx, .pdf, or .html (not nb.html)
• Week 2: Using R to manipulate data; Read Chapters 4-6
• Synchronous Session
• More course information
• Breakouts
• Lab 2: Data frames & sorting
• Project group meetups