snap <- read_csv("Snap_Transparency_Report_H1-2024.csv")
## Rows: 22988 Columns: 7
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (7): period, section, category, sub_category_1, sub_category_2, metric, ...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Class of the value column:
class(snap$value)
## [1] "character"
is.numeric(snap$value) # FALSE
## [1] FALSE
is.character(snap$value) # TRUE
## [1] TRUE
Convert to numeric:
snap$value <- as.numeric(snap$value)
class(snap$value)
## [1] "numeric"
This data would be considered Long Data since the rows outweight the number of coloumns present. There are 22988 observations yet only 7 variables
snap_enforcement <- snap %>%
filter(section == "Overview of Our T&S Enforcements",
category == "Country")
snap_enforcement <- snap_enforcement %>%
select(-period, -section, -category)
snap_enforcement <- snap_enforcement %>%
rename(country = sub_category_1)
snap_enforcement <- snap_enforcement %>%
unite("country_category", country, sub_category_2, sep = "-", remove = FALSE) %>%
pivot_wider(names_from = metric, values_from = value)
head(snap_enforcement)
## # A tibble: 6 × 6
## country_category country sub_category_2 total_enforcements
## <chr> <chr> <chr> <dbl>
## 1 Afghanistan-Child Sexual Exploitati… Afghan… Child Sexual … 340
## 2 Afghanistan-Drugs Afghan… Drugs 27
## 3 Afghanistan-False Information Afghan… False Informa… 3
## 4 Afghanistan-Harassment and Bullying Afghan… Harassment an… 726
## 5 Afghanistan-Hate Speech Afghan… Hate Speech 5
## 6 Afghanistan-Impersonation Afghan… Impersonation 4
## # ℹ 2 more variables: total_unique_accounts_enforced <dbl>,
## # median_turnaround_time_minutes <dbl>
US_Enforcements <- snap_enforcement %>%
group_by(country) %>%
summarise(total_enforcements = sum(total_enforcements)) %>%
mutate(percentage = 100 * total_enforcements / sum(total_enforcements)) %>%
arrange(desc(percentage)) %>%
filter(country == "United States")
US_Enforcements
## # A tibble: 1 × 3
## country total_enforcements percentage
## <chr> <dbl> <dbl>
## 1 United States 7389396 38.1
Weapon_Enforcements <- snap_enforcement %>%
filter(sub_category_2 == "Weapons") %>%
summarise("Worldwide Weapon Enforcements" = sum(total_enforcements))
Weapon_Enforcements
## # A tibble: 1 × 1
## `Worldwide Weapon Enforcements`
## <dbl>
## 1 234512
snap_enforcement <- snap_enforcement %>%
mutate(enforcements_per_account = total_enforcements / total_unique_accounts_enforced)
Highest_enforced <- snap_enforcement %>%
arrange(desc(enforcements_per_account)) %>%
select(country, sub_category_2, total_enforcements,
total_unique_accounts_enforced, enforcements_per_account)
head(Highest_enforced, 5)
## # A tibble: 5 × 5
## country sub_category_2 total_enforcements total_unique_account…¹
## <chr> <chr> <dbl> <dbl>
## 1 Paraguay Weapons 14 1
## 2 Sierra Leone Child Sexual Explo… 121 13
## 3 South Korea Child Sexual Explo… 4211 526
## 4 Marshall Islands Sexual Content 11 2
## 5 Vietnam Weapons 5 1
## # ℹ abbreviated name: ¹​total_unique_accounts_enforced
## # ℹ 1 more variable: enforcements_per_account <dbl>
data("eu_countries")
eu_names <- eu_countries$name
eu_names[eu_names == "Czechia"] <- "Czech Republic"
eu_weapons <- snap_enforcement %>%
filter(sub_category_2 == "Weapons", country %in% eu_names)
ggplot(eu_weapons, aes(x = enforcements_per_account,
y = median_turnaround_time_minutes,
color = total_enforcements,
label = country)) +
geom_point(size = 3, alpha = 1) +
geom_text_repel(size = 3, color = "black", max.overlaps = Inf) +
scale_y_log10() +
scale_color_viridis_c(trans = "log10") +
labs(x = "Enforcements per unique account",
y = "Median enforcement time (minutes)",
color = "Total enforcements",
title = "Snapchat Weapons T&S response: enforcement intensity vs. time")
Interpretation: Countries with more enforcements per account tend to have a faster response time. France, Belgium, the Netherlands and Luxembourg are in the fast, and France also has by far the highest volume.