KRIGOLSON TEACHING
  • NEUROSCIENCE
    • NEUROSCIENCE 100 >
      • NEURO 100 INTRODUCTION
      • NEURO 101 ADVANCED
      • NEURO 102 AGING
      • NEURO 103 MEMORY
      • NEURO 104 DECISION MAKING
      • NEURO 105 LEARNING
      • Research Statistics
    • NRSC 500B / MEDS 470
  • Kinesiology
    • EPHE 245
    • EPHE 357
  • STATISTICS
    • BIOMEDICAL STATISTICS
    • MULTIVARIATE STATISTICS >
      • MULTIPLE REGRESSION
    • RESOURCES
    • R TIPS
  • MATLAB
    • THE BASICS >
      • Hello World
      • BASIC MATHEMATICS
      • VARIABLES
      • Matrices
      • Writing Scripts
      • PATHS AND DIRECTORIES
      • USER INPUT
      • FOR LOOPS
      • WHILE LOOPS
      • IF STATEMENTS
      • RANDOM NUMBERS
    • STATISTICS >
      • LOADING DATA
      • DESCRIPTIVE STATISTICS
      • MAKING FUNCTIONS
      • BAR GRAPHS
      • LINE GRAPHS
      • TTESTS
    • EXPERIMENTS: THE BASICS >
      • DRAWING A CIRCLE
      • DRAWING MULTIPLE OBJECTS
      • DRAWING TEXT
      • DRAWING AN IMAGE
      • PLAYING A TONE
      • KEYBOARD INPUT
      • BUILDING A TRIAL
      • BUILDING TRIALS
      • NESTED LOOPS
      • RIGHT OR WRONG
      • SAVING DATA
    • EXPERIMENTS: ADVANCED >
      • STROOP
      • N BACK
      • Oddball
      • Animation
      • VIDEO
    • EEG and ERP Analysis >
      • ERP Analysis
      • FFT Analysis
      • Wavelet Analysis
  • Directed Studies
    • Advanced Topics in Motor Control A
    • Advanced Topics in Motor Control B
    • An Introduction to EEG
    • Advanced EEG and ERP Methods
    • Neural Correlates of Human Reward Processing
    • Independent Research Project
  • RESOURCES
    • EXCEL
    • HOW TO READ A RESEARCH PAPER
    • HOW TO WRITE A RESEARCH PAPER
  • Workshops
    • Iowa State EEG Workshop 2018
  • Python
    • The Basics >
      • Setting Up Python
      • Hello, world!
      • Basic Math & Using Import
      • Variables
      • Matrices
      • Scripts
      • User Input
      • For Loops

USING GGPLOT II
​GROUPED BAR PLOTS

This tutorial requires the ggplot2 and the reshape2 packages. Importantly, the last tutorial, ‘Bar Plot with GGPlot’ walks you through what wide and long format data is, so make sure that you have read this information to better understand what we are doing here.
 
Grouped bar plots are a way to visualize factorial data. What we are going to do in this tutorial is present data with 2 factors. One factor is feedback with two levels (win, loss) and the other factor is frequency with four levels (Delta, Theta, Alpha, Beta). What we are going to do is display the win and loss feedback next to each other for all levels of frequency. This way we can more easily compare this data.
 
Similar to the last tutorial, I will not here walk you through each part of the code. The reason for this is that this code is much more elaborate than what you’ve used before. Instead, I have decided to give you working code which has extensive commenting. I suggest you read the comments thoroughly, but also play around with it. The best way to learn what every line of code does is by playing with it. See what happens if you delete a line, or if you change a value. If you don’t do these things, you will not truly understand what everything does.
 
HERE is the data you will need for this tutorial.
HERE is the code you will need for this tutorial.
 
Now, load the script into R and the tutorial will continue there.
  • NEUROSCIENCE
    • NEUROSCIENCE 100 >
      • NEURO 100 INTRODUCTION
      • NEURO 101 ADVANCED
      • NEURO 102 AGING
      • NEURO 103 MEMORY
      • NEURO 104 DECISION MAKING
      • NEURO 105 LEARNING
      • Research Statistics
    • NRSC 500B / MEDS 470
  • Kinesiology
    • EPHE 245
    • EPHE 357
  • STATISTICS
    • BIOMEDICAL STATISTICS
    • MULTIVARIATE STATISTICS >
      • MULTIPLE REGRESSION
    • RESOURCES
    • R TIPS
  • MATLAB
    • THE BASICS >
      • Hello World
      • BASIC MATHEMATICS
      • VARIABLES
      • Matrices
      • Writing Scripts
      • PATHS AND DIRECTORIES
      • USER INPUT
      • FOR LOOPS
      • WHILE LOOPS
      • IF STATEMENTS
      • RANDOM NUMBERS
    • STATISTICS >
      • LOADING DATA
      • DESCRIPTIVE STATISTICS
      • MAKING FUNCTIONS
      • BAR GRAPHS
      • LINE GRAPHS
      • TTESTS
    • EXPERIMENTS: THE BASICS >
      • DRAWING A CIRCLE
      • DRAWING MULTIPLE OBJECTS
      • DRAWING TEXT
      • DRAWING AN IMAGE
      • PLAYING A TONE
      • KEYBOARD INPUT
      • BUILDING A TRIAL
      • BUILDING TRIALS
      • NESTED LOOPS
      • RIGHT OR WRONG
      • SAVING DATA
    • EXPERIMENTS: ADVANCED >
      • STROOP
      • N BACK
      • Oddball
      • Animation
      • VIDEO
    • EEG and ERP Analysis >
      • ERP Analysis
      • FFT Analysis
      • Wavelet Analysis
  • Directed Studies
    • Advanced Topics in Motor Control A
    • Advanced Topics in Motor Control B
    • An Introduction to EEG
    • Advanced EEG and ERP Methods
    • Neural Correlates of Human Reward Processing
    • Independent Research Project
  • RESOURCES
    • EXCEL
    • HOW TO READ A RESEARCH PAPER
    • HOW TO WRITE A RESEARCH PAPER
  • Workshops
    • Iowa State EEG Workshop 2018
  • Python
    • The Basics >
      • Setting Up Python
      • Hello, world!
      • Basic Math & Using Import
      • Variables
      • Matrices
      • Scripts
      • User Input
      • For Loops