- Purpose of group
- Our tools: Languages/software we will learn
- Examples of coding applications for speech
- Download R, RStudio, Praat
- Intro to RStudio
- Topics for the term
25/02/2020
Computer Coding: Writing something in a language a computer can understand in order to tell the computer to do a specific thing or set of things.
Why bother telling a computer what to do when we can just do it ourselves?
Why bother telling a computer what to do when we can just do it ourselves?
Coding: Writing in a language a computer can understand
Scripting: A type of coding that tells a specific program exactly what actions to take
Programming: Writing code that serves to actually create another program (an app, software, etc)
Scripts: Text files containing code.
Functions: A certain named format of code that outlines a procedure. Often this allows several lines of code to be executed with a single line of code (by using the name of the function)
=sum(2,2)
. sum()
is the function that takes input (in this case, numbers), and performs an a specific action (adds them).Calling: Invoke a function by using the name of the function and specifying parameters.
Example: Starbucks data
Let’s look together
1_prep_data.R
################################################### # Helper script for analyzing Starbucks drink data ################################################### # Setup ---- # Load packages that contain functions we will use library(tidyverse) library(plyr) # Load data ---- starbucks <- read.csv("1_materials/starbucks_drinkMenu_expanded.csv")
1_prep_data.R
# Create new columns ---- # Create a "caffeine" column that is numeric starbucks <- starbucks %>% mutate(caffeine = revalue(caffeine,replace = c( "varies" = NA, "Varies" = NA)), caffeine_num = as.numeric(as.character(caffeine))) # Is caffeine content over 100 mg? If so, label it "YES", otherwise, "NO" starbucks <- starbucks %>% mutate(too_much_caffeine = ifelse(caffeine_num > 100, "YES", "NO")) starbucks %>% select(caffeine_num, too_much_caffeine) %>% head()
2_figures.R
Using R Markdown
to write:
R Markdown
allows you to incorporate code AND regular text using simple “markdown” syntax (more on that later).
For example…
This is where you’ll edit and run your scripts.
This is where code, error messages, warnings, etc. show up when you run code
Here you can see…
Variables
in your environment
("Environment)My thoughts:
Potential meet up flow: Basic skill + fun skill per meet up
Break up into small groups for a couple of minutes to discuss what you would like to see at this group
Date | Time | Location | Topic |
---|---|---|---|
2/25 | 4pm | Cary Hall 42 | Intro to group + RStudio |
3/10 | 4pm | TBD | TBD |
3/24 | 4pm | TBD | TBD |
4/7 | 4pm | TBD | TBD |
4/21 | 4pm | TBD | TBD |
5/5 | 4pm | TBD | TBD |
Sign up for an account on udemy.com
Sign up for the “R basics: R programming language” course on udemy
Watch videos 1, 2, 3, and 9.