Averaging Concentration

Once zooplankton concentration has been calculated, you can average casts within the set depth bins. This is similar to merging casts. However, with the average approach, the standard deviation between casts is also provided. For averaging casts, a name_map must be provided. This is a list structure with each item a character vector of profileids corresponding to the names of casts. The names of each item will be the name of the new-average casts. Averaging should be done on similar casts. Such as daytime at the same station and nighttime at the same station, etc.

library(EcotaxaTools)
# describe name map
day_night_map <- list(
    day = c('bats361_ctd1, bats361_ctd3', 'bats361_ctd5'),
    night = c('bats361_ctd2', 'bats361_ctd4', 'bats361_ctd6')
)

#get average concentration for day & night of rhizaria taxa
avg_zoo_conc <- ecopart_example |> 
    mod_zoo(names_keep, keep_names = c('Acantharea','Phaeodaria','Foraminifera'), keep_children = T) |>
    add_zoo(names_to, col_name = 'name', new_names = c('Acantharea','Phaeodaria','Foraminifera'), suppress_print = T) |>
    uvp_zoo_conc(cast_name = c('bats361_ctd1', 'bats361_ctd3', 'bats361_ctd5',
                               'bats361_ctd2', 'bats361_ctd4', 'bats361_ctd6'),
                 breaks = c(0, 500, 100)) |>
    average_casts(name_map = day_night_map) |>
    lapply(bin_format)

avg_zoo_conc
$day
         db        group      mean sd min_d max_d    mp
1   (0,100] Foraminifera 0.2183740  0     0   100  50.0
2   (0,100]   Phaeodaria 0.2183740  0     0   100  50.0
3 (100,500] Foraminifera 0.0000000  0   100   500 300.0
4 (100,500]   Phaeodaria 0.4353050  0   100   500 300.0
5 (500,517] Foraminifera 0.0000000  0   500   517 508.5
6 (500,517]   Phaeodaria 0.6370644  0   500   517 508.5

$night
               db        group       mean        sd min_d max_d   mp
1         (0,100]   Acantharea 0.24551351 0.2420503     0   100   50
2         (0,100] Foraminifera 0.50519084 0.0000000     0   100   50
3         (0,100]   Phaeodaria 0.88440932 0.3553993     0   100   50
4       (100,500]   Acantharea 0.30365844 0.1184528   100   500  300
5       (100,500] Foraminifera 0.00000000 0.0000000   100   500  300
6       (100,500]   Phaeodaria 0.41411801 0.2147690   100   500  300
7  (500,1.01e+03]   Acantharea 0.30333364 0.0000000   500  1010  755
8  (500,1.01e+03]   Phaeodaria 0.83416750 0.0000000   500  1010  755
9  (500,1.21e+03]   Acantharea 0.10717884 0.0000000   500  1210  855
10 (500,1.21e+03] Foraminifera 0.00000000 0.0000000   500  1210  855
11 (500,1.21e+03]   Phaeodaria 0.69666245 0.0000000   500  1210  855
12  (500,3.5e+03]   Acantharea 0.06180172 0.0000000   500  3500 2000
13  (500,3.5e+03]   Phaeodaria 0.21012584 0.0000000   500  3500 2000