У меня есть база данных выживания, которую я создал, которая описывает выживание для экспериментальных единиц (Module #
). Я собираюсь заполнить все пропущенные даты в Date.y записью даты для другой стороны модуля для определенного TimeStep, потому что обе стороны модуля всегда отбирались в один и тот же день. Например, для TimeStep_start == 4, Module #
115 не имеет записи даты для южной (S) стороны (см. Строку 14 в предоставленной базе данных). Однако на северной (N) стороне (строка 13) действительно есть запись даты для этого TimeStep_start == 4. Я хочу написать некоторый код, который бы автоматически заполнял информацию о недостающей дате датой с другой стороны того же модуля. , Я приложил базу данных здесь, чтобы использовать ее для ссылки, чтобы дать контекст, а также функцию, которую я написал для создания этой базы данных. Если возможно, я бы подумал, что лучше изменить функцию, чтобы заполнить даты таким образом, чтобы она применялась одинаково ко всем входным базам данных независимо от их структуры. Заранее спасибо!
ФУНКЦИЯ ПИСАНИЯ БАЗЫ ДАННЫХ
Survival_calc <- function(data, data_1, TimeStep_1, TimeStep_2, quarter){
data <- sub_3
data_1 <- data_final
Exclusion <- c("NF","D", "ND")
Grouping <- c("Date", "Site_long", "Shelter", "Module #", "Side")
Col_name <- paste(quarter, "Survival", sep = "_")
Start <- data %>% filter(TimeStep == TimeStep_1, !`Status Code` %in% Exclusion)
End <- data_1 %>% filter(TimeStep == TimeStep_2) %>%
inner_join(Start, by = c("ID", "Side", "Site_long", "Shelter", "Module #")) %>%
rename(Date = Date.x,
Status_Code = `Status Code.x`)
Start_summary <- Start %>% group_by_at(Grouping) %>%
count()
End_summary <- End %>% group_by_at(Grouping) %>%
summarize(corals = n(),
dead = sum(Status_Code %in% Exclusion),
n = corals - dead)
result_long <- left_join(Start_summary, End_summary, by = c("Site_long", "Shelter", "Module #", "Side")) %>%
mutate(survived = replace_na(n.y, 0)) %>%
mutate(TimeStep_start = TimeStep_1) %>%
mutate(TimeStep_end = TimeStep_2) %>%
mutate("Survival_prop" = (survived/n.x)) %>%
mutate(Quarter = quarter)
result_wide <- left_join(Start_summary, End_summary, by = Grouping) %>%
replace(is.na(.), 0) %>%
transmute(!!Col_name := (n.y/n.x) * 100)
return(result_long)
}
ГОЛОВА ДАННЫХ
# A tibble: 20 x 15
# Groups: Date.x, Site_long, Shelter, Module #, Side [51]
Date.x Site_long Shelter `Module #` Side Date.y n.x corals dead n.y survived TimeStep_start TimeStep_end Survival_prop Quarter
<date> <fct> <fct> <dbl> <chr> <date> <int> <int> <int> <int> <dbl> <dbl> <dbl> <dbl> <dbl>
1 2017-05-02 Hanauma Bay High 213 N 2017-08-08 2 2 1 1 1 1 4 0.5 1
2 2017-05-02 Hanauma Bay High 215 S 2017-08-08 1 1 0 1 1 1 4 1 1
3 2017-05-06 Waikiki Low 116 S 2017-08-09 3 3 0 3 3 1 4 1 1
4 2017-05-13 Waikiki High 115 N 2017-08-09 1 1 0 1 1 1 4 1 1
5 2017-05-13 Waikiki High 115 S 2017-08-11 1 1 1 0 0 1 4 0 1
6 2017-05-13 Waikiki Low 114 N 2017-08-11 5 5 1 4 4 1 4 0.8 1
7 2017-05-13 Waikiki Low 114 S 2017-08-11 5 5 1 4 4 1 4 0.8 1
8 2017-05-20 Waikiki Low 112 N 2017-08-11 1 1 1 0 0 1 4 0 1
9 2017-05-20 Waikiki Low 112 S 2017-08-11 1 1 0 1 1 1 4 1 1
10 2017-05-24 Waikiki High 111 S 2017-08-09 1 1 0 1 1 1 4 1 1
11 2017-08-08 Hanauma Bay High 213 N 2017-11-14 1 1 0 1 1 4 5 1 2
12 2017-08-08 Hanauma Bay High 215 N 2017-11-14 3 3 0 3 3 4 5 1 2
13 2017-08-09 Waikiki High 115 N 2017-11-05 1 1 0 1 1 4 5 1 2
14 2017-08-11 Waikiki High 115 S NA 1 NA NA NA 0 4 5 0 2
15 2017-08-11 Waikiki Low 112 N 2017-11-05 1 1 0 1 1 4 5 1 2
16 2017-08-11 Waikiki Low 112 S 2017-11-05 2 1 0 1 1 4 5 0.5 2
17 2017-08-11 Waikiki Low 114 N 2017-11-12 1 1 0 1 1 4 5 1 2
18 2017-08-12 Waikiki High 113 N 2017-11-10 1 1 0 1 1 4 5 1 2
19 2017-08-26 Waikiki Low 114 S NA 1 NA NA NA 0 4 5 0 2
20 2017-11-05 Waikiki Low 112 S 2018-03-13 1 1 0 1 1 5 6 1 3
БАЗА ДАННЫХ
data <- structure(list(Date.x = structure(c(17288, 17288, 17292, 17299,
17299, 17299, 17299, 17306, 17306, 17310, 17386, 17386, 17387,
17389, 17389, 17389, 17389, 17390, 17404, 17475, 17480, 17480,
17484, 17575, 17575, 17575, 17575, 17575, 17575, 17582, 17586,
17586, 17594, 17600, 17601, 17601, 17601, 17603, 17603, 17603,
17675, 17675, 17675, 17675, 17677, 17677, 17680, 17680, 17680,
17682, 17684, 17687, 17687, 17687, 17687, 17687, 17687, 17773,
17773, 17773, 17773, 17780, 17780, 17780, 17780, 17782, 17782,
17782, 17782, 17783, 17783, 17783, 17783, 17783, 17783, 17783,
17783, 17783, 17783, 17859, 17859, 17859, 17859, 17860, 17860,
17860, 17860, 17862, 17862, 17862, 17862, 17862, 17862, 17862,
17867, 17867, 17867, 17867, 17869, 17869, 17953, 17953, 17953,
17953, 17953, 17957, 17957, 17957, 17957, 17960, 17960, 17960,
17960, 17964, 17964, 17964, 17964, 17965, 17965, 17965, 17965,
17967, 17967, 17971, 18037, 18037, 18037, 18039, 18039, 18039,
18039, 18044, 18044, 18044, 18044, 18044, 18046, 18046, 18046,
18046, 18047, 18047, 18048, 18048, 18054, 18058, 18135, 18135,
18135, 18135, 18135, 18139, 18139, 18139, 18139, 18140, 18140,
18140, 18142, 18142, 18142, 18144, 18144, 18144, 18149), class = "Date"),
Site_long = structure(c(1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 1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L, 2L, 2L, 1L, 1L, 2L,
2L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 2L,
2L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L), .Label = c("High",
"Low"), class = "factor"), `Module #` = c(213, 215, 116,
115, 115, 114, 114, 112, 112, 111, 213, 215, 115, 115, 112,
112, 114, 113, 114, 112, 113, 113, 215, 213, 213, 215, 214,
216, 216, 211, 116, 116, 115, 113, 113, 114, 114, 111, 112,
112, 113, 113, 116, 116, 115, 115, 215, 215, 216, 112, 111,
213, 212, 212, 214, 214, 216, 115, 115, 112, 112, 111, 111,
114, 114, 113, 113, 116, 116, 211, 211, 213, 213, 215, 215,
212, 212, 216, 216, 113, 113, 114, 114, 111, 111, 116, 116,
211, 211, 215, 215, 212, 214, 216, 115, 115, 112, 112, 213,
213, 211, 212, 212, 216, 216, 115, 115, 112, 112, 213, 213,
214, 214, 111, 111, 116, 116, 113, 113, 114, 114, 215, 215,
211, 215, 215, 212, 113, 113, 114, 114, 213, 213, 214, 216,
216, 111, 111, 116, 116, 112, 112, 115, 115, 114, 212, 211,
212, 214, 214, 216, 113, 113, 114, 114, 115, 115, 112, 213,
215, 215, 111, 111, 116, 213), Side = c("N", "S", "S", "N",
"S", "N", "S", "N", "S", "S", "N", "N", "N", "S", "N", "S",
"N", "N", "S", "S", "N", "S", "N", "N", "S", "S", "S", "N",
"S", "N", "N", "S", "S", "N", "S", "N", "S", "S", "N", "S",
"N", "S", "N", "S", "N", "S", "N", "S", "N", "S", "S", "N",
"N", "S", "N", "S", "S", "N", "S", "N", "S", "N", "S", "N",
"S", "N", "S", "N", "S", "N", "S", "N", "S", "N", "S", "N",
"S", "N", "S", "N", "S", "N", "S", "N", "S", "N", "S", "N",
"S", "N", "S", "S", "N", "N", "N", "S", "N", "S", "N", "S",
"N", "N", "S", "N", "S", "N", "S", "N", "S", "N", "S", "N",
"S", "N", "S", "N", "S", "N", "S", "N", "S", "N", "S", "S",
"N", "S", "S", "N", "S", "N", "S", "N", "S", "N", "N", "S",
"N", "S", "N", "S", "N", "S", "N", "S", "N", "N", "N", "S",
"N", "S", "N", "N", "S", "N", "S", "N", "S", "N", "N", "N",
"S", "N", "S", "N", "S"), Date.y = structure(c(17386, 17386,
17387, 17387, 17389, 17389, 17389, 17389, 17389, 17387, 17484,
17484, 17475, NA, 17475, 17475, 17482, 17480, NA, 17603,
17600, 17600, 17575, 17687, 17687, 17680, 17687, 17680, 17687,
17687, NA, 17675, 17677, 17675, 17675, 17682, 17682, 17684,
17682, 17682, 17782, 17782, 17782, 17782, NA, 17773, 17783,
17783, 17783, 17773, 17780, 17783, 17783, 17783, 17783, 17783,
17783, 17867, 17867, NA, 17867, 17860, 17860, 17859, 17859,
17859, 17859, 17860, 17860, NA, 17862, 17869, 17869, 17862,
17862, 17862, 17862, 17862, 17862, 17965, 17965, 17965, 17965,
17964, 17964, 17964, 17964, 17953, 17971, 17967, 17967, 17953,
17960, 17953, 17957, 17957, 17957, 17957, 17960, 17960, 18037,
18037, 18037, 18044, 18044, 18048, 18048, 18047, 18047, 18044,
18044, 18044, 18044, 18046, 18046, 18046, 18046, 18039, 18039,
18039, 18039, 18037, 18037, 18037, 18142, 18142, 18135, 18139,
18139, 18139, 18139, 18142, 18142, 18135, 18135, 18135, 18144,
18144, 18144, 18144, 18140, 18140, 18140, 18140, 18139, 18135,
18226, 18226, 18226, 18226, 18226, 18223, 18223, 18224, 18224,
18230, 18230, 18230, 18233, 18233, 18233, 18231, 18231, 18231,
18233), class = "Date"), n.x = c(2L, 1L, 3L, 1L, 1L, 5L,
5L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L,
2L, 1L, 6L, 5L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 3L, 3L, 2L, 1L,
3L, 8L, 1L, 2L, 3L, 5L, 2L, 3L, 1L, 9L, 7L, 2L, 4L, 6L, 4L,
16L, 4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7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14
), TimeStep_end = c(4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5,
5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15), Survival_prop = c(0.5,
1, 1, 1, 0, 0.8, 0.8, 0, 1, 1, 1, 1, 1, 0, 1, 0.5, 1, 1,
0, 1, 0, 0.5, 1, 0.833333333333333, 0.4, 1, 0, 1, 1, 0, 0,
1, 1, 0.333333333333333, 0, 0, 0.666666666666667, 0.625,
0, 0.5, 0.333333333333333, 0.8, 1, 1, 0, 0.777777777777778,
1, 0.5, 0.5, 0.5, 0.75, 0.1875, 0.25, 1, 0, 0, 0.25, 0.5,
0.75, 0, 0.5, 0, 0.5, 0, 0.4, 0.5, 0.571428571428571, 0.4,
0.6, 0, 1, 0.111111111111111, 1, 0.545454545454545, 1, 0,
0.25, 0.333333333333333, 0, 1, 0.8, 0.5, 0.75, 0.8, 0.5,
1, 0.923076923076923, 1, 0.5, 0.666666666666667, 0.833333333333333,
0, 1, 1, 0.666666666666667, 1, 0.666666666666667, 0, 1, 0.5,
0.333333333333333, 0, 0.75, 0.363636363636364, 0.857142857142857,
0.909090909090909, 0.6, 0.5, 0.3, 0.714285714285714, 0.2,
0.4, 0.25, 0.833333333333333, 1, 0.875, 0.428571428571429,
0.333333333333333, 0.818181818181818, 0.666666666666667,
0.8125, 0.769230769230769, 0.833333333333333, 0, 0.416666666666667,
0.4, 0.4, 0.5, 0.75, 0.571428571428571, 0.375, 0.714285714285714,
0.6, 0.333333333333333, 0.4, 0.666666666666667, 0.5, 0.333333333333333,
0.666666666666667, 0.416666666666667, 0.285714285714286,
0, 0.454545454545455, 0, 4, 1, 1, 0, 1, 1, 0.5, 1, 1, 1,
0.75, 0, 0.666666666666667, 0.416666666666667, 0.75, 0.333333333333333,
1, 0.666666666666667, 0.4, 0.428571428571429, 1), Quarter = c(1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3,
3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10)), row.names = c(NA,
-165L), groups = structure(list(Date.x = structure(c(17288, 17288,
17288, 17288, 17288, 17292, 17292, 17292, 17292, 17299, 17299,
17299, 17299, 17299, 17299, 17306, 17306, 17306, 17306, 17306,
17310, 17310, 17310, 17310, 17386, 17386, 17386, 17386, 17386,
17387, 17387, 17387, 17387, 17389, 17389, 17389, 17389, 17389,
17389, 17390, 17390, 17390, 17390, 17404, 17404, 17404, 17404,
17475, 17475, 17475, 17475, 17480, 17480, 17480, 17480, 17480,
17484, 17484, 17484, 17484, 17575, 17575, 17575, 17575, 17575,
17575, 17575, 17575, 17582, 17582, 17582, 17582, 17586, 17586,
17586, 17586, 17586, 17594, 17594, 17594, 17594, 17600, 17600,
17600, 17600, 17601, 17601, 17601, 17601, 17601, 17603, 17603,
17603, 17603, 17603, 17675, 17675, 17675, 17675, 17675, 17675,
17677, 17677, 17677, 17677, 17677, 17680, 17680, 17680, 17680,
17680, 17682, 17682, 17682, 17682, 17684, 17684, 17684, 17684,
17687, 17687, 17687, 17687, 17687, 17687, 17687, 17687, 17773,
17773, 17773, 17773, 17773, 17773, 17780, 17780, 17780, 17780,
17780, 17780, 17782, 17782, 17782, 17782, 17782, 17782, 17783,
17783, 17783, 17783, 17783, 17783, 17783, 17783, 17783, 17783,
17783, 17783, 17859, 17859, 17859, 17859, 17859, 17859, 17860,
17860, 17860, 17860, 17860, 17860, 17862, 17862, 17862, 17862,
17862, 17862, 17862, 17862, 17862, 17867, 17867, 17867, 17867,
17867, 17867, 17869, 17869, 17869, 17869, 17869, 17953, 17953,
17953, 17953, 17953, 17953, 17953, 17957, 17957, 17957, 17957,
17957, 17957, 17960, 17960, 17960, 17960, 17960, 17960, 17964,
17964, 17964, 17964, 17964, 17964, 17965, 17965, 17965, 17965,
17965, 17965, 17967, 17967, 17967, 17967, 17967, 17971, 17971,
17971, 17971, 18037, 18037, 18037, 18037, 18037, 18039, 18039,
18039, 18039, 18039, 18039, 18044, 18044, 18044, 18044, 18044,
18044, 18044, 18046, 18046, 18046, 18046, 18046, 18046, 18047,
18047, 18047, 18047, 18047, 18048, 18048, 18048, 18048, 18048,
18054, 18054, 18054, 18054, 18058, 18058, 18058, 18058, 18135,
18135, 18135, 18135, 18135, 18135, 18135, 18139, 18139, 18139,
18139, 18139, 18139, 18140, 18140, 18140, 18140, 18140, 18142,
18142, 18142, 18142, 18142, 18142, 18144, 18144, 18144, 18144,
18144, 18149, 18149, 18149, 18149), class = "Date"), Site_long = structure(c(1L,
1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L,
2L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L,
1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L,
2L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L,
1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 2L,
1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L,
2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 1L,
2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 1L,
2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 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1L, 2L, 1L,
1L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L,
2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 2L, 1L,
1L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L,
1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L,
2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 2L,
1L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L,
1L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 2L,
1L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 1L,
2L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 1L,
2L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L,
1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L,
2L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 1L,
1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L), .Label = c("High",
"Low"), class = "factor"), `Module #` = c(213, 215, NA, NA, NA,
NA, NA, NA, 116, NA, NA, 115, 115, 114, 114, NA, NA, NA, 112,
112, NA, NA, 111, NA, 213, 215, NA, NA, NA, NA, NA, 115, NA,
NA, NA, 115, 112, 112, 114, NA, NA, 113, NA, NA, NA, NA, 114,
NA, NA, NA, 112, NA, NA, 113, 113, NA, 215, NA, NA, NA, 213,
213, 215, 214, 216, 216, NA, NA, 211, NA, NA, NA, NA, NA, NA,
116, 116, NA, NA, 115, NA, NA, NA, 113, NA, NA, NA, 113, 114,
114, NA, NA, 111, 112, 112, NA, NA, 113, 113, 116, 116, NA, NA,
115, 115, NA, 215, 215, 216, NA, NA, NA, NA, NA, 112, NA, NA,
111, NA, 213, 212, 212, 214, 214, 216, NA, NA, NA, NA, 115, 115,
112, 112, NA, NA, 111, 111, 114, 114, NA, NA, 113, 113, 116,
116, 211, 211, 213, 213, 215, 215, 212, 212, 216, 216, NA, NA,
NA, NA, 113, 113, 114, 114, NA, NA, 111, 111, 116, 116, 211,
211, 215, 215, 212, 214, 216, NA, NA, NA, NA, 115, 115, 112,
112, 213, 213, NA, NA, NA, 211, 212, 212, 216, 216, NA, NA, NA,
NA, 115, 115, 112, 112, 213, 213, 214, 214, NA, NA, NA, NA, 111,
111, 116, 116, NA, NA, 113, 113, 114, 114, 215, 215, NA, NA,
NA, 211, NA, NA, NA, 215, 215, 212, NA, NA, NA, NA, 113, 113,
114, 114, 213, 213, 214, 216, 216, NA, NA, NA, NA, 111, 111,
116, 116, NA, NA, NA, 112, 112, NA, NA, 115, 115, NA, NA, NA,
NA, 114, NA, 212, NA, NA, 211, 212, 214, 214, 216, NA, NA, NA,
NA, 113, 113, 114, 114, NA, NA, 115, 115, 112, 213, 215, 215,
NA, NA, NA, NA, NA, 111, 111, 116, 213, NA, NA, NA), Side = c("N",
"S", NA, NA, NA, NA, NA, NA, "S", NA, NA, "N", "S", "N", "S",
NA, NA, NA, "N", "S", NA, NA, "S", NA, "N", "N", NA, NA, NA,
NA, NA, "N", NA, NA, NA, "S", "N", "S", "N", NA, NA, "N", NA,
NA, NA, NA, "S", NA, NA, NA, "S", NA, NA, "N", "S", NA, "N",
NA, NA, NA, "N", "S", "S", "S", "N", "S", NA, NA, "N", NA, NA,
NA, NA, NA, NA, "N", "S", NA, NA, "S", NA, NA, NA, "N", NA, NA,
NA, "S", "N", "S", NA, NA, "S", "N", "S", NA, NA, "N", "S", "N",
"S", NA, NA, "N", "S", NA, "N", "S", "N", NA, NA, NA, NA, NA,
"S", NA, NA, "S", NA, "N", "N", "S", "N", "S", "S", NA, NA, NA,
NA, "N", "S", "N", "S", NA, NA, "N", "S", "N", "S", NA, NA, "N",
"S", "N", "S", "N", "S", "N", "S", "N", "S", "N", "S", "N", "S",
NA, NA, NA, NA, "N", "S", "N", "S", NA, NA, "N", "S", "N", "S",
"N", "S", "N", "S", "S", "N", "N", NA, NA, NA, NA, "N", "S",
"N", "S", "N", "S", NA, NA, NA, "N", "N", "S", "N", "S", NA,
NA, NA, NA, "N", "S", "N", "S", "N", "S", "N", "S", NA, NA, NA,
NA, "N", "S", "N", "S", NA, NA, "N", "S", "N", "S", "N", "S",
NA, NA, NA, "S", NA, NA, NA, "N", "S", "S", NA, NA, NA, NA, "N",
"S", "N", "S", "N", "S", "N", "N", "S", NA, NA, NA, NA, "N",
"S", "N", "S", NA, NA, NA, "N", "S", NA, NA, "N", "S", NA, NA,
NA, NA, "N", NA, "N", NA, NA, "N", "S", "N", "S", "N", NA, NA,
NA, NA, "N", "S", "N", "S", NA, NA, "N", "S", "N", "N", "N",
"S", NA, NA, NA, NA, NA, "N", "S", "N", "S", NA, NA, NA), .rows = list(
1L, 2L, integer(0), integer(0), integer(0), integer(0), integer(0),
integer(0), 3L, integer(0), integer(0), 4L, 5L, 6L, 7L, integer(0),
integer(0), integer(0), 8L, 9L, integer(0), integer(0), 10L,
integer(0), 11L, 12L, integer(0), integer(0), integer(0),
integer(0), integer(0), 13L, integer(0), integer(0), integer(0),
14L, 15L, 16L, 17L, integer(0), integer(0), 18L, integer(0),
integer(0), integer(0), integer(0), 19L, integer(0), integer(0),
integer(0), 20L, integer(0), integer(0), 21L, 22L, integer(0),
23L, integer(0), integer(0), integer(0), 24L, 25L, 26L, 27L,
28L, 29L, integer(0), integer(0), 30L, integer(0), integer(0),
integer(0), integer(0), integer(0), integer(0), 31L, 32L,
integer(0), integer(0), 33L, integer(0), integer(0), integer(0),
34L, integer(0), integer(0), integer(0), 35L, 36L, 37L, integer(0),
integer(0), 38L, 39L, 40L, integer(0), integer(0), 41L, 42L,
43L, 44L, integer(0), integer(0), 45L, 46L, integer(0), 47L,
48L, 49L, integer(0), integer(0), integer(0), integer(0),
integer(0), 50L, integer(0), integer(0), 51L, integer(0),
52L, 53L, 54L, 55L, 56L, 57L, integer(0), integer(0), integer(0),
integer(0), 58L, 59L, 60L, 61L, integer(0), integer(0), 62L,
63L, 64L, 65L, integer(0), integer(0), 66L, 67L, 68L, 69L,
70L, 71L, 72L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, integer(0),
integer(0), integer(0), integer(0), 80L, 81L, 82L, 83L, integer(0),
integer(0), 84L, 85L, 86L, 87L, 88L, 89L, 90L, 91L, 92L,
93L, 94L, integer(0), integer(0), integer(0), integer(0),
95L, 96L, 97L, 98L, 99L, 100L, integer(0), integer(0), integer(0),
101L, 102L, 103L, 104L, 105L, integer(0), integer(0), integer(0),
integer(0), 106L, 107L, 108L, 109L, 110L, 111L, 112L, 113L,
integer(0), integer(0), integer(0), integer(0), 114L, 115L,
116L, 117L, integer(0), integer(0), 118L, 119L, 120L, 121L,
122L, 123L, integer(0), integer(0), integer(0), 124L, integer(0),
integer(0), integer(0), 125L, 126L, 127L, integer(0), integer(0),
integer(0), integer(0), 128L, 129L, 130L, 131L, 132L, 133L,
134L, 135L, 136L, integer(0), integer(0), integer(0), integer(0),
137L, 138L, 139L, 140L, integer(0), integer(0), integer(0),
141L, 142L, integer(0), integer(0), 143L, 144L, integer(0),
integer(0), integer(0), integer(0), 145L, integer(0), 146L,
integer(0), integer(0), 147L, 148L, 149L, 150L, 151L, integer(0),
integer(0), integer(0), integer(0), 152L, 153L, 154L, 155L,
integer(0), integer(0), 156L, 157L, 158L, 159L, 160L, 161L,
integer(0), integer(0), integer(0), integer(0), integer(0),
162L, 163L, 164L, 165L, integer(0), integer(0), integer(0))), row.names = c(NA,
-304L), class = c("tbl_df", "tbl", "data.frame"), .drop = FALSE), class = c("grouped_df",
"tbl_df", "tbl", "data.frame"))