R Markdown Article on the Hawks Dataset

The data contains information on three species of hawks:

CH=Cooper’s,RT=Red-Tailed, SS=Sharp-Shinned.

In each case the dataset provides data on the Sex (male of female), Age (Immature or Adult), the length (mm) of the wings, culmen, hallux and tail, and the weight of the hawk (g).

In analysing this data I will use the following libraries & packages tidyverse, plotly, kableExtra and readr, dplyr and rmarkdown

Percentage of Hawks by Species

Below is a graph of the division of hawks by species, the histogram labels are rounded to two decimal places for ease but the graph itself will display the exact percentage figure. Its clear that the Red Tailed Hawk is the largest percentage population in the group surveyed.

ggplotly(fig)

Wingspan of the Hawks

The mean and standard deviation of wingspan for the hawks, divided by species can be seen below. The species with largest wingspan is Red Tailed Hawk, followed by Cooper’s and Sharp Shinned. All have a large standard deviation which infers a lot of variability of the wingspan. This is consistent in the fact that there are adults and infants in the population and their size and wingspan would be varied.

# A tibble: 3 × 3
  Species mean_wingspan sd_wingspan
  <chr>           <dbl>       <dbl>
1 CH               244.        31.7
2 RT               383.        31.5
3 SS               185.        22.4

Histograms

The interactive histogram below displays the distribution of tail lengths among different species of hawks. Each bar represents a range of tail lengths, and the height of the bar indicates the frequency of hawks within that range.

We can see the Sharp Shinned hawks have the shortest tail length and are grouped to the left in blue, and the Red Tailed Hawk, and Cooper’s are more aligned in size but the Red Tailed Hawk extends longer than the other species.

  TailFig <- hawks %>%
  ggplot(aes(x = Tail, fill = Species)) + 
  geom_histogram(binwidth = 10,colour = "black",)+ 
  labs(title = "Histogram of Hawk Tail Length by Species",
       x = "Tail Length",
       y = "Frequency") +
  theme_minimal()

ggplotly(TailFig)

Boxplots

The interactive boxplot below displays the distribution of wingspan among different species of hawks, with each boxplot filled according to the respective species.

  • There are variations in wingspan among different species of hawks.

  • Some species may have wider or narrower ranges of wingspan compared to others .

  • The median wingspan (middle line of the box) and the interquartile range (length of the box) provide insights into the central tendency and spread of wingspan for each species.

  • Outliers, represented by points beyond the whiskers, may indicate individuals with unusually high or low wingspan measurements within a species.

As we saw from the earlier table, Red Tailed Hawks have the wider wingspan, but they also have the most outliers and as they have the biggest population this would make sense that there is more variation. We are also aware of infants in the population so that could account for low outliers.

WingFig <- hawks%>%
  ggplot(aes(x = Species, y = Wing, fill = Species)) +
  geom_boxplot() +
  labs(title = "Boxplot of Hawk Wingspan by Species",
       x = "Species",
       y = "Wingspan") +
  theme_minimal()

ggplotly(WingFig)

Tail Length vs Wingspan

The scatterplot above displays the relationship between tail length and wingspan for different species of hawks. Each point represents an individual hawk, with its position on the plot determined by its wingspan (x-axis) and tail length (y-axis).

From the scatterplot, we can make several observations:

  • There appears to be a positive correlation between tail length and wingspan, suggesting that hawks with longer wingspans tend to have longer tails.
  • The relationship between tail length and wingspan may vary among different species, as indicated by the different patterns and clusters of points corresponding to each species.
  • Some species exhibit tighter clusters of points, indicating less variability in tail length and wingspan within those species, while others show more scattered distributions, suggesting greater variability.

WingTail <- hawks%>%
  ggplot(aes(x = Wing, y = Tail, color = Species)) +
  geom_point() +
  labs(title = "Scatterplot of Tail Length vs Wingspan by Species",
       x = "Wingspan",
       y = "Tail Length") +
  theme_minimal()

ggplotly(WingTail)