Skip to content

Commit

Permalink
Add quality checks for public response data
Browse files Browse the repository at this point in the history
  • Loading branch information
erictleung committed Nov 11, 2024
1 parent eb400f5 commit 48db31e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion data-raw/get_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,16 @@ public_response <-
imdb_ratings %>%
rename(imdb_score = imdb_rating, imdb_counts = imdb_votes),
by = "film"
) %>%
mutate(
across(starts_with("rotten"), ~ as.numeric(.x)),
across(starts_with("metacritic"), ~ as.numeric(.x)),
across(starts_with("imdb"), ~ as.numeric(.x))
)

# Manual quality checks, scores should be 0-100 or 0-10 and counts >0
summary(public_response)


# Clean academy data ------------------------------------------------------

Expand Down Expand Up @@ -570,7 +578,7 @@ academy <-
TRUE ~ award_type
))

# Quality checks on if there are any typos or anomalous values
# Manual quality checks on if there are any typos or anomalous values
academy %>%
group_by(award_type) %>%
count(award_type) %>%
Expand All @@ -581,6 +589,7 @@ academy %>%
count(status) %>%
arrange(n)


# Convert Vox analysis matrix ---------------------------------------------

# Source:
Expand Down

0 comments on commit 48db31e

Please sign in to comment.