Open lkbentley opened 1 year ago
I came across the same issue. It seems like several columns have changed. Below is my code and explanation that got me to run the detectionSummary.
Maybe this helps someone in the future.
data_raw <- read.csv("animal.csv")
receiver_raw <- read.csv("receiver.csv")
tag_raw <-read.csv("tag.csv")
tag_raw$tag_id <- data_raw$tag_id[match(tag_raw$transmitter_id, data_raw$transmitter_id)]
tag_raw <- tag_raw[!is.na(tag_raw$tag_id), ]
tag_raw <- tag_raw %>% left_join((data_raw %>% distinct(tag_id, .keep_all = TRUE))[, c("tag_id", "measurement")], by = "tag_id")
data_raw <- data_raw %>% rename(detection_timestamp = detection_datetime) data_raw <- data_raw %>% rename(longitude = receiver_deployment_longitude) data_raw <- data_raw %>% rename(latitude = receiver_deployment_latitude) data_raw <- data_raw %>% rename(sensor_value = transmitter_sensor_raw_value) data_raw <- data_raw %>% rename(sensor_unit = transmitter_sensor_unit)
receiver_raw <- receiver_raw %>% rename(deploymentdatetime_timestamp = receiver_deployment_datetime) receiver_raw <- receiver_raw %>% rename(recoverydatetime_timestamp = receiver_recovery_datetime) receiver_raw <- receiver_raw %>% rename(station_latitude = receiver_deployment_latitude) receiver_raw <- receiver_raw %>% rename(station_longitude = receiver_deployment_longitude) receiver_raw <- receiver_raw %>% rename(status = receiver_status)
tag_raw <- tag_raw %>% rename(ReleaseDate = transmitter_deployment_datetime) tag_raw <- tag_raw %>% rename(common_name = species_common_name) tag_raw <- tag_raw %>% rename(scientific_name = species_scientific_name) tag_raw <- tag_raw %>% rename(sex = animal_sex) tag_raw <- tag_raw %>% rename(tag_project_name = tagging_project_name) tag_raw <- tag_raw %>% rename(release_id = transmitter_deployment_id) # not working yet. not sure which other column this could be)
tag_raw <- tag_raw %>% rename(release_latitude = transmitter_deployment_latitude) tag_raw <- tag_raw %>% rename(release_longitude = transmitter_deployment_longitude) tag_raw <- tag_raw %>% rename(tag_expected_life_time_days = transmitter_estimated_battery_life) tag_raw <- tag_raw %>% rename(tag_status = transmitter_status)
ATTdata <- setupData(Tag.Detections = data_raw, Tag.Metadata = tag_raw, Station.Information = receiver_raw, source = "IMOS")
Cheers,
Getting errors in setupData + others where the expected columns are not in the data downloaded from IMOS.
A few examples:, in the detection data setupData is looking for
detection_timestamp
when the column is nameddetection_datetime
.For Station data, package expects:
deploymentdatetime_timestamp
andrecoverydatetime_timestamp
; and instead receives:receiver_deployment_datetime
andreceiver_recovery_datetime
.For Transmitter data, package expects:
ReleaseDate
but receivestransmitter_deployment_datetime
.detectionSummary is looking for a column named
Tag.ID
but all I have I the ATT object areTransmitter
columns. Suspect further changes will come to light the more functions I use!The obvious reason for this, I imagine, is that the IMOS export format has changed in the last couple of years. Can probably fix manually but wanted to bring to your attention. :)