── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.4.4 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.0
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(pageviews) # This package gets data on Wikipedia viewinglibrary(DT) # DT stands for datatable, and creates interactive tableslibrary(infer) # for some stats like t_testlibrary(devtools)
Loading required package: usethis
#devtools::install_github("ironholds/pageviews")
Feb 14th 2018 and Feb 13th 2023 parkland Florida Michigan state university
shootings <-bind_rows(florida, michigan)shootings |>ggplot(aes(x = day, y = views, color = event)) +geom_line() +theme_minimal() +labs(x ="Days before/after Shooting", y ="Wikipedia Views", color ="Event", title ="Views of the Wikipedia Gun Control Article before and after Two Mass Shootings")
shootings |>mutate(after_event = (day >0))
project language article access agent granularity date
1 wikipedia en Gun_control all-access all-agents daily 2018-02-07
2 wikipedia en Gun_control all-access all-agents daily 2018-02-08
3 wikipedia en Gun_control all-access all-agents daily 2018-02-09
4 wikipedia en Gun_control all-access all-agents daily 2018-02-10
5 wikipedia en Gun_control all-access all-agents daily 2018-02-11
6 wikipedia en Gun_control all-access all-agents daily 2018-02-12
7 wikipedia en Gun_control all-access all-agents daily 2018-02-13
8 wikipedia en Gun_control all-access all-agents daily 2018-02-14
9 wikipedia en Gun_control all-access all-agents daily 2018-02-15
10 wikipedia en Gun_control all-access all-agents daily 2018-02-16
11 wikipedia en Gun_control all-access all-agents daily 2018-02-17
12 wikipedia en Gun_control all-access all-agents daily 2018-02-18
13 wikipedia en Gun_control all-access all-agents daily 2018-02-19
14 wikipedia en Gun_control all-access all-agents daily 2018-02-20
15 wikipedia en Gun_control all-access all-agents daily 2018-02-21
16 wikipedia en Gun_control all-access all-agents daily 2023-02-07
17 wikipedia en Gun_control all-access all-agents daily 2023-02-08
18 wikipedia en Gun_control all-access all-agents daily 2023-02-09
19 wikipedia en Gun_control all-access all-agents daily 2023-02-10
20 wikipedia en Gun_control all-access all-agents daily 2023-02-11
21 wikipedia en Gun_control all-access all-agents daily 2023-02-12
22 wikipedia en Gun_control all-access all-agents daily 2023-02-13
23 wikipedia en Gun_control all-access all-agents daily 2023-02-14
24 wikipedia en Gun_control all-access all-agents daily 2023-02-15
25 wikipedia en Gun_control all-access all-agents daily 2023-02-16
26 wikipedia en Gun_control all-access all-agents daily 2023-02-17
27 wikipedia en Gun_control all-access all-agents daily 2023-02-18
28 wikipedia en Gun_control all-access all-agents daily 2023-02-19
29 wikipedia en Gun_control all-access all-agents daily 2023-02-20
30 wikipedia en Gun_control all-access all-agents daily 2023-02-21
views day event after_event
1 599 -7 Florida FALSE
2 678 -6 Florida FALSE
3 519 -5 Florida FALSE
4 240 -4 Florida FALSE
5 319 -3 Florida FALSE
6 688 -2 Florida FALSE
7 707 -1 Florida FALSE
8 910 0 Florida FALSE
9 6117 1 Florida TRUE
10 6549 2 Florida TRUE
11 3612 3 Florida TRUE
12 3760 4 Florida TRUE
13 4229 5 Florida TRUE
14 4233 6 Florida TRUE
15 3914 7 Florida TRUE
16 529 -7 Michigan FALSE
17 504 -6 Michigan FALSE
18 494 -5 Michigan FALSE
19 516 -4 Michigan FALSE
20 404 -3 Michigan FALSE
21 364 -2 Michigan FALSE
22 478 -1 Michigan FALSE
23 660 0 Michigan FALSE
24 651 1 Michigan TRUE
25 590 2 Michigan TRUE
26 532 3 Michigan TRUE
27 419 4 Michigan TRUE
28 440 5 Michigan TRUE
29 507 6 Michigan TRUE
30 597 7 Michigan TRUE
Warning: The statistic is based on a difference or ratio; by default, for
difference-based statistics, the explanatory variable is subtracted in the
order "TRUE" - "FALSE", or divided in the order "TRUE" / "FALSE" for
ratio-based statistics. To specify this order yourself, supply `order =
c("TRUE", "FALSE")`.
# A tibble: 2 × 4
after_event Mean StdDev N
<lgl> <dbl> <dbl> <int>
1 FALSE 538. 167. 16
2 TRUE 2582. 2275. 14
The average number of views of the Wikipedia Gun Control article in the 7 days prior to the two shootings (M = 538.1, SD = 167.38) was not statistically significantly different from the average number of views in the 7 days after the shooting (M = 2582.14, SD = 2275.39), t(13.1) = 3.35, p = 0.005.