# generate occurrence data
x <- rep(1, 10)
y <- c(rep(1, 5), 2:6)
sp <- c(rep(letters[1:3], 2),
rep(letters[4:5], 2))
obs <- data.frame(x, y, sp)
# compare original and unique datasets:
# rows 4 and 5 removed as duplicates of rows 1 and 2, respectively
obs
uniqify(obs, taxVar = 3, xy = 1:2)
# using taxon identifications or other third variable is optional
uniqify(obs, xy = c('x', 'y'))
# caution - data outside the taxon and occurrence variables
# will be lost where associated with duplicate occurrences
obs$notes <- letters[11:20]
uniqify(obs, 1:2, 3)
# the notes 'n' and 'o' are absent in the output data
Run the code above in your browser using DataLab