Ecotourism:

ecology
tourism
spatial
time series
R package
Linked tables of wildlife occurrences, monthly domestic tourism trips by region, and daily weather, for practising joins.
Modified

3 December 2026

NoteAt a glance
Source ecotourism R package, compiled from the Atlas of Living Australia (via galah), Tourism Research Australia, NOAA GSOD weather (via GSODR) and ABS SA2 boundaries
Access R package, installed from GitHub
Licence The package is MIT licensed; the underlying data keep their original licences (e.g. ALA records are mostly CC BY)
Time coverage 2014–2024: occurrences by date and time, tourism by month, weather by day
Spatial coverage Australia; tourism by SA2 area (about 2,350 areas), weather at 12 stations
Update frequency Static snapshot (package version 0.1.0)
Size 13 tables; the largest is tourism_activity (320,188 rows), and the occurrence tables have 124 (glowworms) to 35,052 (orchids) rows
Fresh? Not directly, but the data-raw/ scripts in the GitHub repository show how to rebuild each table, and students can download new occurrence records with galah
Local? Australian wildlife, Australian tourism regions and Australian weather stations

Overview

The ecotourism package brings together three kinds of data that can be linked: sightings of four groups of organisms (glowworms, Gouldian finches, manta rays and orchids) from the Atlas of Living Australia, estimates of domestic overnight tourist trips from Tourism Research Australia’s National Visitor Survey, and daily weather. Each sighting has its nearest weather station (ws_id), and each tourism area (sa2_code_tra) has a location and nearest station. This means questions such as “Do people see more manta rays on calm days?” or “Are nature-based trips more common in regions where orchids are flowering?” need several joins, making it a good data set for teaching relational data. The four organisms are examples: students can use the same structure for any organism they download from the ALA.

Getting the data

# install.packages("pak")
pak::pak("vahdatjavad/ecotourism")
library(ecotourism)

data(package = "ecotourism")   # list the tables
data(manta_rays, weather, top_stations)

oz_sa2 is an sf object, so load the sf package before working with it.

Data dictionary

The tables join on three keys: ws_id (weather station), sa2_code_tra (tourism area), and stop_activity / stop_reason (lookup codes). There is a diagram of how they link on the package website.

Occurrences: glowworms, gouldian_finch, manta_rays, orchids

One row per sighting. All four tables have the same 14 columns. Sizes: 124, 3,922, 953 and 35,052 rows (orchids covers 444 species).

variable class description
obs_lat, obs_lon numeric Location of the sighting (decimal degrees).
date Date Date of the sighting.
time character Time of the sighting, HH:MM:SS (00:00:00 often means unknown, see below).
year, month, day, hour, dayofyear numeric/integer Parts of the date and time.
weekday ordered factor Day of the week, Monday first.
sci_name character Scientific name, e.g. Mobula alfredi, Chloebia gouldiae.
record_type character ALA basis of record, e.g. HUMAN_OBSERVATION, MACHINE_OBSERVATION, PRESERVED_SPECIMEN.
obs_state character State or territory of the sighting (NA for offshore sightings).
ws_id character Nearest weather station, joins to weather_stations and weather.

Tourism: tourism_activity, tourism_reason

Estimated domestic overnight trips, by month, SA2 area and the activity done (or reason for stopping) on the trip. Only non-zero estimates are included. 320,188 and 196,044 rows.

variable class description
year integer Year, 2014–2024.
month ordered factor Month the trip ended (January to December).
sa2_code_tra integer SA2 area code used by Tourism Research Australia; joins to tourism_region and oz_sa2.
stop_activity / stop_reason integer Activity or reason code; joins to tourism_activity_name / tourism_reason_name.
trips numeric Estimated number of overnight trips, in thousands.
n_sample integer Number of survey responses behind the estimate.

Lookups and locations

table rows contents
tourism_activity_name 8 stop_activity, name: e.g. Outdoor / nature, Active outdoor / sports, Arts / heritage.
tourism_reason_name 7 stop_reason, name: e.g. Holiday, Visiting friends and relatives, Business.
tourism_region 2,353 state, region (TRA tourism region), sa2 (SA2 name), lon, lat, ws_id (nearest station), sa2_code_tra (character).
oz_sa2 2,350 sf polygons of 2021 SA2 boundaries (GDA2020), with sa2_code_tra (integer) and a representative lat, lon inside each area.
weather_stations 732 ws_id, stname, stn_lat, stn_lon, address, stn_city, stn_state.
top_stations 12 organism, ws_id: the 3 stations linked to the most sightings of each organism.

Weather: weather

Daily weather from GSOD for the 12 stations in top_stations, 2014–2024. 46,390 rows.

variable class description
ws_id, stn_lat, stn_lon character, numeric Station ID and location.
date, year, month, day, weekday, dayofyear Date and its parts.
temp, min, max numeric Mean, minimum and maximum temperature (°C).
dewp numeric Dew point (°C).
rh numeric Relative humidity (%).
prcp numeric Precipitation (mm).
rainy integer 1 if prcp > 5 mm, else 0 (see below).
wind_speed, max_speed numeric Mean and maximum sustained wind speed (m/s).

Teaching ideas

  • Joins: combine sightings with the weather on the day (ws_id and date), or tourism trips with region names and activity labels. Students have to work out the keys from the diagram, and deal with the type mismatch and the missing weather (see below).
  • Seasonality: compare when each organism is seen (by month or dayofyear) with when nature-based trips peak in nearby regions. Orchid sightings follow flowering seasons, and Gouldian finch sightings follow the dry season in the north.
  • Weather and sightings: are manta rays seen more often on calm days, or glowworms after rain? This needs the days with no sightings too, which leads to a discussion of presence-only data.
  • Maps: plot sightings over the oz_sa2 polygons, and shade the SA2 areas by nature-based trips.
  • Time series: monthly tourism trips by activity, including the drop during COVID-19 lockdowns in 2020–21.
  • Survey uncertainty: use n_sample to discuss how reliable small-area survey estimates are.
  • One organism per student: give each student a different animal or plant, downloaded from the ALA with galah in the same format as the package’s occurrence tables, and have them answer the questions in Used in by joining it to the weather and tourism tables. Everyone uses the same methods but gets a different answer, which makes copying hard and makes it interesting to compare results in class.

Things to watch out for

  • The sa2_code_tra type differs between tables: it is integer in tourism_activity, tourism_reason and oz_sa2, but character in tourism_region (which also has 3 rows where it is NA). Convert before joining, e.g. mutate(sa2_code_tra = as.integer(sa2_code_tra)).
  • Weather is only for 12 stations: most occurrence and tourism ws_id values have no match in weather (only 18% of orchid sightings and 54% of Gouldian finch sightings match). Either restrict to sightings near the top_stations, or download more stations with GSODR.
  • Missing weather values: 42% of prcp values are missing, and about 20% of temperature and humidity values. rainy is 0 (not NA) when prcp is missing, so it counts missing days as dry. Recompute it as if_else(prcp > 5, 1, 0) to keep the NAs.
  • Unknown times: a time of 00:00:00 usually means no time was recorded (72% of manta ray records), so don’t use hour for these.
  • Presence-only data: sightings show where and when people looked, not where the organisms are absent. Sighting counts follow where tourists and naturalists go (and when they’re on holiday), which makes the link to tourism data interesting and confounded.
  • Odd records: a few Gouldian finch sightings are far outside the species’ northern range (one each in Victoria, South Australia and the ACT), and are probably aviary birds. Most manta ray records (675 of 953) are MACHINE_OBSERVATIONs, i.e. automated detections rather than people’s sightings; check the ALA record source before treating them as tourist sightings.
  • Tourism estimates are survey-based: trips is in thousands, and 88% of tourism_activity rows are based on fewer than 5 survey responses. Zero estimates were removed, so missing combinations mean zero (or no data), not NA.
  • Don’t add up trips across activities or reasons: a trip can include several activities, so summing trips over stop_activity counts it more than once. Totals are fine for comparing changes over time (e.g. the 2020 drop), but not as the number of trips.
  • Domestic trips only: international visitors are not included.

Used in

  • Monash assignment (Di Cook): each student was given an organism from the ALA and asked to investigate it using the weather and tourism data, with questions like:
    • Is the animal or plant occurrence seasonal?
    • Where in Australia are you most likely to see it?
    • Are sightings related to the weather? Are there fewer sightings when it is wet?
    • Is there evidence that tourists travel to see it?

References