expersso / gesis

R Client for GESIS Data Catalogue (DBK)
14 stars 1 forks source link

Fix #12 issue with 3-digit GESIS identifiers #16

Closed briatte closed 5 years ago

briatte commented 5 years ago

This PR does two things:

  1. If doi is an actual DOI instead of a GESIS identifier, it converts it to a GESIS identifier.
  2. If the GESIS identifier lacks a trailing zero, it adds it.

The PR adds a new internal function, get_gesis_id, to do so. It uses httr, which is already imported by the package, and is otherwise coded in base R in order to avoid adding dependencies.

I refrained from adding any additional checks on doi, although GESIS identifiers are, it seems, always made of four digits, so that could also get checked at some point.

I also refrained from changing the rest of the codes, including the messages, that call GESIS identifiers "DOI", in order not to disrupt the discussion in #12 about this.

briatte commented 5 years ago

Hi @expersso

I'm reviewing my code from last month. Anything you need me to add to this PR?

expersso commented 5 years ago

Hi @briatte,

Sorry, I received this during a very busy period, so I must have missed it.

The changes look great. Should we perhaps add some details in the documentation for the relevant functions that they now accept proper DOIs as well as Gesis identifiers?

briatte commented 5 years ago

Hi @expersso

Don't be sorry, I'm also knee-deep into (mostly late) work.

I can update the docs, sure -- just leave a comment here to remind me to do so (I'm travelling for conferences right now) :-)

briatte commented 5 years ago

Alright, forget my previous comment, I updated the documentation for the doi argument in the functions where it appears -- see above!