4 Creating a simple depth summary table

Make a depth summary table and just take a look at the first 5 entries using the ‘head’ function.

sum_tbl <-
  d %>%
  group_by(Genus) %>%
  summarize(
    Phylum = paste(unique(Phylum), collapse= " | "),
    ScientificName = paste(unique(ScientificName), collapse= " | "),
    Records = n(),
    MinDepth = min(as.numeric(DepthInMeters)),
    MedianDepth = median(as.numeric(DepthInMeters)),
    MaxDepth = max(as.numeric(DepthInMeters))) %>%
  arrange(MedianDepth)

kable(head(sum_tbl))
Genus Phylum ScientificName Records MinDepth MedianDepth MaxDepth
Antipathella Cnidaria Antipathella 4 306 335.5 362
Eguchipsammia Cnidaria Eguchipsammia fistula 4 334 352.0 376
Gymnorete Porifera Gymnorete 3 343 353.0 392
Dendropathes Cnidaria Dendropathes 2 363 367.0 371
Aphanipathes Cnidaria Aphanipathes 2 350 377.0 404
Tylopathes Cnidaria Tylopathes 4 362 392.0 423