If you would like to return to information from the previous section, please click here
Representing the spatial location of coral reef monitoring sites provides useful context for their relationship to other geographic features (e.g. offshore islands, rivers, lagoons). The inclusion of information of spatial trends in coral reef attributes (e.g. percent cover, fish abundance) can also assist in identifying trends with potential environmental or anthropogenic drivers.
This wiki page provides examples of using “on-the-fly” data
summaries and ggplot()
to represent spatial attributes of
coral reef monitoring data.
Visualising time series data spatially can be challenging. This is largely due to the representation of site locations on a map is essentially two-dimensional. In order to depict changes through time (as a third or fourth dimension), data summaries, indices of change, and the use of size and colour become important elements for visualising monitoring data spatially.
One benefit of having our data_intermediate
objects in a
standardised, formatted and “long” format means that data
summaries and filtering are relatively straight forward in
R
.
For example, using the regional WIO benthic data we can set the
Country
, benthic_code
, Station
and Year
s of interest for restricting the summary data. By
summarising the percent cover or change during a set number years can be
used to represent patterns over a given time period:
# set years of interest
years_of_interest <-
seq(from = 2014,
to = 2019)
Or alternatively, numerous time periods can be created to
facet_grid()
for visualising spatial changes through
time.
The use of colour can also provide ways to visualise different coral reef ecosystem elements (e.g. Hard Coral and Macroalgae). Here we focus on the Comoros Archipelago as an example of summarising data, filtering and zooming on a particular area of interest:
# get bounds
country_limits <-
wio_regional_benthic_data %>%
dplyr::filter(Latitude < 0) %>%
group_by(Country) %>%
summarise(lim_n = Latitude %>% max(na.rm = TRUE),
lim_e = Longitude %>% min(na.rm = TRUE),
lim_w = Longitude %>% max(na.rm = TRUE),
lim_s = Latitude %>% min(na.rm = TRUE))
# set country of interest
country_of_interest <-
c("Comoros")
# set plot limits
plot_bounds <-
country_limits %>%
dplyr::filter(Country %in% country_of_interest)
# set taxa of interest
taxa_of_interest <-
c("HC",
"ATRF")
# summarise over transects and dates
wio_regional_benthic_data %>%
dplyr::filter(Year %in% years_of_interest) %>%
group_by(Country,
Station,
Year,
benthic_code,
benthic_name,
Latitude,
Longitude) %>%
summarise(percent_cover = percent_cover %>% mean(na.rm = TRUE)) %>%
dplyr::filter(Country %in% country_of_interest) %>%
dplyr::filter(benthic_code %in% taxa_of_interest) %>%
ggplot() +
geom_sf(fill = "grey75",
colour = "grey75",
size = 0.1,
data = wio_coastline %>%
dplyr::select(id)) +
geom_point(aes(x = Longitude,
y = Latitude,
colour = benthic_code,
size = percent_cover),
alpha = 0.7) +
theme_nothing() +
coord_sf(xlim = c(plot_bounds$lim_w, plot_bounds$lim_e),
ylim = c(plot_bounds$lim_n, plot_bounds$lim_s),
datum = 4326) +
scale_colour_manual(values = c_palette) +
theme(strip.text.y = element_text(angle = 0))
Which looks something like this:
Note that this figure uses the aesthetics to illustrate the relative
percent cover and benthic_code
(i.e. “HC”: Hard Coral and
“ATRF”: Algal Turf), showing that sites on the northwestern island have
a greater percent cover of Algal turf.
Further control of the visualisation of the different
benthic_code
s can be accomplished using a lower
alpha
value or position = "jitter"
.