ropensci / rdatacite

Wrapper to DataCite metadata
https://docs.ropensci.org/rdatacite
Other
25 stars 3 forks source link

Funny error. #14

Closed SimonGoring closed 6 years ago

SimonGoring commented 6 years ago

I'll work through it to see why, but the call:

neotoma_dois <- dc_facet(q = "publisher:[Neotoma]",  fl = c('doi','publicationYear'))
Error in vapply(elements, encode, character(1)) : 
  values must be length 1,
 but FUN(X[[5]]) result is length 2
sckott commented 6 years ago

blarg, vapply error - may just be need to account for variation in length of outputs from their API

sckott commented 6 years ago

also, usually in a facet, you specify a field to facet on :)

sckott commented 6 years ago

changes in 6933394926b26d23a765c0c833206282335c1516

sckott commented 6 years ago

@SimonGoring install dev version devtools::install_github("ropensci/rdatacite") - which will require and pull in dev version of solrium, the solr client

two things;

  1. for facet, you need to pass in at least one faceting variable. the docs in dc_facet point to docs for solrium::solr_facet to see what the possible params are
  2. param fl is actually ignored in dc_facet and solrium::solr_facet since the fxn focuses only on faceting data.

it's not clear to me if you wanted facet data or if you just wanted back documents (therefore dc_search).

there is a fxn solrium::solr_all to which you can do whatever you want (get all types of solr data back: documents, facets, highlights, groups, etc.) but it's not wrapped in rdatacite yet