Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cr_works(dois = single_doi) returned a data.frame, not a tibble #184

Merged
merged 7 commits into from
Mar 7, 2019
Merged

cr_works(dois = single_doi) returned a data.frame, not a tibble #184

merged 7 commits into from
Mar 7, 2019

Conversation

charliejhadley
Copy link
Contributor

Description

cr_works() returned a tibble of results in every case except when provided with a single DOI to the dois argument. This meant a loss of data in the authors and other columns.

Related Issue

I didn't make an issue for this PR... should I always make an issue before doing the PR?

Example

Here's how the existing package handles a single DOI:

library("rcrossref")
library("tidyverse")
cr_works(dois = "10.1080/17458080903490731")$data
#>              alternative.id                     container.title    created
#> 1 10.1080/17458080903490731 Journal of Experimental Nanoscience 2010-07-05
#>    deposited published.print                       doi    indexed
#> 1 2017-06-19         2010-06 10.1080/17458080903490731 2018-05-03
#>                  issn issue  issued member    page  prefix
#> 1 1745-8080,1745-8099     3 2010-06    301 251-262 10.1080
#>            publisher reference.count score   source
#> 1 Informa UK Limited              21     1 Crossref
#>                                                                                                          title
#> 1 Size control of magnetite nanoparticles by organic solvent-free chemical coprecipitation at room temperature
#>              type                                         url volume
#> 1 journal-article http://dx.doi.org/10.1080/17458080903490731      5
#>                                                                                                                                        author
#> 1 Tomohiro, Naoya, Satoru, Takeshi, Tomoji, Iwasaki, Mizutani, Watano, Yanagida, Kawai, first, additional, additional, additional, additional
#>                                                                                                  link
#> 1 http://www.tandfonline.com/doi/pdf/10.1080/17458080903490731, unspecified, vor, similarity-checking
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               reference
#> 1 CIT0001, CIT0002, CIT0003, CIT0004, CIT0005, CIT0006, CIT0007, CIT0008, CIT0009, CIT0010, CIT0011, CIT0012, CIT0013, CIT0014, CIT0015, CIT0016, CIT0017, CIT0018, CIT0019, CIT0020, CIT0021, 10.1088/1748-6041/2/2/011, 10.1016/j.actbio.2007.05.011, 10.1002/jbm.a.30901, 10.1016/j.ssc.2003.11.043, 10.1016/j.matlet.2007.02.018, 10.1016/j.matlet.2006.11.032, 10.1007/BF01124679, 10.1007/BF02403885, 10.1016/j.colsurfa.2007.04.108, 10.1016/j.matlet.2008.06.034, 10.1080/10715760000300431, 10.1007/s12034-008-0112-3, 10.1006/jcis.1998.5741, 10.1021/es970547m, 10.1016/S0010-938X(02)00184-1, NA, 10.1016/0927-7757(95)03479-X, NA, NA, 10.1246/bcsj.47.1646, NA, publisher, publisher, crossref, publisher, publisher, publisher, publisher, publisher, publisher, publisher, publisher, publisher, publisher, publisher, publisher, NA, publisher, NA, NA, publisher, NA, NA, NA, Wang X, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, Kuroki T, NA, Jolivet J-P, Cornell RM, NA, Inoue A, NA, NA, 80, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 119, NA, NA, NA, NA, 45, NA, NA, 852, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 484, NA, NA, NA, NA, 250, NA, NA, 2007, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 2003, NA, 2000, 2003, NA, 2006, NA, NA, J. Biomed. Mater. Res. A, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, J. Min. Mater. Proc. Inst. Jpn., NA, NA, NA, NA, J. Clay Sci. Soc. Jpn., NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, Metal Oxide Chemistry and Synthesis: From Solution to Solid State, The Iron Oxides: Structure, Properties, Reactions, Occurrences and Uses, NA, NA

Created on 2019-02-28 by the reprex package (v0.2.1)

And here's how it behaves now

library("rcrossref")
library("tidyverse")
cr_works(dois = "10.1080/17458080903490731")$data
#> # A tibble: 1 x 24
#>   alternative.id container.title created deposited published.print doi  
#>   <chr>          <chr>           <chr>   <chr>     <chr>           <chr>
#> 1 10.1080/17458… Journal of Exp… 2010-0… 2017-06-… 2010-06         10.1…
#> # … with 18 more variables: indexed <chr>, issn <chr>, issue <chr>,
#> #   issued <chr>, member <chr>, page <chr>, prefix <chr>, publisher <chr>,
#> #   reference.count <chr>, score <chr>, source <chr>, title <chr>,
#> #   type <chr>, url <chr>, volume <chr>, author <list>, link <list>,
#> #   reference <list>

Created on 2019-02-28 by the reprex package (v0.2.1)

@codecov-io
Copy link

codecov-io commented Feb 28, 2019

Codecov Report

Merging #184 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #184   +/-   ##
=======================================
  Coverage   50.76%   50.76%           
=======================================
  Files          30       30           
  Lines        1499     1499           
=======================================
  Hits          761      761           
  Misses        738      738
Impacted Files Coverage Δ
R/cr_works.R 90.9% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 87d91f1...342a6a0. Read the comment docs.

@sckott
Copy link
Contributor

sckott commented Feb 28, 2019

thanks @martinjhnhadley for this.

you don't always have to make an issue. i'd say make an issue first if it's "sufficiently complex"

@sckott
Copy link
Contributor

sckott commented Feb 28, 2019

please add the .Rproj file to .gitignore

@charliejhadley
Copy link
Contributor Author

Is it not more useful to have it not gitignored? Other ropensci packages have them, I think it’s a useful standard.

@sckott
Copy link
Contributor

sckott commented Feb 28, 2019

I don't use rstudio for the most part

@sckott
Copy link
Contributor

sckott commented Mar 6, 2019

any thoughts @martinjhnhadley ?

@charliejhadley
Copy link
Contributor Author

Done 😃

@sckott
Copy link
Contributor

sckott commented Mar 7, 2019

thanks much @martinjhnhadley

@sckott sckott merged commit 03d5740 into ropensci:master Mar 7, 2019
@sckott sckott added this to the v1.0 milestone Mar 7, 2019
@sckott sckott modified the milestones: v1.0, v0.9.2 May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants