ropensci / neotoma

Programmatic R interface to the Neotoma Paleoecological Database.
https://docs.ropensci.org/neotoma
Other
30 stars 16 forks source link

Compile geochron table lists & chronology table lists to a data.frame #182

Open SimonGoring opened 9 years ago

SimonGoring commented 9 years ago

In general this is probably just a do.call but it's problematic because the get_chroncontrol does not return the parent site, so we don't know exactly what the parent datasets are (in the worst case):

Currently my proposed solution is this:

chron.list <- get_chroncontrol(1:1000)
compiled.list <- data.frame(site.index = rep(1:length(chron.list), sapply(chron.list, length))
                                               do.call(rbind.data.frame, the chron.list))

The site.index column could then be associated with sites if we know the site order. If the function had inputs for chron.table and assoc.index where assoc.index could be a site, dataset or other site type we could then associate them.