S17 · Chapter 9 · MC 451 Research Methods in Mass Media
Lab session
That one line creates the whole folder for you, already named and already wired together.
Note the v2v:: prefix. It says the function comes from this book’s package, so the package never becomes a hidden assumption.
twitch-portfolio/
├── twitch-portfolio.Rproj
├── _quarto.yml
├── README.md
├── codebook.qmd
├── analysis.qmd
├── data/
└── .Rprofile
You did not decide where anything goes or what to name it, which is the point.
setup() checks that R, the packages this book depends on, and the project environment are all present and agree on versions.
codebook.qmd.We are about to run glimpse(chat), which prints every column of the chat data.
Two minutes with a neighbor, then we run it and see.
Line one loads the tidyverse, the toolkit we use all term; the next two lines fetch the chat table and the stream table and give each a name with <-.
The data arrives through a function call, not a file path, which removes an entire category of beginner error. What you get is the working sample from the fifty-channel corpus, not the full 2018 collection.
Rows: 35,267
Columns: 5
$ id <int> 89, 551, 1033, 2094, 2803, …
$ channel <chr> "sodapoppin", "xqcow", "forsen", …
$ sender <chr> "madzee", "prometheanow", "spectre155", …
$ message <chr> "???????????????????????", "TriEasy Clap TriEasy…
$ date <dbl> 1542578127023, 1542578135562, 1542578143610, …
glimpse() prints every column, its type, and its first few values.
date is a <dbl>, an ordinary number, and is completely unreadableRows: 32,276
Columns: 6
$ channel <chr> "sodapoppin", "xqcow", "forsen", "giantwaffle", …
$ title <chr> "Hello truckers\n44835158804929_2115841973", …
$ game <chr> "Marble It Up!", "Just Chatting", "Artifact", …
$ viewers <int> 27934, 19381, 15300, 4697, 28076, …
$ date <dbl> 1542578200214, 1542578200240, 1542578200273, …
Each row is one snapshot of one stream at one moment: its title, its category, its viewer count, and when the snapshot was taken.
game n
1 Art 5298
2 Fortnite 3682
3 Just Chatting 2474
4 Hearthstone 2157
6 League of Legends 1952
# ℹ 50 more rows
count() tallies how often each value appears, and sort = TRUE puts the biggest first.
[1] 50
n_distinct() counts how many different values a column holds.
n_distinct(streams$channel) returns the same fiftyThe package ships the ones specific to this data: run ?v2v::common_errors for the year-50,888 timestamp, the join that matches nothing, and the surprisingly low kappa.
You should now have:
twitch-portfolio folder, created by new_portfolio()v2v::setup() resultcodebook.qmd, versioned and renderedchat and streams loaded, and a glimpse() of eachcodebook.qmd and render itglimpse() output on Thursday. We read the data against your codebook and find out whether your study is buildable.