Post-process
Test sessions (animal names) contain XXX, we filter them and two erroneous dupes.
s1_demo = s1_demo %>%
filter(!session %contains% "XXX")
s3_daily = s3_daily %>%
filter(!session %contains% "XXX") %>%
arrange(session, created, modified) %>%
filter(!duplicated(cbind(session, created))) # one dupe mishap
twice_a_days <- s3_daily %>%
mutate(created_date = as.Date(created - hours(6))) %>%
group_by(session, created_date) %>%
filter(n() > 1) %>%
arrange(session, is.na(ended), created_date, ended) %>%
select(session, created_date, created, ended) %>%
filter(row_number() > 1) %>%
ungroup() %>%
select(session, created)
s3_daily = s3_daily %>%
anti_join(twice_a_days, by = c("session", "created"))
s1_filter = s1_filter %>%
filter(!session %contains% "XXX")
s2_initial = s2_initial %>%
filter(!session %contains% "XXX") %>%
filter(!duplicated(session)) # one dupe mishap with empty data
s4_followup = s4_followup %>%
filter(!session %contains% 'XXX')
# short names reichen auch aus um nutzer zu unterscheiden
s2_initial$short = stringr::str_sub(s2_initial$session, 1, 7)
s1_filter$short = stringr::str_sub(s1_filter$session, 1, 7)
s1_demo$short = stringr::str_sub(s1_demo$session, 1, 7)
s3_daily$short = stringr::str_sub(s3_daily$session, 1, 7)
s4_followup$short = stringr::str_sub(s4_followup$session, 1, 7)
s4_timespent$short = stringr::str_sub(s4_timespent$session, 1, 7)
s5_hadmenstruation$short = stringr::str_sub(s5_hadmenstruation$session, 1, 7)
Save
save(s1_demo, s1_filter, s2_initial, s3_daily, s4_followup, s4_timespent, s5_hadmenstruation, file = "data/pretty_raw.rdata")
LS0tCnRpdGxlOiAiSW1wb3J0IGRhdGEiCm91dHB1dDogCiAgaHRtbF9kb2N1bWVudDoKICAgIHRvYzogeWVzCiAgICB0b2NfZGVwdGg6IDUKICAgIGNvZGVfZm9sZGluZzogInNob3ciCi0tLQoKYGBge3IgZWNobz1GQUxTRX0Ka25pdHI6Om9wdHNfY2h1bmskc2V0KGV2YWwgPSBGQUxTRSkKYGBgCgoKYGBge3IgcmVzdWx0cz0naGlkZScsbWVzc2FnZT1GLHdh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