Tidy Tuesday – Frog Distributions in Time and Space | R-Bloggers

Tidy Tuesday – Frog Distributions in Time and Space | R-Bloggers

[This article was first published on John Russell, and kindly contributed to R-bloggers]. (You can report problems here about the content on this page)


Do you want to share your content on R-bloggers? Click here if you have a blog, or here If you don’t.

Graphic and cartographic distributions

I work my way to neat Tuesday and I wanted to do something that combined both spatial and temporary data. The Frogid set of week 35 of 2025 has both, so let’s take a look.

This is also my first message with Positron via Rstudio, so we will see how things are going!

Load the required packages and the data

Code in R
library(tidyverse)
library(rnaturalearth)
library(sf)
library(patchwork)

tuesdata <- tidytuesdayR::tt_load(2025, week = 35)
frogID <- tuesdata$frogID_data
frognames <- tuesdata$frog_names

view(frogID)
view(frognames)

I love how Positron automatically shows data of data when you view a data frame! Looking at the two data frames, it looks like frogID has the locations and times of observations, while frognames Has some extra taxonomic information, which might be fun to participate. A strange thing is that the scientific names in it frogID Have some additional information after the name of the species, so we have to clean it up a bit.

Participate in the data frames and clean up the data

Code in R
frogID <- frogID |>
  left_join(frognames |> 
    select(scientificName, subfamily,tribe) |>
    mutate(scientificName = word(scientificName, 1, 2)) |>
    distinct(), by = "scientificName")

Divisions over space

The first distribution I want to watch is the spatial distribution of frog observations. The data all comes from Australia, so let’s get a map from Australia and plot the points on it.

Code in R
# pull the map of australia
australia <- ne_states(country = "australia", returnclass = "sf")

From here it is just a matter of plotting the points on the map. I will color the points of stam and make them a little transparent, so that we can see areas with more observations.

Code in R
## map the frogs over australia by density

australia |> 
  ggplot() +
  geom_sf(fill = "lightgrey") +
  geom_point(data = frogID |> 
    filter(!is.na(tribe)), 
            aes(x = decimalLongitude, y = decimalLatitude, color=tribe), size = 0.5, alpha = 0.7) +
 # geom_density_2d(data = frogID, aes(x = decimalLongitude, y = decimalLatitude), alpha = 0.6, contour_var = "count") +
  theme_void() +
  theme(legend.position = "bottom",
        legend.text = element_text(size=12)) +
  labs(title = "Frog Species in Australia",
       subtitle = "Locations of various frog species across Australia",
       caption = "Tidy Tuesday (2025, Week 35)",
      color="") +
  coord_sf(xlim = c(110, 155), ylim = c(-45, -10))

It is not surprising that most observations are along the coast, where the climate is probably more hospitable for frogs, but also for civil scientists (so there may be some bias in the data)!

Look at the distribution of identifications per hour of the day

I was also curious about the temporary distribution of frog identification. The eventTime Column has the time of the day on which the identification was made, so let’s look at that per hour of the day.

Code in R
day <- frogID |>
  filter(!is.na(hour(eventTime)), 
          !is.na(tribe)) |>
  ggplot(aes(x = hour(eventTime), fill = tribe)) +
  geom_histogram(binwidth = 1, position = "stack", color = "black") +
  theme_minimal() +
  labs(title = "Frog Identifications by Hour of Day",
       x = "Hour of Day",
       y = "Number of Identifications",
       fill = "",
       caption = "Tidy Tuesday (2025, Week 35)") +
  scale_x_continuous(breaks = 0:23) +
  theme(legend.position = "bottom")

day

Interesting is that there are two peaks in identification, one around 9/10 and one around 8 p.m. This does not fully correspond to sunrise and twilight, which are probably the moments when frogs are the most active, but it can reflect when people are most likely looking for frogs.

Look at the distribution of identifications per month

Finally, let’s take a look at the distribution of frog identification per month. This gives us an idea of ​​when people most likely identify frogs.

Code in R
month <- frogID |>
  filter(!is.na(month(eventDate)), 
          !is.na(tribe)) |>
  ggplot(aes(x = month(eventDate), fill = tribe)) +
  geom_histogram(binwidth = 1, position = "stack", color = "black") +
  theme_minimal() +
  labs(title = "Frog Identifications by Month",
       x = "Month",
       y = "Number of Identifications",
       fill = "",
       caption = "Tidy Tuesday (2025, Week 35)") +
  scale_x_continuous(breaks = 1:12, labels = month.abb) +
  theme(legend.position = "bottom")

month

It is not surprising that spring and summer months (October to February) have the most identifications, which is probably when frogs are most active and when people are looking outside more often.

Combining the temporary sudden

Code in R
collected <- (month + labs(caption="")) + day + plot_layout(ncol = 2, guides = "collect") & theme(legend.position = "bottom")

collected

This pulls the two temporary suddenly together in one figure, which is a little easier to compare.

Quote

Bibtex quote:

@online{russell2025,
  author = {Russell, John},
  title = {Tidy {Tuesday} - {Frog} {Distributions} in {Time} and
    {Space}},
  date = {2025-09-02},
  url = {https://drjohnrussell.github.io/posts/2025-09-02-time-and-frogs/},
  langid = {en}
}

Name this work for:

Russell, John. 2025. “Tidy Tuesday – Frog Distributions in Time and Space.” September 2, 2025. https://drjohnusell.github.io/posts/2025-09-02Time-and-frogs/.


#Tidy #Tuesday #Frog #Distributions #Time #Space #RBloggers

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *