Quarto with Github

news
code
analysis
Author

Edward F. Hillenaar

Published

March 20, 2024

A great table

Code
scat_table1 %>% 
  gt(rowname_col = "Species") %>% 
  cols_label(count ~ "Count") %>% 
  tab_header(title = "California poopies",
             subtitle = "Morphometric data on scat") %>% 
  tab_source_note(md("**Source**: Reid, R. E. B. (2015). A morphometric modeling approach to distinguishing among bobcat, coyote and gray fox scats. *Wildlife Biology*, 21(5), 254-262")) %>% 
  tab_spanner(label = "Physical averages",
              columns = Length:Mass) %>% 
  tab_stubhead(label = "Species")
California poopies
Morphometric data on scat
Species
Physical averages
d13C d15N Count
Length Diameter Mass
bobcat 9.3 19.0 12.5 -27.7 6.4 57
coyote 9.6 20.3 18.2 -24.8 10.4 28
gray_fox 9.0 15.0 5.6 -27.3 6.5 25
Source: Reid, R. E. B. (2015). A morphometric modeling approach to distinguishing among bobcat, coyote and gray fox scats. Wildlife Biology, 21(5), 254-262

A stylized version

Code
scat_table1 %>% 
  gt() %>% 
  cols_label(count ~ "Count") %>% 
  tab_header(title = "California poopies",
             subtitle = "Morphometric data on scat") %>% 
  tab_source_note(md("**Source**: Reid, R. E. B. (2015). A morphometric modeling approach to distinguishing among bobcat, coyote and gray fox scats. *Wildlife Biology*, 21(5), 254-262")) %>% 
  tab_spanner(label = "Physical averages",
              columns = Length:Mass) %>% 
  opt_stylize(style = 2, color = "blue")
California poopies
Morphometric data on scat
Species
Physical averages
d13C d15N Count
Length Diameter Mass
bobcat 9.3 19.0 12.5 -27.7 6.4 57
coyote 9.6 20.3 18.2 -24.8 10.4 28
gray_fox 9.0 15.0 5.6 -27.3 6.5 25
Source: Reid, R. E. B. (2015). A morphometric modeling approach to distinguishing among bobcat, coyote and gray fox scats. Wildlife Biology, 21(5), 254-262

Grouped data

Code
scat_table2 %>% 
  ungroup() %>% 
  gt(groupname_col = "Species")
Site Length Diameter Mass d13C d15N Count
bobcat
ANNU 9.3 19.0 12.4 -27.6 6.2 48
YOLA 9.3 18.9 13.0 -28.1 7.5 9
coyote
ANNU 8.8 20.2 18.7 -23.9 11.7 19
YOLA 11.2 20.4 17.4 -26.7 7.7 9
gray_fox
ANNU 9.0 15.0 5.6 -27.3 6.5 25