Created
September 30, 2012 20:37
-
-
Save michelleboisson/3808379 to your computer and use it in GitHub Desktop.
Behavior Experiment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
video | time | person | behavior | id | real_time | |
---|---|---|---|---|---|---|
1 | 5:00 | girl in white hoodie | stretched shoulders | 1 | 12:35:00 | |
1 | 8:00 | sean | arms up stretch | 2 | 12:38:00 | |
1 | 9:30 | guy in green shirt infront of sean | arms up stretch | 3 | 12:39:30 | |
1 | 13:31 | sean | stretched back | 2 | 12:43:31 | |
1 | 15:38 | plaids shirt guy | brisk back bend | 4 | 12:45:38 | |
1 | 16:01 | guy in green shirt in front of sean | brisk back bend | 3 | 12:46:01 | |
1 | 17:57 | girl in white hoodie | wrist stretch | 1 | 12:47:57 | |
1 | 19:43 | girl in white hoodie | wrist stretch | 1 | 12:49:43 | |
1 | 20:48 | guy in green | hands behind neck stretch | 3 | 12:50:48 | |
1 | 21:29 | green shirt guy | 2 head bends | 3 | 12:51:29 | |
1 | 21:45 | green guy | more neck bends | 3 | 12:51:45 | |
1 | 21:46 | plead shirt guy | hands behind neck | 4 | 12:51:46 | |
1 | 22:50 | left girl in white | small back/shoulder stretch | 1 | 12:52:50 | |
1 | 25:00 | left girl in white | some of her own stretches | 1 | 12:55:00 | |
1 | 32:00 | left girl in white | small wrist stretch | 1 | 13:02:00 | |
1 | 36:46 | pleads guy | back stretch and hands stretch and shoulder rolls | 4 | 13:06:46 | |
1 | 38:30 | girl in white on the left | stretch | 1 | 13:08:30 | |
1 | 41:36 | girl in white | stretch | 1 | 13:11:36 | |
1 | 47:50 | girl in white | standing up stretches | 1 | 13:17:02 | |
1 | 51:02 | pleads | shoulder stretches | 4 | 13:21:02 | |
1 | 56:31 | girl in white | shoulder twists | 1 | 13:26:31 | |
2 | 0:08 | girl in white | straight back | 1 | 14:00:08 | |
2 | 0:54 | girl in white | shoulder stretch | 1 | 14:00:54 | |
2 | 2:00 | girl in white starts | shoulder stretch | 1 | 14:02:00 | |
2 | 2:01 | person 4 | shoulder stretch | 4 | 14:02:11 | |
2 | 2:02 | person 5 | shoulder stretch | 5 | 14:02:22 | |
2 | 2:03 | person 6 | shoulder stretch | 6 | 14:02:33 | |
2 | 3:00 | girl in white | small stretch | 1 | 14:03:00 | |
2 | 3:01 | person 4 | shoulder stretch | 4 | 14:03:11 | |
2 | 3:01 | person 5 | shoulder stretch | 5 | 14:03:20 | |
2 | 7:00 | new guy comes | a little stretch | 7 | 14:07:00 | |
2 | 11:44 | guy in gray on the left (1st time) | head roll | 8 | 14:11:44 | |
2 | 22:33 | plaids | hand-back stretch | 4 | 14:22:33 | |
3 | 4:42 | guy in the back with headphones | arm and back stretches | 9 | 14:34:42 | |
3 | 4:55 | guy in front with headphones | neck stretches | 10 | 14:34:42 | |
3 | 24:40 | guy on right white tshirt | quick shoulder stretch | 11 | 14:54:40 | |
3 | 32:30 | woman on left | arm and shoulder stretches | 12 | 15:03:30 | |
3 | 32:41 | guy in front | same arm and shoulder stretches as woman and neck stretches and shoulder rolls multiple times | 10 | 15:02:41 | |
3 | 32:20 | woman on left | back stretches and shoulder rolls | 12 | 15:02:20 | |
3 | 45:06 | guy in white tshirt | neck stretches | 11 | 15:15:06 | |
3 | 55:51 | woman on left | should stretches | 12 | 15:25:55 | |
3 | 1:20:59 | guys on right with white tshirt | neck stretches | 11 | 15:50:59 | |
3 | 1:27:50 | guy on right with white tshirt | neck stretches | 11 | 15:57:50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#read in the data | |
behavior.data = read.csv("/Users/michelleboisson/Documents/ITP//* DIY Health/assignment 3 - behavior experiement/behavior-data.csv",as.is=TRUE) | |
#creating a shortcut handle | |
bd = behavior.data | |
#convert the timestamp to seconds | |
just.times = bd$real_time | |
#this is a function I found online and modified | |
converted.times = sapply(strsplit(just.times,":"), | |
function(x) { | |
x <- as.numeric(x) | |
x[1]*60*60+x[2]*60+x[3] | |
} | |
) | |
#add it to the bd table | |
bd$converted_time = converted.times | |
#create a color for person with id ==1, we want to see what influences she might have on the others | |
colors = rep(1, nrow(bd)) | |
colors[which(bd$id == 1)] = 4 | |
#then pass that color to the graph | |
hist(bd$converted_time, breaks=10000, col=colors) | |
#this hist is too thin to see the colors, but with less breaks you can see it. | |
#I found this kind of plot online, and liked how it looked for the story we wanted to tell but I still can't get the color to show. | |
stripchart(bd$converted_time, col=colors, method='jitter') | |
# they are all blue, but I only want person with id 1 to be blue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment