df <- tibble::tibble(
eventDate = paste0(rep(c(2020:2024), 3), "-01-01"),
basisOfRecord = "humanObservation",
site = rep(c("A01", "A02", "A03"), each = 5)
)
# Add composite ID using a random ID, site name and eventDate
df |>
set_occurrences(
occurrenceID = composite_id(random_id(),
site,
eventDate)
)
# Add composite ID using a sequential number, site name and eventDate
df |>
set_occurrences(
occurrenceID = composite_id(sequential_id(),
site,
eventDate)
)
Run the code above in your browser using DataLab