IST 687 What is Data Science & R Overview

Corey Jackson

2020-01-08 14:29:30

Today’s Agenda

Introductions

Tell us about yourself…

Specific Skills Required

Doing Data Science

Course Overview

Synchronous Sessions

Please include the names of all persons in your group

Lab 1: Basic R coding (vectors, conditionals)

Hint: https://www.statmethods.net/management/operators.html

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

Next Week