Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identification of nights and days to exclude in data_cleaning_File #1168

Closed
jhmigueles opened this issue Jul 4, 2024 · 0 comments · Fixed by #1169
Closed

Identification of nights and days to exclude in data_cleaning_File #1168

jhmigueles opened this issue Jul 4, 2024 · 0 comments · Fixed by #1169
Assignees

Comments

@jhmigueles
Copy link
Collaborator

Line 197 in g.report.part4 tries to identify the nights that should be excluded from the nightsummary clean report by matching IDs and night numbers:

days2exclude = which(nightsummary$ID %in% DaCleanFile$ID & nightsummary$night %in% DaCleanFile$night_part4)

The way in which the matching is done is problematic as it looks separately for IDs and nights. For example, if the data_cleaning_file includes ID = 1 and night = 6, every night with ID == 1 would be excluded (even if night != 6), and every night == 6 too (even if ID != 1). See example here:

# Artificial data cleaning file indicating 4 nights to remove (1 from each recording)
DaCleanFile = data.frame(ID = 1:4,
                         night_part4 = 4:1)

# Artificial nightsummary, including 4 recordings of 4 nights each
nightsummary = data.frame(ID = rep(1:4, each = 4),
                          night = rep(1:4, times = 4))

# Line 197 in g.report.part4
days2exclude = which(nightsummary$ID %in% DaCleanFile$ID & nightsummary$night %in% DaCleanFile$night_part4)

# We would expect 4 nights to be removed from nightsummary, but we got 16 (all nights)
length(days2exclude) # 16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant