Categorical Data

Using this fake data of bovid occurrences, do the following:

Problem 1

Use the tidyr package to reshape the data into a 4 X 8 contingency table with 4 rows representing taxa and 8 colums representing sites (not counting row or column headers).

Problem 2

Make a beautiful faceted barplot showing bovid communities across the different sites. Hint: you can use geom_bar() in ggplot to make a bar plot, like we did in the political party example in class. However, for the in-class example we had a dataframe of raw observations, but here you already have the counts for each group. To use these counts directly, use geom_bar(stat="identity")

Problem 3

Perform the appropriate statistical analysis to test the hypothesis of a relationship between site and taxon. In other words….are the taxon abundances different among the different sites? Explain your choice of analysis and your interpretation.