Skip to content

Commit

Permalink
test expected dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
robitalec committed Dec 6, 2024
1 parent 2302498 commit 0a8e019
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/testthat/test-edge-delay.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,12 @@ edges_expect[dyadID == 'A-B']
delay <- edge_delay(edges_expect, DT_expect, window = window, id = id)

test_that('expected results are returned', {
DT_expect
edges_expect
delay

expect_lte(nrow(delay), nrow(edges_expect))
expect_lte(nrow(DT_expect), nrow(delay))

# Test average with na.rm leader is X
# Test max dir corr delay is X
# Test min dir corr delay is X
mean_delays <- delay[, mean(dir_corr_delay, na.rm = TRUE), by = ID1]

expect_equal(mean_delays[V1 == min(V1), ID1], LETTERS[1])
expect_equal(mean_delays[V1 == median(V1), ID1], LETTERS[ceiling(N_id / 2)])
expect_equal(mean_delays[V1 == max(V1), ID1], LETTERS[N_id])
})

0 comments on commit 0a8e019

Please sign in to comment.