# NOT RUN {
minages <- runif(250, 0, 65)
exmpl <- data.frame(accepted_name = sample(letters, size = 250, replace = TRUE),
lng = runif(250, min = 42, max = 51),
lat = runif(250, min = -26, max = -11),
min_ma = minages,
max_ma = minages + runif(250, 0.1, 65))
#a vector with the status for each record,
#make sure species are only classified as either extinct or extant,
#otherwise the function will drop an error
status <- sample(c("extinct", "extant"), size = nrow(exmpl), replace = TRUE)
#or from a list of species
status <- sample(c("extinct", "extant"), size = length(letters), replace = TRUE)
names(status) <- letters
status <- status[exmpl$accepted_name]
# }
# NOT RUN {
write_pyrate(x = exmpl,fname = "test", status = status)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab