## PROCESSING ##################################################################
# Add a date -------------------------------------------------------------------
tour_data_clean <- tour_data |>
mutate(date = make_date(year, month, day)) |>
select(date, everything(), -c(year, month, day)) |>
separate_longer_delim(cols = notes, delim = ";") |>
mutate(notes = str_to_lower(notes),
notes = str_remove(notes, "s$"),
fauna = str_extract(string = notes, pattern = "[a-z ]+$"), # 3) Extract fauna
fauna = str_squish(fauna), # 4) Remove white space
n = str_extract(string = notes, pattern = "[:digit:]+"), # 5) Extract n
n = as.numeric(n)) |> # and make sure it's numeric
select(-notes) # 6) Remove notes