Closed debpaul closed 9 years ago
there is a Fields option in the API to select which fields to return.
On Fri, Jan 23, 2015 at 11:33 AM, Debbie Paul notifications@github.com wrote:
Hi All, does the api support returning a list of distinct taxon names for which we have specimens, if we provide the higher taxonomy or if we search by project, institutioncode, or collection code? A user found all our lichen/bryophytes - and downloaded the dataset - they were very happy. But they said, "now I have to do a lot of work to get just a list of the distinct taxon names present." I'm thinking the api may provide this already? Of course a count(distinct taxon names) would be useful too. If your answer is yes, I'm looking forward to the example.
— Reply to this email directly or view it on GitHub https://github.com/iDigBio/idigbio-search-api/issues/1.
library(ridigbio) ?
recsets <- c("cd5bc13d-ee5c-4b68-a550-37edb3e7899d", "4830ffb8-669a-4717-bec8-2f2374f52120") df <- idig_search(idig_query=list(recordset=recsets), limit=100) namefactor <- as.factor(df$scientificname) print(namefactor)
I haven't written a function to work with the recordsets end point yet so here I've just hard-coded a couple of recordsets from the publishers web page that contain "Lichen" or "Bryophite" in their name. You could also use the search with higher taxonomy to get something that's actually correct but I don't know the genera of all the lichens so I can't do that.
Time, including looking for a pretty-print R function (and failing): 8 minutes.
Matthew Collins IT Expert - Systems Programmer & Administrator Advanced Computing and Information Systems Lab, ECE University of Florida 352-392-5414callto:352-392-5414
From: Greg T. notifications@github.com Sent: Friday, January 23, 2015 12:19 PM To: iDigBio/idigbio-search-api Subject: Re: [idigbio-search-api] Use Case distinct taxon names (#1)
there is a Fields option in the API to select which fields to return.
On Fri, Jan 23, 2015 at 11:33 AM, Debbie Paul notifications@github.com wrote:
Hi All, does the api support returning a list of distinct taxon names for which we have specimens, if we provide the higher taxonomy or if we search by project, institutioncode, or collection code? A user found all our lichen/bryophytes - and downloaded the dataset - they were very happy. But they said, "now I have to do a lot of work to get just a list of the distinct taxon names present." I'm thinking the api may provide this already? Of course a count(distinct taxon names) would be useful too. If your answer is yes, I'm looking forward to the example.
Reply to this email directly or view it on GitHub https://github.com/iDigBio/idigbio-search-api/issues/1.
Reply to this email directly or view it on GitHubhttps://github.com/iDigBio/idigbio-search-api/issues/1#issuecomment-71228719.
This can also be done via the summary API's top function, although the result is limited to 5000 unique values:
https://github.com/iDigBio/idigbio-search-api/wiki#top-n-records
Example (the top 5000 unique scientific names in the FLMNH collections):
Hi All, does the api support returning a list of distinct taxon names for which we have specimens, if we provide the higher taxonomy or if we search by project, institutioncode, or collection code? A user found all our lichen/bryophytes - and downloaded the dataset - they were very happy. But they said, "now I have to do a lot of work to get just a list of the distinct taxon names present." I'm thinking the api may provide this already? Of course a count(distinct taxon names) would be useful too. If your answer is yes, I'm looking forward to the example.