library(tidyverse)
library(janitor)
Join into profiles
This notebooks takes the two cleaned files and joins them together into a single file.
Setup
Import
<- read_rds("data-processed/rosters.rds")
rosters <- read_rds("data-processed/others.rds") others
Joining the two lists
Now that the data has been cleaned properly, this isn’t as huge a deal.
<- rosters |>
roster_profiles_joined left_join(others, by = join_by(club_short, name))
roster_profiles_joined
And now to fill in missing false values. This is an interesting and complex maneuver.
Change all the variables where the datatype is logical, and use replace_na() to fill black valuse with FALSE.
<- roster_profiles_joined |>
roster_profiles_clean mutate(
across(where(is.logical), ~ replace_na(.x, FALSE) )
)
roster_profiles_clean
Export
|> write_csv("data-out/profiles.csv")
roster_profiles_clean |> write_rds("data-processed/profiles.rds") roster_profiles_clean