data(monographaR_examples)
monographaR_examples$dichoKey -> dat
colnames(dat)[1] <- "species"
### Prepare matrix (polymorphic)
dataKey(dat, poly.sep = "/") -> dat.k
dat.k$dat -> dat.p
### key
dichoKey(dat.p) -> key
length(key$unresolved)
# Export
#cat(key$key, file="Pleiochiton_key.txt")
### key with costs
dat.k$summary
((dat.k$summary)+1) -> dat.c
colnames(dat.p)
dat.c[2] <- max(dat.c)
dat.c[11] <- max(dat.c)
dichoKey(dat.p, dat.c, cp=0) -> key.c
length(key.c$unresolved)
# Export
#cat(key.c$key, file="Pleiochiton_key_costs.txt")
Run the code above in your browser using DataLab