Skip to content

Instantly share code, notes, and snippets.

@mark-andrews
Last active October 20, 2020 09:57
Show Gist options
  • Save mark-andrews/52ebc927b1bad593a7b09b4b5ce3b723 to your computer and use it in GitHub Desktop.
Save mark-andrews/52ebc927b1bad593a7b09b4b5ce3b723 to your computer and use it in GitHub Desktop.
Use read.csv with string
library(readr)
music_df <- read_tsv(file =
'Subject TimeGuess Music
subj1 43 control
subj2 18 control
subj3 68 control
subj4 26 control
subj5 40 control
subj6 47 control
subj7 29 control
subj8 38 control
subj9 29 control
subj10 41 control
subj11 36 control
subj12 23 control
subj13 52 control
subj14 48 control
subj15 34 control
subj16 40 control
subj17 27 control
subj18 21 control
subj19 33 control
subj20 48 control
subj1 53 upbeat
subj2 28 upbeat
subj3 67 upbeat
subj4 49 upbeat
subj5 66 upbeat
subj6 50 upbeat
subj7 46 upbeat
subj8 47 upbeat
subj9 68 upbeat
subj10 61 upbeat
subj11 43 upbeat
subj12 40 upbeat
subj13 81 upbeat
subj14 63 upbeat
subj15 49 upbeat
subj16 52 upbeat
subj17 31 upbeat
subj18 64 upbeat
subj19 52 upbeat
subj20 47 upbeat
subj1 56 calm
subj2 28 calm
subj3 93 calm
subj4 58 calm
subj5 76 calm
subj6 70 calm
subj7 67 calm
subj8 55 calm
subj9 74 calm
subj10 67 calm
subj11 57 calm
subj12 43 calm
subj13 100 calm
subj14 73 calm
subj15 62 calm
subj16 56 calm
subj17 33 calm
subj18 94 calm
subj19 51 calm
subj20 49 calm
')
music_df <- read.csv(text =
'Subject TimeGuess Music
subj1 43 control
subj2 18 control
subj3 68 control
subj4 26 control
subj5 40 control
subj6 47 control
subj7 29 control
subj8 38 control
subj9 29 control
subj10 41 control
subj11 36 control
subj12 23 control
subj13 52 control
subj14 48 control
subj15 34 control
subj16 40 control
subj17 27 control
subj18 21 control
subj19 33 control
subj20 48 control
subj1 53 upbeat
subj2 28 upbeat
subj3 67 upbeat
subj4 49 upbeat
subj5 66 upbeat
subj6 50 upbeat
subj7 46 upbeat
subj8 47 upbeat
subj9 68 upbeat
subj10 61 upbeat
subj11 43 upbeat
subj12 40 upbeat
subj13 81 upbeat
subj14 63 upbeat
subj15 49 upbeat
subj16 52 upbeat
subj17 31 upbeat
subj18 64 upbeat
subj19 52 upbeat
subj20 47 upbeat
subj1 56 calm
subj2 28 calm
subj3 93 calm
subj4 58 calm
subj5 76 calm
subj6 70 calm
subj7 67 calm
subj8 55 calm
subj9 74 calm
subj10 67 calm
subj11 57 calm
subj12 43 calm
subj13 100 calm
subj14 73 calm
subj15 62 calm
subj16 56 calm
subj17 33 calm
subj18 94 calm
subj19 51 calm
subj20 49 calm
', sep = '\t')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment