-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrorcid.html
More file actions
1490 lines (1399 loc) · 325 KB
/
rorcid.html
File metadata and controls
1490 lines (1399 loc) · 325 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="author" content="Clarke Iakovakis" />
<title>rorcid walkthrough</title>
<script src="site_libs/header-attrs-2.9/header-attrs.js"></script>
<script src="site_libs/jquery-1.11.3/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="site_libs/bootstrap-3.3.5/css/spacelab.min.css" rel="stylesheet" />
<script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<style>h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }</style>
<script src="site_libs/jqueryui-1.11.4/jquery-ui.min.js"></script>
<link href="site_libs/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
<script src="site_libs/tocify-1.9.1/jquery.tocify.js"></script>
<script src="site_libs/navigation-1.1/tabsets.js"></script>
<link href="site_libs/highlightjs-9.12.0/default.css" rel="stylesheet" />
<script src="site_libs/highlightjs-9.12.0/highlight.js"></script>
<link href="site_libs/pagedtable-1.1/css/pagedtable.css" rel="stylesheet" />
<script src="site_libs/pagedtable-1.1/js/pagedtable.js"></script>
<script src="site_libs/kePrint-0.0.1/kePrint.js"></script>
<link href="site_libs/lightable-0.0.1/lightable.css" rel="stylesheet" />
<script src="site_libs/htmlwidgets-1.5.3/htmlwidgets.js"></script>
<link href="site_libs/jsoneditor-5.25.6/jsoneditor.min.css" rel="stylesheet" />
<script src="site_libs/jsoneditor-5.25.6/jsoneditor.min.js"></script>
<script src="site_libs/jsonedit-binding-3.0.0/jsonedit.js"></script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">code{white-space: pre;}</style>
<script type="text/javascript">
if (window.hljs) {
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
if (document.readyState && document.readyState === "complete") {
window.setTimeout(function() { hljs.initHighlighting(); }, 0);
}
}
</script>
<link rel="stylesheet" href="styles.css" type="text/css" />
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
pre code {
padding: 0;
}
</style>
<style type="text/css">
.dropdown-submenu {
position: relative;
}
.dropdown-submenu>.dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #cccccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #adb5bd;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left>.dropdown-menu {
left: -100%;
margin-left: 10px;
border-radius: 6px 0 6px 6px;
}
</style>
<script type="text/javascript">
// manage active state of menu based on current page
$(document).ready(function () {
// active menu anchor
href = window.location.pathname
href = href.substr(href.lastIndexOf('/') + 1)
if (href === "")
href = "index.html";
var menuAnchor = $('a[href="' + href + '"]');
// mark it active
menuAnchor.tab('show');
// if it's got a parent navbar menu mark it active as well
menuAnchor.closest('li.dropdown').addClass('active');
// Navbar adjustments
var navHeight = $(".navbar").first().height() + 15;
var style = document.createElement('style');
var pt = "padding-top: " + navHeight + "px; ";
var mt = "margin-top: -" + navHeight + "px; ";
var css = "";
// offset scroll position for anchor links (for fixed navbar)
for (var i = 1; i <= 6; i++) {
css += ".section h" + i + "{ " + pt + mt + "}\n";
}
style.innerHTML = "body {" + pt + "padding-bottom: 40px; }\n" + css;
document.head.appendChild(style);
});
</script>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "";
border: none;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- code folding -->
<style type="text/css">
#TOC {
margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#TOC {
position: relative;
width: 100%;
}
}
@media print {
.toc-content {
/* see https://github.com/w3c/csswg-drafts/issues/4434 */
float: right;
}
}
.toc-content {
padding-left: 30px;
padding-right: 40px;
}
div.main-container {
max-width: 1200px;
}
div.tocify {
width: 20%;
max-width: 260px;
max-height: 85%;
}
@media (min-width: 768px) and (max-width: 991px) {
div.tocify {
width: 25%;
}
}
@media (max-width: 767px) {
div.tocify {
width: 100%;
max-width: none;
}
}
.tocify ul, .tocify li {
line-height: 20px;
}
.tocify-subheader .tocify-item {
font-size: 0.90em;
}
.tocify .list-group-item {
border-radius: 0px;
}
.tocify-subheader {
display: inline;
}
.tocify-subheader .tocify-item {
font-size: 0.95em;
}
</style>
</head>
<body>
<div class="container-fluid main-container">
<!-- setup 3col/9col grid for toc_float and main content -->
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="TOC" class="tocify">
</div>
</div>
<div class="toc-content col-xs-12 col-sm-8 col-md-9">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Clarke Iakovakis</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
FSCI 2021 W25 Session
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="fsci_syllabus.html">Course syllabus</a>
</li>
<li>
<a href="using_jupyter_notebooks.html">Jupyter Notebooks and Binder</a>
</li>
<li>
<a href="IntroductionToR.html">Introduction to R</a>
</li>
<li>
<a href="RBasics.html">R Basics</a>
</li>
<li>
<a href="DataExploration.html">Data Exploration</a>
</li>
<li>
<a href="jennybc_lists_lesson.html">Exploring Data in Lists</a>
</li>
<li>
<a href="rcrossref.html">rcrossref</a>
</li>
<li>
<a href="rorcid.html">rorcid</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
<div id="header">
<h1 class="title toc-ignore">rorcid walkthrough</h1>
<h4 class="author">Clarke Iakovakis</h4>
</div>
<div id="binder-link-to-this-notebook" class="section level1">
<h1>Binder link to this notebook:</h1>
<p><a href="https://mybinder.org/v2/gh/ciakovx/ciakovx.github.io/master?filepath=rorcid.ipynb"><img src="https://mybinder.org/badge_logo.svg" alt="Binder" /></a></p>
<p><a href="https://mybinder.org/v2/gh/ciakovx/ciakovx.github.io/master?filepath=rorcid.ipynb" class="uri">https://mybinder.org/v2/gh/ciakovx/ciakovx.github.io/master?filepath=rorcid.ipynb</a></p>
<p>Download a script for these files at:</p>
<ul>
<li><a href="https://osf.io/kj72e">rorcid.R</a></li>
<li><a href="https://osf.io/f5uke">rorcid_employments</a></li>
</ul>
</div>
<div id="rorcid" class="section level1">
<h1><code>rorcid</code></h1>
<p><code>rorcid</code> is a package developed by <a href="https://scottchamberlain.info/">Scott Chamberlain</a>, co-founder of <a href="https://ropensci.org/">rOpenSci</a>, to serve as an interface to the ORCID API.</p>
<p>You can find more information about the API <a href="http://members.orcid.org/api/about-public-api">on the ORCID site</a>.</p>
<p>Credit to Paul Oldham at <a href="https://www.pauloldham.net/introduction-to-orcid-with-rorcid/" class="uri">https://www.pauloldham.net/introduction-to-orcid-with-rorcid/</a> for inspiring some of the structure and ideas throughout this document. I highly recommend reading it.</p>
<p>Workshop code for this module is at <a href="https://raw.githubusercontent.com/ciakovx/ciakovx.github.io/master/rorcid_workshopcode.R" class="uri">https://raw.githubusercontent.com/ciakovx/ciakovx.github.io/master/rorcid_workshopcode.R</a></p>
</div>
<div id="licensing" class="section level1">
<h1>Licensing</h1>
<p>This walkthrough is distributed under a <a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International (CC BY 4.0) License</a>.</p>
<p><img src="rorcid_files/figure-html/unnamed-chunk-1-1.png" width="672" /></p>
<div id="setting-up-rorcid" class="section level2">
<h2>Setting up rorcid</h2>
<p>If you haven’t done so already, create an ORCID account at <a href="https://orcid.org/signin" class="uri">https://orcid.org/signin</a>. If you have an ORCID but can’t remember it, search for your name at <a href="https://orcid.org" class="uri">https://orcid.org</a>. If you try to sign in with an email address already associated with an ORCID, you’ll be prompted to sign into the existing record. If you try to register with a different address, when you enter your name you’ll be asked to review existing records with that name and verify that none of them belong to you–<a href="https://support.orcid.org/hc/en-us/articles/360006972593-How-do-you-check-for-duplicate-ORCID-records-">see more on duplicate ORCID records</a>. Make sure you have verified your email address.</p>
<p>Next, install and load the <code>rorcid</code> package in R. Also install <code>usethis</code> in order to set the API key, as well as <code>tidyverse</code>, which is a package that contains many packages we’ll use throughout.</p>
<pre class="r"><code>install.packages("rorcid")
install.packages("usethis")
install.packages("tidyverse")
install.packages("anytime")
install.packages("httpuv")
install.packages("janitor")
library(rorcid)
library(usethis)
library(tidyverse)
library(anytime)
library(lubridate)
library(janitor)</code></pre>
<p>Next, you need to authenticate with an ORCID API Key. According to the <a href="https://members.orcid.org/api/tutorial/read-orcid-records">ORCID API tutorial</a>, anyone can receive a key to access the public API.</p>
<p>In R Studio, call:</p>
<pre class="r"><code>orcid_auth()</code></pre>
<p>You should see a message stating: <code>no ORCID token found; attempting OAuth authentication</code> and a window will open in your default internet browser. Log-in to your orcid account. You will be asked to give <code>rorcid</code> authorization to access your ORCID Record for the purposes of getting your ORCID iD. Click “Authorize.”</p>
<p>If successful, the browser window will state: “Authentication complete. Please close this page and return to R.” Return to R Studio and you should see in your R console the word <strong>Bearer</strong>, followed by a long string of letters and numbers. These letters and numbers are your API key. At this point, this should be cached locally in your working directory.</p>
<p>Highlight and copy the API key (the letters and numbers only–exclude the word “Bearer” and the space). Now you can use the <code>edit_r_environ()</code> function from the <code>usethis</code> package to store the token in your R environment.</p>
<pre class="r"><code>usethis::edit_r_environ()</code></pre>
<p>A new window will open in R Studio. Type <code>ORCID_TOKEN="my-token"</code>, replacing <code>my-token</code> with the API key. <strong>Then press enter to create a new line, and leave it blank.</strong> It will look like something like this (below is a fake token):</p>
<pre class="r"><code>ORCID_TOKEN="4dsw1e14-7212-4129-9f07-aaf7b88ba88f"</code></pre>
<p>Press <kbd>Ctrl</kbd> + <kbd>S</kbd> (Mac: <kbd>Cmd</kbd> + <kbd>S</kbd> to save the API key to your R environment and close the window. In R Studio, click Session > Restart R. Your token should now be saved to your R environment. You can confirm this by calling <code>orcid_auth()</code>, and it will print the token.</p>
<div id="option-2" class="section level3">
<h3>Option 2</h3>
<p>If this does not work for you, there is another option:</p>
<ol style="list-style-type: decimal">
<li>Sign in to your ORCID account</li>
<li>In the upper right corner, click your name, then in the drop-down menu, click <strong>Developer Tools</strong>. Note: In order to access Developer Tools, you must verify your email address. If you have not already verified your email address, you will be prompted to do so at this point.</li>
<li>Click the <strong>“Register for the free ORCID public API”</strong> button</li>
<li>Review and agree to the terms of service when prompted.</li>
<li>Add your name in the Name field, <a href="https://www.orcid.org" class="uri">https://www.orcid.org</a> in the Your Website URL field, “Getting public API key” in Description field, and <a href="https://www.orcid.org" class="uri">https://www.orcid.org</a> in the redirect URI field. Click the diskette button to save.</li>
<li>A gray box will appear including your Client ID and Client Secret. In the below code chunk, copy and paste the client ID and the client secret respectively. Make sure to leave the quotation marks (e.g. <code>orcid_client_id <- "APP-FDFJKDSLF320SDFF"</code> and <code>orcid_client_secret <- "c8e987sa-0b9c-82ed-91as-1112b24234e"</code>). Then execute the code chunk.</li>
</ol>
<pre class="r"><code># copy/paste your client ID from https://orcid.org/developer-tools
orcid_client_id <- "APP-UXL71DIF91UFKDA"
# copy/paste your client secret from https://orcid.org/developer-tools
orcid_client_secret <- "c7e221dc-0b9c-48cf-92sq-24446b8490231e"</code></pre>
<ol start="8" style="list-style-type: decimal">
<li>Now execute the below code, which will send a <code>POST</code> request (from the <code>httr</code> package) to ORCID and return to you an access token.</li>
</ol>
<pre class="r"><code>orcid_request <- POST(url = "https://orcid.org/oauth/token",
config = add_headers(`Accept` = "application/json",
`Content-Type` = "application/x-www-form-urlencoded"),
body = list(grant_type = "client_credentials",
scope = "/read-public",
client_id = orcid_client_id,
client_secret = orcid_client_secret),
encode = "form")</code></pre>
<p>Now that we have the response, we can use <code>content</code> from <code>httr</code> to get the information we want. If you look at the result, you’ll see it includes a variable called <code>access_token</code>.</p>
<pre class="r"><code>orcid_response <- content(orcid_request)
print(orcid_response$access_token)</code></pre>
<p>Copy that to the clipboard. Now you can use the <code>edit_r_environ()</code> function from the <code>usethis</code> package to store the token in your R environment.</p>
<pre class="r"><code>usethis::edit_r_environ()</code></pre>
<p>A new window will open in R Studio. Type <code>ORCID_TOKEN="my-token"</code>, pasting <code>my-token</code> with the <code>access_token</code> you just copied. <strong>Then press enter to create a new line, and leave it blank.</strong> It will look like something like this (below is a fake token):</p>
<pre class="r"><code>ORCID_TOKEN="4dsw1e14-7212-4129-9f07-aaf7b88ba88f"</code></pre>
<p>Press <kbd>Ctrl</kbd> + <kbd>S</kbd> (Mac: <kbd>Cmd</kbd> + <kbd>S</kbd> to save the API key to your R environment and close the window. In R Studio, click Session > Restart R. Your token should now be saved to your R environment. You can confirm this by calling <code>orcid_auth()</code>, and it will print the token.</p>
</div>
</div>
</div>
<div id="finding-oricid-ids-with-rorcidorcid_search" class="section level1">
<h1>Finding ORICID iDs with <code>rorcid::orcid_search()</code></h1>
<p>The <code>rorcid::orcid_search()</code> function takes a query and returns a data frame with three columns: first name, last name, and ORCID iD. We use this when we have some data about a person or people, and we want to get their ORCID iDs.</p>
<p>Call <code>?orcid_search</code> to view the available parameters.</p>
<p>For this example, we will use the fictitious professor <a href="https://library.brown.edu/hay/carberry.php">Josiah S(tinkney) Carberry</a>, “legendary professor of psychoceramics (the study of cracked pots) since 1929,” at Brown University. Despite being make-believe, Carberry has a profile in ORCID that can be used for test cases such as these.</p>
<div id="names" class="section level2">
<h2>Names</h2>
<p>We start with a simple search by family name with the <code>family_name</code> argument:</p>
<pre class="r"><code>carberry <- rorcid::orcid_search(family_name = 'carberry')
carberry</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["first"],"name":[1],"type":["chr"],"align":["left"]},{"label":["last"],"name":[2],"type":["chr"],"align":["left"]},{"label":["orcid"],"name":[3],"type":["chr"],"align":["left"]}],"data":[{"1":"Josiah","2":"Carberry","3":"0000-0002-1028-6941"},{"1":"Amanda","2":"Carberry","3":"0000-0001-5591-5599"},{"1":"Adrian","2":"Carberry","3":"0000-0003-0362-0689"},{"1":"peter","2":"carberry","3":"0000-0002-3555-2193"},{"1":"David","2":"Carberry","3":"0000-0002-1436-4089"},{"1":"Susan","2":"Carberry","3":"0000-0001-7710-0796"},{"1":"Paul","2":"Carberry","3":"0000-0002-3409-0724"},{"1":"Edward","2":"Carberry","3":"0000-0003-1145-1977"},{"1":"Benjamin","2":"Carberry","3":"0000-0002-2887-0038"},{"1":"Christopher","2":"Carberry","3":"0000-0001-8960-4959"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<p>Looking at the data frame in your R environment, you will see it returns 10 observations of three variables. By default, <code>orcid_search</code> returns a limit of 10. We can increase the number of results returned by using the <code>rows</code> argument:</p>
<pre class="r"><code>carberry <- rorcid::orcid_search(family_name = 'carberry',
rows = 50)
carberry</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["first"],"name":[1],"type":["chr"],"align":["left"]},{"label":["last"],"name":[2],"type":["chr"],"align":["left"]},{"label":["orcid"],"name":[3],"type":["chr"],"align":["left"]}],"data":[{"1":"Josiah","2":"Carberry","3":"0000-0002-1028-6941"},{"1":"Amanda","2":"Carberry","3":"0000-0001-5591-5599"},{"1":"Adrian","2":"Carberry","3":"0000-0003-0362-0689"},{"1":"peter","2":"carberry","3":"0000-0002-3555-2193"},{"1":"David","2":"Carberry","3":"0000-0002-1436-4089"},{"1":"Susan","2":"Carberry","3":"0000-0001-7710-0796"},{"1":"Paul","2":"Carberry","3":"0000-0002-3409-0724"},{"1":"Edward","2":"Carberry","3":"0000-0003-1145-1977"},{"1":"Benjamin","2":"Carberry","3":"0000-0002-2887-0038"},{"1":"Christopher","2":"Carberry","3":"0000-0001-8960-4959"},{"1":"Luke","2":"Carberry","3":"0000-0001-9374-9202"},{"1":"Andrea","2":"Carberry","3":"0000-0002-1867-7031"},{"1":"Emma","2":"Carberry","3":"0000-0002-9770-3460"},{"1":"Betty","2":"Carberry","3":"0000-0002-7419-5328"},{"1":"Damien","2":"Carberry","3":"0000-0002-7019-0300"},{"1":"Serena","2":"Carberry","3":"0000-0001-8162-1359"},{"1":"Alexander","2":"Carberry","3":"0000-0002-2247-3656"},{"1":"Thomas","2":"Carberry","3":"0000-0003-3138-875X"},{"1":"Caroline","2":"Carberry","3":"0000-0001-8276-3703"},{"1":"Nathan","2":"Carberry","3":"0000-0001-9194-3247"},{"1":"Angela","2":"Carberry","3":"0000-0002-4672-8932"},{"1":"Jon","2":"Carberry","3":"0000-0001-6176-2162"},{"1":"Josiah","2":"Carberry","3":"0000-0002-1825-0097"},{"1":"Dylan","2":"Carberry","3":"0000-0002-3469-9548"},{"1":"Celeste","2":"Carberry","3":"0000-0002-2753-0082"},{"1":"Crea","2":"Carberry","3":"0000-0002-0906-0910"},{"1":"Adam","2":"Carberry","3":"0000-0003-0041-7060"},{"1":"Edward","2":"Carberry","3":"0000-0002-6469-3139"},{"1":"Jaclyn","2":"Carberry","3":"0000-0002-4184-0714"},{"1":"Josie","2":"Carberry","3":"0000-0002-4463-641X"},{"1":"Kathleen","2":"Carberry","3":"0000-0001-8020-174X"},{"1":"Jayne","2":"Carberry","3":"0000-0003-4634-4047"},{"1":"Patrick","2":"Carberry","3":"0000-0001-7702-4674"},{"1":"Christine","2":"Carberry","3":"0000-0002-2594-5727"},{"1":"Deborah","2":"Carberry","3":"0000-0001-9348-4654"},{"1":"Shane","2":"Carberry Mogan","3":"0000-0002-0261-8117"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<p>We now get 28 results. However, we need not look through that long list to find Josiah, but can add another argument: <code>given_name</code>. Multiple arguments are combined with AND, such that the above example gets passed to ORCID as <strong>given-names:josiah</strong> AND <strong>family-name:carberry</strong>.</p>
<pre class="r"><code>carberry <- rorcid::orcid_search(given_name = 'josiah',
family_name = 'carberry')
carberry</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["first"],"name":[1],"type":["chr"],"align":["left"]},{"label":["last"],"name":[2],"type":["chr"],"align":["left"]},{"label":["orcid"],"name":[3],"type":["chr"],"align":["left"]}],"data":[{"1":"Josiah","2":"Carberry","3":"0000-0002-1028-6941"},{"1":"Josiah","2":"Carberry","3":"0000-0002-1825-0097"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<p>It looks like there are two people in the public ORCID registry with the first name Josiah and the last name Carberry. We can launch the actual ORCID profiles to our browser by using <code>rorcid::browse()</code> function. We use brackets to look up the first and second items in the <code>orcid</code> variable:</p>
<pre class="r"><code>rorcid::browse(carberry$orcid[1])
rorcid::browse(carberry$orcid[2])</code></pre>
<p>When we look at the profiles on the web, we that the first (0000-0002-1028-6941) is more recent and less complete, and the second (0000-0002-1825-0097) has much more data.</p>
<p>What other fields can we search? Call <code>View(rorcid:::fields)</code> to see a map of arguments.</p>
<table class="table table-striped table-hover table-condensed table-responsive" style="margin-left: auto; margin-right: auto;">
<thead>
<tr>
<th style="text-align:left;">
field
</th>
<th style="text-align:left;">
description
</th>
<th style="text-align:left;">
path
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
orcid
</td>
<td style="text-align:left;">
The ORCID identifier for the researcher or contributor
</td>
<td style="text-align:left;">
//orcid-profile/orcid
</td>
</tr>
<tr>
<td style="text-align:left;">
given-names
</td>
<td style="text-align:left;">
The given names of the researcher of contributor
</td>
<td style="text-align:left;">
//orcid-profile/orcid-bio/personal-details/given-names
</td>
</tr>
<tr>
<td style="text-align:left;">
family-name
</td>
<td style="text-align:left;">
The family name of the researcher of contributor
</td>
<td style="text-align:left;">
//orcid-profile/orcid-bio/personal-details/family-name
</td>
</tr>
<tr>
<td style="text-align:left;">
past-institution-affiliation-name
</td>
<td style="text-align:left;">
The name of any past institution in the researcher or contributors profile
</td>
<td style="text-align:left;">
//orcid-profile/orcid-bio/affiliations/affiliation[affiliation-type=“past-institution”]/affiliation-name
</td>
</tr>
<tr>
<td style="text-align:left;">
current-primary-institution-affiliation-name
</td>
<td style="text-align:left;">
The name of the primary institution of the researcher or contributor
</td>
<td style="text-align:left;">
//orcid-profile/orcid-bio/affiliations/affiliation[affiliation-type=“current-primary-institution”]/affiliation-name
</td>
</tr>
<tr>
<td style="text-align:left;">
current-institution-affiliation-name
</td>
<td style="text-align:left;">
The name of non-primary institutions of the researcher or contributor
</td>
<td style="text-align:left;">
//orcid-profile/orcid-bio/affiliations/affiliation[affiliation-type=“current-institution”]/affiliation-name
</td>
</tr>
<tr>
<td style="text-align:left;">
credit-name
</td>
<td style="text-align:left;">
The name that normally appears on publications by the researcher or contributor
</td>
<td style="text-align:left;">
//orcid-profile/orcid-bio/personal-details/credit-name
</td>
</tr>
<tr>
<td style="text-align:left;">
other-names
</td>
<td style="text-align:left;">
Alternative names that may have appeared on publications by the researcher or contributor
</td>
<td style="text-align:left;">
//orcid-profile/orcid-bio/personal-details/other-names
</td>
</tr>
<tr>
<td style="text-align:left;">
email
</td>
<td style="text-align:left;">
The email address of the researcher or contributor
</td>
<td style="text-align:left;">
//orcid-profile/orcid-bio/contact-details/email
</td>
</tr>
<tr>
<td style="text-align:left;">
digital-object-ids
</td>
<td style="text-align:left;">
DOI of any work in the researcher or contributors profile
</td>
<td style="text-align:left;">
//orcid-profile/orcid-activities/orcid-works/orcid-work/work-external-identifiers/work-external-identifier[work-external-identifier-type=“doi”]/work-external-identifier-id
</td>
</tr>
<tr>
<td style="text-align:left;">
work-titles
</td>
<td style="text-align:left;">
The titles of any work in the researcher or contributors profile
</td>
<td style="text-align:left;">
//orcid-profile/orcid-activities/orcid-works/orcid-work/work-title/(title|subtitle)
</td>
</tr>
<tr>
<td style="text-align:left;">
grant-numbers
</td>
<td style="text-align:left;">
The grant number of any grant associated with the researcher or contributor
</td>
<td style="text-align:left;">
//orcid-profile/orcid-activities/orcid-grants/orcid-grant/grant-number
</td>
</tr>
<tr>
<td style="text-align:left;">
patent-numbers
</td>
<td style="text-align:left;">
The patent numbers of any patent associated with the researcher or contributor
</td>
<td style="text-align:left;">
//orcid-profile/orcid-activities/orcid-patents/orcid-patent/patent-number
</td>
</tr>
<tr>
<td style="text-align:left;">
keywords
</td>
<td style="text-align:left;">
Any keywords associated with the researcher or contributor
</td>
<td style="text-align:left;">
//orcid-profile/orcid-bio/keywords/keyword
</td>
</tr>
<tr>
<td style="text-align:left;">
text
</td>
<td style="text-align:left;">
All the above fields. This is also the default field for Lucene syntax queries.
</td>
<td style="text-align:left;">
//orcid-bio
</td>
</tr>
</tbody>
</table>
</div>
<div id="affiliation-name" class="section level2">
<h2>Affiliation name</h2>
<p><code>orcid_search</code> includes the argument <code>affiliation_org</code>, which searches across all of one’s affiliation data (employment, education, invited positions, membership & service). Because this is such a broad search, it has the potential to return false positives if you are using it on it’s own.</p>
<pre class="r"><code>carberry <- rorcid::orcid_search(family_name = 'carberry',
affiliation_org = 'Wesleyan')
carberry</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["first"],"name":[1],"type":["chr"],"align":["left"]},{"label":["last"],"name":[2],"type":["chr"],"align":["left"]},{"label":["orcid"],"name":[3],"type":["chr"],"align":["left"]}],"data":[{"1":"Josiah","2":"Carberry","3":"0000-0002-1825-0097"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<p>There are also arguments for past institution (<code>past_inst</code>) and current institution (<code>current_inst</code>), as well as institutional identifiers (see below).</p>
</div>
<div id="email-address" class="section level2">
<h2>Email address</h2>
<p>We can search by email address, however, <a href="https://members.orcid.org/api/tutorial/search-orcid-registry">according to ORCID</a>, as of February 2017, fewer than 2% of the 3+ million email addresses on ORCID records are public, so this one may not be incredibly helpful. Since Josiah doesn’t have email, we’ll use mine.</p>
<pre class="r"><code>clarke <- rorcid::orcid_search(email = 'clarke.iakovakis@okstate.edu')
clarke</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["first"],"name":[1],"type":["chr"],"align":["left"]},{"label":["last"],"name":[2],"type":["chr"],"align":["left"]},{"label":["orcid"],"name":[3],"type":["chr"],"align":["left"]}],"data":[{"1":"Clarke","2":"Iakovakis","3":"0000-0002-9260-8456"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<p>If the person has chosen to keep their email address private, the function will return an empty dataframe.`</p>
</div>
<div id="keywords" class="section level2">
<h2>Keywords</h2>
<p>If the individual has added keywords to their ORCID profile, we can search those. Dr. Carberry’s profile includes the keyword “psychoceramics” (the study of cracked pots) (*note: this function is currently under development - :</p>
<pre class="r"><code>carberry <- rorcid::orcid_search(family_name = 'carberry',
keywords = 'psychoceramics')
carberry</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["first"],"name":[1],"type":["chr"],"align":["left"]},{"label":["last"],"name":[2],"type":["chr"],"align":["left"]},{"label":["orcid"],"name":[3],"type":["chr"],"align":["left"]}],"data":[{"1":"Josiah","2":"Carberry","3":"0000-0002-1825-0097"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
</div>
<div id="work-title-and-doi" class="section level2">
<h2>Work title and DOI</h2>
<p>If you know the name of a work (i.e. article, book chapter, etc.) or its DOI, you can obtain the associated ORCID iD by using the <code>work_title</code> or <code>digital_object_ids</code> <strong>if and only if</strong> the authos have added it to their ORCID profile.</p>
<p>We will search for the article <a href="https://openresearchsoftware.metajnl.com/articles/10.5334/jors.bu/print/">“Building Software Building Community: Lessons from the rOpenSci Project”</a>. Notice how the title is in double quotes, inside of single quotes, and the colon is removed.</p>
<pre class="r"><code>ropensci1 <- rorcid::orcid_search(work_title = '"Building Software Building Community Lessons from the rOpenSci Project"')
ropensci1</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["first"],"name":[1],"type":["chr"],"align":["left"]},{"label":["last"],"name":[2],"type":["chr"],"align":["left"]},{"label":["orcid"],"name":[3],"type":["chr"],"align":["left"]}],"data":[{"1":"Edmund","2":"Hart","3":"0000-0001-7367-7969"},{"1":"Scott","2":"Chamberlain","3":"0000-0003-1444-9135"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<p>This gives us two authors: Edmund Hart and Scott Chamberlain. Notice we get a different result when we look the same article up by DOI:</p>
<pre class="r"><code>ropensci2 <- rorcid::orcid_search(digital_object_ids = '"10.5334/jors.bu"')
ropensci2</code></pre>
<p>Using the <code>browse()</code> function to navigate to the author profiles, we can see this is because Edmund Hart added the article to his ORCID profile, whereas Scott Chamberlain added the dataset (which has a different DOI).</p>
<pre class="r"><code>rorcid::browse(ropensci1$orcid[1])
rorcid::browse(ropensci1$orcid[2])</code></pre>
<p>Thus a word of caution when searching by article title or DOI: a significant amount of data in ORCID is manually added or added with incorrect, inconsistent, or incomplete metadata. In other words, the fact that you didn’t get results or got erroneous results may not be due to errors in your queries, but rather errors in the data itself.</p>
</div>
<div id="institutional-id-ringgold-isni-grid---ringgold-org-id" class="section level2">
<h2>Institutional ID (Ringgold, ISNI, GRID) - <code>ringgold-org-id:</code></h2>
<p>When filling out an ORCID profile, users are encouraged to select their institutions from the drop-down menu, which will ensure it includes the Ringgold ID and any other unique identifiers, such as ISNI and GRID, that ORCID has for that institution. Read the ORCID report, <a href="https://orcid.org/sites/default/files/ckfinder/userfiles/files/20161031%20OrgIDProviderSurvey.pdf">“Organization identifiers: current provider survey”</a> to learn more.</p>
<pre class="r"><code>carberry <- rorcid::orcid_search(family_name = 'carberry',
ringgold_org_id = '5468')
carberry</code></pre>
<p>You have to <a href="https://www.ringgold.com/identify-online-guests/">register with Ringgold</a> to search in their registry. <a href="https://www.grid.ac/institutes/grid.268117.b">GRID is open for searching</a>. Unfortunately, most organizations in ORCID have a Ringgold and not a GRID.</p>
<p>Sometimes different entities on campus will have separate Ringgold IDs; you may consider contacting Ringgold to get the full list of your institution’s identifiers.</p>
</div>
<div id="name-and-email-address-domain" class="section level2">
<h2>Name and email address domain</h2>
<p>We can search by name and email address domain by using an asterisk followed by the domain name</p>
<pre class="r"><code>clarke <- rorcid::orcid_search(family_name = 'iakovakis',
email = '*@okstate.edu')
clarke</code></pre>
</div>
<div id="advanced-searching" class="section level2">
<h2>Advanced searching</h2>
<p><code>orcid_search</code> is a wrapper for another <code>rorcid</code> function–<code>orcid()</code>, which allows for a more advanced range of searching, including Boolean OR operators.</p>
<p>According to <code>help(orcid)</code>:</p>
<blockquote>
<p>You can use any of the following within the query statement: given-names, family-name, credit-name, other-names, email, grant-number, patent-number, keyword, worktitle, digital-objectids, current-institution, affiliation-name, current-primary-institution, text, past-institution, peer-review-type, peer-review-role, peer-review-group-id, biography, external-id-type-and-value</p>
</blockquote>
<p>Note that <code>current_prim_inst</code> and <code>patent_number</code> parameters have been removed as ORCID has removed them.</p>
<div id="searching-with-boolean-or" class="section level3">
<h3>Searching with Boolean OR</h3>
<p>We can combine affiliation names, Ringgold IDs, and email addresses using the <code>OR</code> operator to cover all our bases, in case the person or people we are looking for did not hit on of those values. This will return all records that either have a Ringgold of 7618, have an affiliation name of “Oklahoma State,” or have an email domain ending in “@okstate.edu.”</p>
<pre class="r"><code>clarke <- rorcid::orcid(query = 'family-name:iakovakis AND(ringgold-org-id:7618 OR
email:*@okstate.edu OR
affiliation-org-name:"Oklahoma State")')
clarke</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":[""],"name":["_rn_"],"type":[""],"align":["left"]},{"label":["orcid-identifier.uri"],"name":[1],"type":["chr"],"align":["left"]},{"label":["orcid-identifier.path"],"name":[2],"type":["chr"],"align":["left"]},{"label":["orcid-identifier.host"],"name":[3],"type":["chr"],"align":["left"]}],"data":[{"1":"https://orcid.org/0000-0002-9260-8456","2":"0000-0002-9260-8456","3":"orcid.org","_rn_":"1"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<p>This can also be helpful if you want to cast a very wide net and capture everyone affiliated with your institution who has an ORICID iD. Keep in mind that this searches across <strong>all</strong> of an individuals listed affiliations (employment, education, invited positions, membership & service) past and present. So it has <strong>will</strong> return false positives–in other words, one should not use it to get ORCID iDs of all individuals currently at an institution, because it will include those who previously worked there or got their degree from there.</p>
<p>The maximum number of returned results is 200, which we can modify with the <code>rows</code> argument:</p>
<pre class="r"><code>my_osu_orcids <- rorcid::orcid(query = 'ringgold-org-id:7618 OR email:*@okstate.edu OR
affiliation-org-name:"Oklahoma State"',
rows = 25)
my_osu_orcids</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":[""],"name":["_rn_"],"type":[""],"align":["left"]},{"label":["orcid-identifier.uri"],"name":[1],"type":["chr"],"align":["left"]},{"label":["orcid-identifier.path"],"name":[2],"type":["chr"],"align":["left"]},{"label":["orcid-identifier.host"],"name":[3],"type":["chr"],"align":["left"]}],"data":[{"1":"https://orcid.org/0000-0001-9667-6520","2":"0000-0001-9667-6520","3":"orcid.org","_rn_":"1"},{"1":"https://orcid.org/0000-0003-2231-8733","2":"0000-0003-2231-8733","3":"orcid.org","_rn_":"2"},{"1":"https://orcid.org/0000-0002-5115-8567","2":"0000-0002-5115-8567","3":"orcid.org","_rn_":"3"},{"1":"https://orcid.org/0000-0001-7669-0659","2":"0000-0001-7669-0659","3":"orcid.org","_rn_":"4"},{"1":"https://orcid.org/0000-0003-2985-7457","2":"0000-0003-2985-7457","3":"orcid.org","_rn_":"5"},{"1":"https://orcid.org/0000-0002-4559-9710","2":"0000-0002-4559-9710","3":"orcid.org","_rn_":"6"},{"1":"https://orcid.org/0000-0002-6160-9587","2":"0000-0002-6160-9587","3":"orcid.org","_rn_":"7"},{"1":"https://orcid.org/0000-0001-8037-3218","2":"0000-0001-8037-3218","3":"orcid.org","_rn_":"8"},{"1":"https://orcid.org/0000-0003-4760-6096","2":"0000-0003-4760-6096","3":"orcid.org","_rn_":"9"},{"1":"https://orcid.org/0000-0002-6758-3488","2":"0000-0002-6758-3488","3":"orcid.org","_rn_":"10"},{"1":"https://orcid.org/0000-0003-0802-6881","2":"0000-0003-0802-6881","3":"orcid.org","_rn_":"11"},{"1":"https://orcid.org/0000-0002-6038-5892","2":"0000-0002-6038-5892","3":"orcid.org","_rn_":"12"},{"1":"https://orcid.org/0000-0001-6289-9689","2":"0000-0001-6289-9689","3":"orcid.org","_rn_":"13"},{"1":"https://orcid.org/0000-0001-9439-4298","2":"0000-0001-9439-4298","3":"orcid.org","_rn_":"14"},{"1":"https://orcid.org/0000-0003-4243-5945","2":"0000-0003-4243-5945","3":"orcid.org","_rn_":"15"},{"1":"https://orcid.org/0000-0002-9778-6032","2":"0000-0002-9778-6032","3":"orcid.org","_rn_":"16"},{"1":"https://orcid.org/0000-0001-8330-8251","2":"0000-0001-8330-8251","3":"orcid.org","_rn_":"17"},{"1":"https://orcid.org/0000-0002-3183-4943","2":"0000-0002-3183-4943","3":"orcid.org","_rn_":"18"},{"1":"https://orcid.org/0000-0002-2590-2241","2":"0000-0002-2590-2241","3":"orcid.org","_rn_":"19"},{"1":"https://orcid.org/0000-0003-4120-6948","2":"0000-0003-4120-6948","3":"orcid.org","_rn_":"20"},{"1":"https://orcid.org/0000-0003-3622-4893","2":"0000-0003-3622-4893","3":"orcid.org","_rn_":"21"},{"1":"https://orcid.org/0000-0003-0862-8241","2":"0000-0003-0862-8241","3":"orcid.org","_rn_":"22"},{"1":"https://orcid.org/0000-0002-7441-8210","2":"0000-0002-7441-8210","3":"orcid.org","_rn_":"23"},{"1":"https://orcid.org/0000-0002-6671-4546","2":"0000-0002-6671-4546","3":"orcid.org","_rn_":"24"},{"1":"https://orcid.org/0000-0002-6664-5958","2":"0000-0002-6664-5958","3":"orcid.org","_rn_":"25"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<p>If you want to retrieve a complete set of all results above 200, we have to write a small function. First, we will wrap our API call in <code>base::attr</code> and include a <code>"found"</code> argument to see how many results are found with that call:</p>
<pre class="r"><code>my_osu_orcid_count <- base::attr(rorcid::orcid(query = 'ringgold-org-id:7618 OR
email:*@okstate.edu OR affiliation-org-name:"Oklahoma State"'),
"found")
my_osu_orcid_count</code></pre>
<pre><code>## [1] 2326</code></pre>
<p>There are 1,903 records at the time of writing. Next we will first create a numeric vector using <code>seq</code> that starts with 0 and ends with 1903 (which has been assigned to <code>my_osu_orcid_count</code>), adding 200 to each value incrementally.</p>
<pre class="r"><code>my_pages <- seq(from = 0, to = my_osu_orcid_count, by = 200)
my_pages</code></pre>
<pre><code>## [1] 0 200 400 600 800 1000 1200 1400 1600 1800 2000 2200</code></pre>
<p>Finally, we will write a small function using <code>map</code> from the <code>purrr</code> package. In essence, this takes each value from our <code>my_pages</code> vector, and passes it into the <code>page</code> argument of the <code>orcid()</code> query. In other words, the first loop will get results 0-200, the next will get 200-400, and so on.</p>
<pre class="r"><code>my_osu_orcids <- purrr::map(
my_pages,
function(page) {
print(page)
my_orcids <- rorcid::orcid(query = 'ringgold-org-id:7618 OR
email:*@okstate.edu OR affiliation-org-name:"Oklahoma State"',
rows = 200,
start = page)
return(my_orcids)
})</code></pre>
<p>We can then use the <code>map_dfr()</code> function from <code>purrr</code> to pull the data together, coercing it with <code>as_tibble()</code>, and the <code>clean_names()</code> function from <code>janitor</code>, described below, to make the column names easier to handle. We also introduce here the Pipe Operator, which is also described below.</p>
<pre class="r"><code>my_osu_orcids_data <- my_osu_orcids %>%
map_dfr(., as_tibble) %>%
janitor::clean_names()</code></pre>
<p>Of course, these are only the ORCID iDs, with no other data. The next sections will describe other functions in <code>rorcid</code> to get biographical, employment, and works data from the profiles.</p>
</div>
</div>
</div>
<div id="clean_names-and" class="section level1">
<h1><code>clean_names()</code> and <code>%>%</code></h1>
<p>Often times the columns returned from the ORCID API have a complicated combination of punctuation that can make them hard to use. The <code>clean_names()</code> function from the <code>janitor</code> package is optional and used only to simplify the column names of the data. It converts all punctuation to underscores, so the field <code>orcid-identifier.uri</code> becomes <code>orcid_identifier_uri</code>.</p>
<p>A <a href="https://www.datacamp.com/community/tutorials/pipe-r-tutorial">Pipe Operator</a> <code>%>%</code>. A pipe takes the output of one statement and makes it the input of the next statement. You can think of it as “then” in natural language. So the above script first runs the <code>orcid()</code> API call, then it clean the column names of the data that was pulled into R as a result of that call. So for example, in the expression above, we first call up the <code>my_osu_orcids</code> data. We then apply the <code>bind_rows()</code> function to pull all the data together into a single data frame, and then clean the names with <code>clean_names()</code>.</p>
</div>
<div id="finding-biographical-information" class="section level1">
<h1>Finding biographical information</h1>
<p>The <code>orcid()</code> function gets the IDs, but no information about the person. For that, you will need to use <code>orcid_person()</code>.</p>
<p>Unlike <code>orcid()</code>, <code>orcid_person()</code> does not take a query; it accepts only ORICID iDs in the form XXXX-XXXX-XXXX-XXXX. So we can get the ORICID iD itself into it’s own vector. We can then pass that argument on to <code>orcid_person()</code>.</p>
<pre class="r"><code>carberry_orcid <- "0000-0002-1825-0097"
carberry_person <- rorcid::orcid_person(carberry_orcid)</code></pre>
<p>If you look at the result for carberry_person in the Environment Pane in R Studio, you will see it returned a List of 1. We can view it here on this website using the <code>listviewer</code> package.</p>
<pre class="r"><code>listviewer::jsonedit(carberry_person, mode = "view")</code></pre>
<div id="htmlwidget-6c0e936b71821591b7b0" style="width:672px;height:480px;" class="jsonedit html-widget"></div>
<script type="application/json" data-for="htmlwidget-6c0e936b71821591b7b0">{"x":{"data":{"0000-0002-1825-0097":{"last-modified-date":{"value":1494016313820},"name":{"created-date":{"value":1460757617078},"last-modified-date":{"value":1504850007188},"given-names":{"value":"Josiah"},"family-name":{"value":"Carberry"},"credit-name":[],"source":[],"visibility":"public","path":"0000-0002-1825-0097"},"other-names":{"last-modified-date":{"value":1462157547720},"other-name":{"content":["Josiah Stinkney Carberry","J. Carberry","J. S. Carberry"],"visibility":["public","public","public"],"path":["/0000-0002-1825-0097/other-names/732317","/0000-0002-1825-0097/other-names/565981","/0000-0002-1825-0097/other-names/732318"],"put-code":[732317,565981,732318],"display-index":[3,2,1],"created-date.value":[1462157351411,1446663146889,1462157351418],"last-modified-date.value":[1462157547720,1462157547720,1462157547720],"source.source-client-id":[null,null,null],"source.assertion-origin-orcid":[null,null,null],"source.assertion-origin-client-id":[null,null,null],"source.assertion-origin-name":[null,null,null],"source.source-orcid.uri":["https://orcid.org/0000-0002-1825-0097","https://orcid.org/0000-0002-1825-0097","https://orcid.org/0000-0002-1825-0097"],"source.source-orcid.path":["0000-0002-1825-0097","0000-0002-1825-0097","0000-0002-1825-0097"],"source.source-orcid.host":["orcid.org","orcid.org","orcid.org"],"source.source-name.value":["Josiah Carberry","Josiah Carberry","Josiah Carberry"]},"path":"/0000-0002-1825-0097/other-names"},"biography":{"created-date":{"value":1460757617080},"last-modified-date":{"value":1460757617080},"content":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\r\n\r\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","visibility":"public","path":"/0000-0002-1825-0097/biography"},"researcher-urls":{"last-modified-date":{"value":1462157645967},"researcher-url":{"url-name":["Brown University Page","Wikipedia Entry"],"visibility":["public","public"],"path":["/0000-0002-1825-0097/researcher-urls/568395","/0000-0002-1825-0097/researcher-urls/568394"],"put-code":[568395,568394],"display-index":[2,1],"created-date.value":[1446663146890,1446663146889],"last-modified-date.value":[1462157645967,1462157645967],"source.source-client-id":[null,null],"source.assertion-origin-orcid":[null,null],"source.assertion-origin-client-id":[null,null],"source.assertion-origin-name":[null,null],"source.source-orcid.uri":["https://orcid.org/0000-0002-1825-0097","https://orcid.org/0000-0002-1825-0097"],"source.source-orcid.path":["0000-0002-1825-0097","0000-0002-1825-0097"],"source.source-orcid.host":["orcid.org","orcid.org"],"source.source-name.value":["Josiah Carberry","Josiah Carberry"],"url.value":["http://library.brown.edu/about/hay/carberry.php","http://en.wikipedia.org/wiki/Josiah_Carberry"]},"path":"/0000-0002-1825-0097/researcher-urls"},"emails":{"last-modified-date":[],"email":[],"path":"/0000-0002-1825-0097/email"},"addresses":{"last-modified-date":[],"address":[],"path":"/0000-0002-1825-0097/address"},"keywords":{"last-modified-date":{"value":1462157635636},"keyword":{"content":["psychoceramics","ionian philology"],"visibility":["public","public"],"path":["/0000-0002-1825-0097/keywords/434187","/0000-0002-1825-0097/keywords/434184"],"put-code":[434187,434184],"display-index":[3,2],"created-date.value":[1462157617244,1462157414545],"last-modified-date.value":[1462157635636,1462157635636],"source.source-client-id":[null,null],"source.assertion-origin-orcid":[null,null],"source.assertion-origin-client-id":[null,null],"source.assertion-origin-name":[null,null],"source.source-orcid.uri":["https://orcid.org/0000-0002-1825-0097","https://orcid.org/0000-0002-1825-0097"],"source.source-orcid.path":["0000-0002-1825-0097","0000-0002-1825-0097"],"source.source-orcid.host":["orcid.org","orcid.org"],"source.source-name.value":["Josiah Carberry","Josiah Carberry"]},"path":"/0000-0002-1825-0097/keywords"},"external-identifiers":{"last-modified-date":{"value":1494016313820},"external-identifier":{"external-id-type":"Scopus Author ID","external-id-value":"7007156898","external-id-relationship":"self","visibility":"public","path":"/0000-0002-1825-0097/external-identifiers/698979","put-code":698979,"display-index":0,"created-date.value":1494016313820,"last-modified-date.value":1494016313820,"source.source-orcid":null,"source.assertion-origin-client-id":null,"source.source-client-id.uri":"https://orcid.org/client/0000-0002-5982-8983","source.source-client-id.path":"0000-0002-5982-8983","source.source-client-id.host":"orcid.org","source.source-name.value":"Scopus - Elsevier","source.assertion-origin-orcid.uri":"https://orcid.org/0000-0002-1825-0097","source.assertion-origin-orcid.path":"0000-0002-1825-0097","source.assertion-origin-orcid.host":"orcid.org","source.assertion-origin-name.value":"Josiah Carberry","external-id-url.value":"http://www.scopus.com/inward/authorDetails.url?authorID=7007156898&partnerID=MN8TOARS"},"path":"/0000-0002-1825-0097/external-identifiers"},"path":"/0000-0002-1825-0097/person"}},"options":{"mode":"view","modes":["code","form","text","tree","view"]}},"evals":[],"jsHooks":[]}</script>
<p>Click the drop-down arrow next to the ORICID iD. We see one list here (his ORCID iD) and inside of that list is more lists. And inside those lists is even more lists! We can see the names of the top-level elements of the list by running <code>names(carberry_person[[1]])</code>.</p>
<pre><code>## [1] "last-modified-date" "name" "other-names"
## [4] "biography" "researcher-urls" "emails"
## [7] "addresses" "keywords" "external-identifiers"
## [10] "path"</code></pre>
<p>If you click the drop-down arrow next to name. You can run <code>names(carberry_person[[1]]$name)</code> to see the names of those elements. While this is great data, if we want to run some analysis on it, we need to get it into a nice, tidy data frame.</p>
<div id="getting-the-data-into-a-data-frame" class="section level2">
<h2>Getting the data into a data frame</h2>
<p>This is not an easy or straightforward process. I provide below one strategy to get some of the relevant data, using <code>map</code> functions from the <code>purrr</code> package and building a <code>tibble</code> (the <code>tidyverse</code>’s more efficient data frame) piece by piece.</p>
<pre class="r"><code>carberry_data <- carberry_person %>% {
dplyr::tibble(
created_date = purrr::map_dbl(., purrr::pluck, "name", "created-date", "value", .default=NA_integer_),
given_name = purrr::map_chr(., purrr::pluck, "name", "given-names", "value", .default=NA_character_),
family_name = purrr::map_chr(., purrr::pluck, "name", "family-name", "value", .default=NA_character_),
credit_name = purrr::map_chr(., purrr::pluck, "name", "credit-name", "value", .default=NA_character_),
other_names = purrr::map(., purrr::pluck, "other-names", "other-name", "content", .default=NA_character_),
orcid_identifier_path = purrr::map_chr(., purrr::pluck, "name", "path", .default = NA_character_),
biography = purrr::map_chr(., purrr::pluck, "biography", "content", .default=NA_character_),
researcher_urls = purrr::map(., purrr::pluck, "researcher-urls", "researcher-url", .default=NA_character_),
emails = purrr::map(., purrr::pluck, "emails", "email", "email", .default=NA_character_),
keywords = purrr::map(., purrr::pluck, "keywords", "keyword", "content", .default=NA_character_),
external_ids = purrr::map(., purrr::pluck, "external-identifiers", "external-identifier", .default=NA_character_)
)
}
carberry_data</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["created_date"],"name":[1],"type":["dbl"],"align":["right"]},{"label":["given_name"],"name":[2],"type":["chr"],"align":["left"]},{"label":["family_name"],"name":[3],"type":["chr"],"align":["left"]},{"label":["credit_name"],"name":[4],"type":["chr"],"align":["left"]},{"label":["other_names"],"name":[5],"type":["named list"],"align":["right"]},{"label":["orcid_identifier_path"],"name":[6],"type":["chr"],"align":["left"]},{"label":["biography"],"name":[7],"type":["chr"],"align":["left"]},{"label":["researcher_urls"],"name":[8],"type":["named list"],"align":["right"]},{"label":["emails"],"name":[9],"type":["named list"],"align":["right"]},{"label":["keywords"],"name":[10],"type":["named list"],"align":["right"]},{"label":["external_ids"],"name":[11],"type":["named list"],"align":["right"]}],"data":[{"1":"1.460758e+12","2":"Josiah","3":"Carberry","4":"NA","5":"<chr [3]>","6":"0000-0002-1825-0097","7":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\\r\\n\\r\\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","8":"<df[,16] [2 × 16]>","9":"<chr [1]>","10":"<chr [2]>","11":"<df[,20] [1 × 20]>","_row":"0000-0002-1825-0097"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<ul>
<li>The <strong>created_date</strong> comes from within the name list, so technically it is the date the name was created, not the date the ORCID account was created, which is not available in this data. This is plucked with <code>map_dbl()</code> because it is in <code>double</code> format (a numeric data type in R) .</li>
<li>The <strong>given_name</strong>, <strong>family_name</strong>, <strong>credit_name</strong>, <strong>orcid_identifier_path</strong>, and <strong>biography</strong> are plucked with <code>map_chr()</code> because they are both <code>character</code> types.</li>
<li>The <strong>other_names</strong>, <strong>keywords</strong>, <strong>researcher_urls</strong>, and <strong>external_ids</strong> are plucked with <code>map()</code> because there may be multiple values (unlike the other names, in which you can only have one). For example, someone may have multiple other names, or multiple keywords. So this will return a nested list to the tibble; we will discuss below how to unnest it.</li>
</ul>
<p>Each of these functions includes a <code>.default = NA_character_</code> argument because if the value is NULL (if the ORCID author didn’t input the information) then it will convert that NULL to NA.</p>
</div>
<div id="fixing-dates" class="section level2">
<h2>Fixing dates</h2>
<p>View the created date by running <code>carberry_data$created_date</code> and you will see this is a number, not a date:</p>
<pre><code>## 0000-0002-1825-0097
## 1.460758e+12</code></pre>
<p>The dates are in <a href="https://en.wikipedia.org/wiki/Unix_time">Unix time</a>, which is the number of seconds that have elapsed since January 1, 1970. In ORCID, this is in milliseconds. We can use the <code>anytime()</code> function from the <code>anytime</code> package created by Dirk Eddelbuettel to convert it and return a POSIXct object. You have to divide it by 1000 because it’s in milliseconds. Below we use the <code>mutate()</code> function from <code>dplyr</code> to overwrite the <code>created_date</code> and <code>last_modified_date</code> UNIX time with the human readable POSIXct dates.</p>
<pre class="r"><code>carberry_datesAndTimes <- carberry_data %>%
dplyr::mutate(created_date = anytime::anytime(created_date/1000))
carberry_datesAndTimes$created_date</code></pre>
<pre><code>## 0000-0002-1825-0097
## "2016-04-15 17:00:17 CDT"</code></pre>
<p>That looks much better: April 15th, 2016 at 5:00 PM and 17 seconds Central Daylight Time.</p>
<p>If you’d prefer to do away with the time altogether (and keep only the month/day/year), you can use <code>anydate()</code> instead of <code>anytime()</code>.</p>
<pre class="r"><code>carberry_datesOnly <- carberry_data %>%
dplyr::mutate(created_date = anytime::anydate(created_date/1000))
carberry_datesOnly$created_date</code></pre>
<pre><code>## [1] "2016-04-15"</code></pre>
<p>Check out the <code>lubridate</code> package for more you can do with dates. It is installed with <code>tidyverse</code>, but not loaded, so you have to load it with its own call to <code>library()</code> (we did this at the beginning of the session). For example, you may be more interested in year of creation than month. So after you run the conversion with <code>anytime</code>, you can create year variables with <code>mutate()</code>:</p>
<pre class="r"><code>carberry_years <- carberry_datesOnly %>%
dplyr::mutate(created_year = lubridate::year(created_date))
carberry_years$created_year</code></pre>
<pre><code>## [1] 2016</code></pre>
</div>
<div id="unnesting-nested-lists" class="section level2">
<h2>Unnesting nested lists</h2>
<p>There are nested lists in this data frame that can be unnested. The <strong>other_names</strong> and <strong>keywords</strong> values are character vectors, while the <strong>researcher_urls</strong> and <strong>external_ids</strong> values are data frames themselves. We can use the <code>unnest()</code> function from the <code>tidyr</code> package to unnest both types. In other words, this will make each element of the list its own row. For instance, since there are two keywords for carberry (“psychoceramics” and “ionian philology”), there will now be two rows that are otherwise identical except for the keywords column:</p>
<pre class="r"><code>carberry_keywords <- carberry_data %>%
tidyr::unnest(keywords)
carberry_keywords$keywords</code></pre>
<pre><code>## [1] "psychoceramics" "ionian philology"</code></pre>
<p>We can see which columns are lists by calling <code>is_list()</code> in the <code>map_lgl()</code> function (this will return a TRUE/FALSE for each column that is a list), and subsetting the <code>names()</code> of <code>carberry_data</code> by those values:</p>
<pre class="r"><code>carberry_list_columns <- map_lgl(carberry_data, is_list)
names(carberry_data)[carberry_list_columns]</code></pre>
<pre><code>## [1] "other_names" "researcher_urls" "emails" "keywords"
## [5] "external_ids"</code></pre>
<p>Rather than having 1 observation of 11 variables, the data frame now has 2 observations of 7 variables. We know why there are two observations (because there are 2 keywords), but why are there fewer variables? Because there is an argument to <code>unnest()</code> called <code>.drop</code>, which is set to <code>TRUE</code> by default, meaning all additional list columns will be dropped. If you want to keep them, just set it to <code>FALSE</code> Note, however, that it will not unnest them.</p>
<pre class="r"><code>carberry_keywords <- carberry_data %>%
tidyr::unnest(keywords, .drop = FALSE)
carberry_keywords</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["created_date"],"name":[1],"type":["dbl"],"align":["right"]},{"label":["given_name"],"name":[2],"type":["chr"],"align":["left"]},{"label":["family_name"],"name":[3],"type":["chr"],"align":["left"]},{"label":["credit_name"],"name":[4],"type":["chr"],"align":["left"]},{"label":["other_names"],"name":[5],"type":["named list"],"align":["right"]},{"label":["orcid_identifier_path"],"name":[6],"type":["chr"],"align":["left"]},{"label":["biography"],"name":[7],"type":["chr"],"align":["left"]},{"label":["researcher_urls"],"name":[8],"type":["named list"],"align":["right"]},{"label":["emails"],"name":[9],"type":["named list"],"align":["right"]},{"label":["keywords"],"name":[10],"type":["chr"],"align":["left"]},{"label":["external_ids"],"name":[11],"type":["named list"],"align":["right"]}],"data":[{"1":"1.460758e+12","2":"Josiah","3":"Carberry","4":"NA","5":"<chr [3]>","6":"0000-0002-1825-0097","7":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\\r\\n\\r\\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","8":"<df[,16] [2 × 16]>","9":"<chr [1]>","10":"psychoceramics","11":"<df[,20] [1 × 20]>"},{"1":"1.460758e+12","2":"Josiah","3":"Carberry","4":"NA","5":"<chr [3]>","6":"0000-0002-1825-0097","7":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\\r\\n\\r\\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","8":"<df[,16] [2 × 16]>","9":"<chr [1]>","10":"ionian philology","11":"<df[,20] [1 × 20]>"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<p>You can unnest multiple nested columns, but keep in mind that this will multiply the duplicated columns in your data frame, because there will be it is spreading the key-value pairs across multiple columns. For more on wide and long data, read Hadley Wickham’s paper <a href="https://vita.had.co.nz/papers/tidy-data.html">“Tidy data,”</a> published in <em>The Journal of Statistical Software.</em></p>
<pre class="r"><code>carberry_keywords_otherNames <- carberry_data %>%
tidyr::unnest(keywords, .drop = FALSE) %>%
tidyr::unnest(other_names, .drop = FALSE)
carberry_keywords_otherNames</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["created_date"],"name":[1],"type":["dbl"],"align":["right"]},{"label":["given_name"],"name":[2],"type":["chr"],"align":["left"]},{"label":["family_name"],"name":[3],"type":["chr"],"align":["left"]},{"label":["credit_name"],"name":[4],"type":["chr"],"align":["left"]},{"label":["other_names"],"name":[5],"type":["chr"],"align":["left"]},{"label":["orcid_identifier_path"],"name":[6],"type":["chr"],"align":["left"]},{"label":["biography"],"name":[7],"type":["chr"],"align":["left"]},{"label":["researcher_urls"],"name":[8],"type":["named list"],"align":["right"]},{"label":["emails"],"name":[9],"type":["named list"],"align":["right"]},{"label":["keywords"],"name":[10],"type":["chr"],"align":["left"]},{"label":["external_ids"],"name":[11],"type":["named list"],"align":["right"]}],"data":[{"1":"1.460758e+12","2":"Josiah","3":"Carberry","4":"NA","5":"Josiah Stinkney Carberry","6":"0000-0002-1825-0097","7":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\\r\\n\\r\\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","8":"<df[,16] [2 × 16]>","9":"<chr [1]>","10":"psychoceramics","11":"<df[,20] [1 × 20]>"},{"1":"1.460758e+12","2":"Josiah","3":"Carberry","4":"NA","5":"J. Carberry","6":"0000-0002-1825-0097","7":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\\r\\n\\r\\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","8":"<df[,16] [2 × 16]>","9":"<chr [1]>","10":"psychoceramics","11":"<df[,20] [1 × 20]>"},{"1":"1.460758e+12","2":"Josiah","3":"Carberry","4":"NA","5":"J. S. Carberry","6":"0000-0002-1825-0097","7":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\\r\\n\\r\\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","8":"<df[,16] [2 × 16]>","9":"<chr [1]>","10":"psychoceramics","11":"<df[,20] [1 × 20]>"},{"1":"1.460758e+12","2":"Josiah","3":"Carberry","4":"NA","5":"Josiah Stinkney Carberry","6":"0000-0002-1825-0097","7":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\\r\\n\\r\\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","8":"<df[,16] [2 × 16]>","9":"<chr [1]>","10":"ionian philology","11":"<df[,20] [1 × 20]>"},{"1":"1.460758e+12","2":"Josiah","3":"Carberry","4":"NA","5":"J. Carberry","6":"0000-0002-1825-0097","7":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\\r\\n\\r\\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","8":"<df[,16] [2 × 16]>","9":"<chr [1]>","10":"ionian philology","11":"<df[,20] [1 × 20]>"},{"1":"1.460758e+12","2":"Josiah","3":"Carberry","4":"NA","5":"J. S. Carberry","6":"0000-0002-1825-0097","7":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\\r\\n\\r\\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","8":"<df[,16] [2 × 16]>","9":"<chr [1]>","10":"ionian philology","11":"<df[,20] [1 × 20]>"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<p>When we unnest <em>researcher_urls</em> or <em>external_ids</em>, we will see many more columns added. That is because each of these nested lists contains multiple variables:</p>
<pre class="r"><code>carberry_researcherURLs <- carberry_data %>%
tidyr::unnest(researcher_urls, .drop = FALSE)
carberry_researcherURLs</code></pre>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["created_date"],"name":[1],"type":["dbl"],"align":["right"]},{"label":["given_name"],"name":[2],"type":["chr"],"align":["left"]},{"label":["family_name"],"name":[3],"type":["chr"],"align":["left"]},{"label":["credit_name"],"name":[4],"type":["chr"],"align":["left"]},{"label":["other_names"],"name":[5],"type":["named list"],"align":["right"]},{"label":["orcid_identifier_path"],"name":[6],"type":["chr"],"align":["left"]},{"label":["biography"],"name":[7],"type":["chr"],"align":["left"]},{"label":["url-name"],"name":[8],"type":["chr"],"align":["left"]},{"label":["visibility"],"name":[9],"type":["chr"],"align":["left"]},{"label":["path"],"name":[10],"type":["chr"],"align":["left"]},{"label":["put-code"],"name":[11],"type":["int"],"align":["right"]},{"label":["display-index"],"name":[12],"type":["int"],"align":["right"]},{"label":["created-date.value"],"name":[13],"type":["dbl"],"align":["right"]},{"label":["last-modified-date.value"],"name":[14],"type":["dbl"],"align":["right"]},{"label":["source.source-client-id"],"name":[15],"type":["lgl"],"align":["right"]},{"label":["source.assertion-origin-orcid"],"name":[16],"type":["lgl"],"align":["right"]},{"label":["source.assertion-origin-client-id"],"name":[17],"type":["lgl"],"align":["right"]},{"label":["source.assertion-origin-name"],"name":[18],"type":["lgl"],"align":["right"]},{"label":["source.source-orcid.uri"],"name":[19],"type":["chr"],"align":["left"]},{"label":["source.source-orcid.path"],"name":[20],"type":["chr"],"align":["left"]},{"label":["source.source-orcid.host"],"name":[21],"type":["chr"],"align":["left"]},{"label":["source.source-name.value"],"name":[22],"type":["chr"],"align":["left"]},{"label":["url.value"],"name":[23],"type":["chr"],"align":["left"]},{"label":["emails"],"name":[24],"type":["named list"],"align":["right"]},{"label":["keywords"],"name":[25],"type":["named list"],"align":["right"]},{"label":["external_ids"],"name":[26],"type":["named list"],"align":["right"]}],"data":[{"1":"1.460758e+12","2":"Josiah","3":"Carberry","4":"NA","5":"<chr [3]>","6":"0000-0002-1825-0097","7":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\\r\\n\\r\\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","8":"Brown University Page","9":"public","10":"/0000-0002-1825-0097/researcher-urls/568395","11":"568395","12":"2","13":"1.446663e+12","14":"1.462158e+12","15":"NA","16":"NA","17":"NA","18":"NA","19":"https://orcid.org/0000-0002-1825-0097","20":"0000-0002-1825-0097","21":"orcid.org","22":"Josiah Carberry","23":"http://library.brown.edu/about/hay/carberry.php","24":"<chr [1]>","25":"<chr [2]>","26":"<df[,20] [1 × 20]>"},{"1":"1.460758e+12","2":"Josiah","3":"Carberry","4":"NA","5":"<chr [3]>","6":"0000-0002-1825-0097","7":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\\r\\n\\r\\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","8":"Wikipedia Entry","9":"public","10":"/0000-0002-1825-0097/researcher-urls/568394","11":"568394","12":"1","13":"1.446663e+12","14":"1.462158e+12","15":"NA","16":"NA","17":"NA","18":"NA","19":"https://orcid.org/0000-0002-1825-0097","20":"0000-0002-1825-0097","21":"orcid.org","22":"Josiah Carberry","23":"http://en.wikipedia.org/wiki/Josiah_Carberry","24":"<chr [1]>","25":"<chr [2]>","26":"<df[,20] [1 × 20]>"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<p>Carberry has two URLs: his Wikipedia page and a page about him on the Brown University Library. So a row is created for each of these URLs, and multiple columns are added such as the last modified date, the url value, and so on. You can keep or remove columns you don’t want using <code>select()</code> from the <code>dplyr</code> package.</p>
</div>
</div>
<div id="writing-to-csv" class="section level1">
<h1>Writing to CSV</h1>
<p>We will use the <code>write_csv()</code> function from the <code>readr</code> package to write our data to disk. This package was loaded when you called <code>library(tidyverse)</code> at the beginning of the session.</p>
<p>With a typical data frame, you can simply write the <code>carberry_data</code> data frame to a CSV with the following code:</p>
<pre class="r"><code>write_csv(carberry_keywords, "C:/Users/MyUserName/Desktop/carberry_data.csv")</code></pre>
<p>The problem is, due to the nested lists we described above, R will throw an error: <code>"Error in stream_delim_(df, path, ...) : Don't know how to handle vector of type list."</code></p>
<p>You have a few choices:</p>
<ol style="list-style-type: decimal">
<li>You can unnest one of the columns and leave <code>.drop</code> set to <code>TRUE</code>. This will add rows for all the values in the nested lists, and drop the additional nested lists.</li>
</ol>
<p>Replace “MyUserName” below with your actual user name to write this file to your desktop. You can get your username by calling <code>Sys.getenv("USERNAME")</code>.</p>
<pre class="r"><code>my_user_name <- Sys.getenv("USERNAME")
carberry_keywords <- carberry_data %>%
tidyr::unnest(keywords)
write_csv(carberry_keywords, file.path("C:/Users", my_user_name, "Desktop/carberry_data1.csv"))</code></pre>
<ol start="2" style="list-style-type: decimal">
<li>You can drop the nested lists altogether using a combination of <code>select_if()</code> from <code>dplyr</code> and <code>negate()</code> from <code>purrr</code> to drop all lists in the data frame. This is essentially saying, only keep the columns that are not lists. In this example, the number of variables falls to 6, since we have 5 list columns.</li>
</ol>
<pre class="r"><code>carberry_data_short <- carberry_data %>%
dplyr::select_if(purrr::negate(is_list))</code></pre>
<ol start="3" style="list-style-type: decimal">
<li>You can use <code>mutate()</code> from <code>dplyr</code> to coerce the list columns into character vectors.</li>
</ol>
<pre class="r"><code>carberry_data_mutated <- carberry_data %>%
dplyr::mutate(keywords = as.character(keywords)) %>%
dplyr::mutate(other_names = as.character(other_names)) %>%
dplyr::mutate(researcher_urls = as.character(map(carberry_data$researcher_urls, purrr::pluck, "url.value", .default=NA_character_))) %>%
dplyr::mutate(external_ids = as.character(map(carberry_data$external_ids, purrr::pluck, "external-id-url.value", .default=NA_character_)))
write_csv(carberry_data_mutated, "C:/Users/MyUserName/Desktop/carberry_data2.csv")</code></pre>
</div>
<div id="getting-data-on-multiple-people-with-orcid_person" class="section level1">
<h1>Getting data on multiple people with <code>orcid_person()</code></h1>
<div id="searching-by-oricid-ids" class="section level2">
<h2>Searching by ORICID iDs</h2>
<p><code>orcid_person()</code> is vectorized, so you can pass in multiple ORICID iDs and it will return a list of results for each ID, with each element named by the ORICID iD.</p>
<pre class="r"><code>my_orcids <- c("0000-0002-1825-0097", "0000-0002-9260-8456")
my_orcid_person <- rorcid::orcid_person(my_orcids)
listviewer::jsonedit(my_orcid_person, mode = "view")</code></pre>
<div id="htmlwidget-6def21cc139a0d388ac0" style="width:672px;height:480px;" class="jsonedit html-widget"></div>
<script type="application/json" data-for="htmlwidget-6def21cc139a0d388ac0">{"x":{"data":{"0000-0002-1825-0097":{"last-modified-date":{"value":1494016313820},"name":{"created-date":{"value":1460757617078},"last-modified-date":{"value":1504850007188},"given-names":{"value":"Josiah"},"family-name":{"value":"Carberry"},"credit-name":[],"source":[],"visibility":"public","path":"0000-0002-1825-0097"},"other-names":{"last-modified-date":{"value":1462157547720},"other-name":{"content":["Josiah Stinkney Carberry","J. Carberry","J. S. Carberry"],"visibility":["public","public","public"],"path":["/0000-0002-1825-0097/other-names/732317","/0000-0002-1825-0097/other-names/565981","/0000-0002-1825-0097/other-names/732318"],"put-code":[732317,565981,732318],"display-index":[3,2,1],"created-date.value":[1462157351411,1446663146889,1462157351418],"last-modified-date.value":[1462157547720,1462157547720,1462157547720],"source.source-client-id":[null,null,null],"source.assertion-origin-orcid":[null,null,null],"source.assertion-origin-client-id":[null,null,null],"source.assertion-origin-name":[null,null,null],"source.source-orcid.uri":["https://orcid.org/0000-0002-1825-0097","https://orcid.org/0000-0002-1825-0097","https://orcid.org/0000-0002-1825-0097"],"source.source-orcid.path":["0000-0002-1825-0097","0000-0002-1825-0097","0000-0002-1825-0097"],"source.source-orcid.host":["orcid.org","orcid.org","orcid.org"],"source.source-name.value":["Josiah Carberry","Josiah Carberry","Josiah Carberry"]},"path":"/0000-0002-1825-0097/other-names"},"biography":{"created-date":{"value":1460757617080},"last-modified-date":{"value":1460757617080},"content":"Josiah Carberry is a fictitious person. This account is used as a demonstration account by ORCID, CrossRef and others who wish to demonstrate the interaction of ORCID with other scholarly communication systems without having to use a real-person's account.\r\n\r\nJosiah Stinkney Carberry is a fictional professor, created as a joke in 1929. He is said to still teach at Brown University, and to be known for his work in \"psychoceramics\", the supposed study of \"cracked pots\". See his Wikipedia entry for more details.","visibility":"public","path":"/0000-0002-1825-0097/biography"},"researcher-urls":{"last-modified-date":{"value":1462157645967},"researcher-url":{"url-name":["Brown University Page","Wikipedia Entry"],"visibility":["public","public"],"path":["/0000-0002-1825-0097/researcher-urls/568395","/0000-0002-1825-0097/researcher-urls/568394"],"put-code":[568395,568394],"display-index":[2,1],"created-date.value":[1446663146890,1446663146889],"last-modified-date.value":[1462157645967,1462157645967],"source.source-client-id":[null,null],"source.assertion-origin-orcid":[null,null],"source.assertion-origin-client-id":[null,null],"source.assertion-origin-name":[null,null],"source.source-orcid.uri":["https://orcid.org/0000-0002-1825-0097","https://orcid.org/0000-0002-1825-0097"],"source.source-orcid.path":["0000-0002-1825-0097","0000-0002-1825-0097"],"source.source-orcid.host":["orcid.org","orcid.org"],"source.source-name.value":["Josiah Carberry","Josiah Carberry"],"url.value":["http://library.brown.edu/about/hay/carberry.php","http://en.wikipedia.org/wiki/Josiah_Carberry"]},"path":"/0000-0002-1825-0097/researcher-urls"},"emails":{"last-modified-date":[],"email":[],"path":"/0000-0002-1825-0097/email"},"addresses":{"last-modified-date":[],"address":[],"path":"/0000-0002-1825-0097/address"},"keywords":{"last-modified-date":{"value":1462157635636},"keyword":{"content":["psychoceramics","ionian philology"],"visibility":["public","public"],"path":["/0000-0002-1825-0097/keywords/434187","/0000-0002-1825-0097/keywords/434184"],"put-code":[434187,434184],"display-index":[3,2],"created-date.value":[1462157617244,1462157414545],"last-modified-date.value":[1462157635636,1462157635636],"source.source-client-id":[null,null],"source.assertion-origin-orcid":[null,null],"source.assertion-origin-client-id":[null,null],"source.assertion-origin-name":[null,null],"source.source-orcid.uri":["https://orcid.org/0000-0002-1825-0097","https://orcid.org/0000-0002-1825-0097"],"source.source-orcid.path":["0000-0002-1825-0097","0000-0002-1825-0097"],"source.source-orcid.host":["orcid.org","orcid.org"],"source.source-name.value":["Josiah Carberry","Josiah Carberry"]},"path":"/0000-0002-1825-0097/keywords"},"external-identifiers":{"last-modified-date":{"value":1494016313820},"external-identifier":{"external-id-type":"Scopus Author ID","external-id-value":"7007156898","external-id-relationship":"self","visibility":"public","path":"/0000-0002-1825-0097/external-identifiers/698979","put-code":698979,"display-index":0,"created-date.value":1494016313820,"last-modified-date.value":1494016313820,"source.source-orcid":null,"source.assertion-origin-client-id":null,"source.source-client-id.uri":"https://orcid.org/client/0000-0002-5982-8983","source.source-client-id.path":"0000-0002-5982-8983","source.source-client-id.host":"orcid.org","source.source-name.value":"Scopus - Elsevier","source.assertion-origin-orcid.uri":"https://orcid.org/0000-0002-1825-0097","source.assertion-origin-orcid.path":"0000-0002-1825-0097","source.assertion-origin-orcid.host":"orcid.org","source.assertion-origin-name.value":"Josiah Carberry","external-id-url.value":"http://www.scopus.com/inward/authorDetails.url?authorID=7007156898&partnerID=MN8TOARS"},"path":"/0000-0002-1825-0097/external-identifiers"},"path":"/0000-0002-1825-0097/person"},"0000-0002-9260-8456":{"last-modified-date":{"value":1564453017495},"name":{"created-date":{"value":1460762361127},"last-modified-date":{"value":1460762361127},"given-names":{"value":"Clarke"},"family-name":{"value":"Iakovakis"},"credit-name":[],"source":[],"visibility":"public","path":"0000-0002-9260-8456"},"other-names":{"last-modified-date":{"value":1556299008683},"other-name":{"content":["Clarke L. Iakovakis","C. Iakovakis","C.L. Iakovakis"],"visibility":["public","public","public"],"path":["/0000-0002-9260-8456/other-names/1237117","/0000-0002-9260-8456/other-names/1237118","/0000-0002-9260-8456/other-names/1237151"],"put-code":[1237117,1237118,1237151],"display-index":[3,2,1],"created-date.value":[1556293709558,1556293709561,1556299008681],"last-modified-date.value":[1556299008683,1556299008683,1556299008681],"source.source-client-id":[null,null,null],"source.assertion-origin-orcid":[null,null,null],"source.assertion-origin-client-id":[null,null,null],"source.assertion-origin-name":[null,null,null],"source.source-orcid.uri":["https://orcid.org/0000-0002-9260-8456","https://orcid.org/0000-0002-9260-8456","https://orcid.org/0000-0002-9260-8456"],"source.source-orcid.path":["0000-0002-9260-8456","0000-0002-9260-8456","0000-0002-9260-8456"],"source.source-orcid.host":["orcid.org","orcid.org","orcid.org"],"source.source-name.value":["Clarke Iakovakis","Clarke Iakovakis","Clarke Iakovakis"]},"path":"/0000-0002-9260-8456/other-names"},"biography":{"created-date":{"value":1556226971959},"last-modified-date":{"value":1556226971959},"content":"I am the Scholarly Services Librarian at Oklahoma State University. I received my MS in Information Studies from the University of Texas at Austin, and my BA in History from Texas State University.","visibility":"public","path":"/0000-0002-9260-8456/biography"},"researcher-urls":{"last-modified-date":{"value":1556293746865},"researcher-url":{"url-name":["figshare page","Oklahoma State University profile","Google Scholar Profile"],"visibility":["public","public","public"],"path":["/0000-0002-9260-8456/researcher-urls/1719866","/0000-0002-9260-8456/researcher-urls/1719867","/0000-0002-9260-8456/researcher-urls/1719868"],"put-code":[1719866,1719867,1719868],"display-index":[3,2,1],"created-date.value":[1556293653296,1556293680922,1556293746863],"last-modified-date.value":[1556293746865,1556293746865,1556293746863],"source.source-client-id":[null,null,null],"source.assertion-origin-orcid":[null,null,null],"source.assertion-origin-client-id":[null,null,null],"source.assertion-origin-name":[null,null,null],"source.source-orcid.uri":["https://orcid.org/0000-0002-9260-8456","https://orcid.org/0000-0002-9260-8456","https://orcid.org/0000-0002-9260-8456"],"source.source-orcid.path":["0000-0002-9260-8456","0000-0002-9260-8456","0000-0002-9260-8456"],"source.source-orcid.host":["orcid.org","orcid.org","orcid.org"],"source.source-name.value":["Clarke Iakovakis","Clarke Iakovakis","Clarke Iakovakis"],"url.value":["https://figshare.com/authors/Clarke_Iakovakis/3990140","https://info.library.okstate.edu/clarke-iakovakis","https://scholar.google.com/citations?user=V9m2_IAAAAAJ&hl=en&oi=sra"]},"path":"/0000-0002-9260-8456/researcher-urls"},"emails":{"last-modified-date":{"value":1564453017495},"email":{"email":"clarke.iakovakis@okstate.edu","path":null,"visibility":"public","verified":true,"primary":false,"put-code":null,"created-date.value":1541441342505,"last-modified-date.value":1564453017495,"source.source-client-id":null,"source.assertion-origin-orcid":null,"source.assertion-origin-client-id":null,"source.assertion-origin-name":null,"source.source-orcid.uri":"https://orcid.org/0000-0002-9260-8456","source.source-orcid.path":"0000-0002-9260-8456","source.source-orcid.host":"orcid.org","source.source-name.value":"Clarke Iakovakis"},"path":"/0000-0002-9260-8456/email"},"addresses":{"last-modified-date":{"value":1465226976952},"address":{"visibility":"public","path":"/0000-0002-9260-8456/address/338203","put-code":338203,"display-index":0,"created-date.value":1453660378174,"last-modified-date.value":1465226976952,"source.source-client-id":null,"source.assertion-origin-orcid":null,"source.assertion-origin-client-id":null,"source.assertion-origin-name":null,"source.source-orcid.uri":"https://orcid.org/0000-0002-9260-8456","source.source-orcid.path":"0000-0002-9260-8456","source.source-orcid.host":"orcid.org","source.source-name.value":"Clarke Iakovakis","country.value":"US"},"path":"/0000-0002-9260-8456/address"},"keywords":{"last-modified-date":{"value":1556293631997},"keyword":{"content":["open access","scholarly communications","librarianship"],"visibility":["public","public","public"],"path":["/0000-0002-9260-8456/keywords/1249281","/0000-0002-9260-8456/keywords/1249282","/0000-0002-9260-8456/keywords/1249283"],"put-code":[1249281,1249282,1249283],"display-index":[4,3,2],"created-date.value":[1556293631992,1556293631996,1556293631997],"last-modified-date.value":[1556293631992,1556293631996,1556293631997],"source.source-client-id":[null,null,null],"source.assertion-origin-orcid":[null,null,null],"source.assertion-origin-client-id":[null,null,null],"source.assertion-origin-name":[null,null,null],"source.source-orcid.uri":["https://orcid.org/0000-0002-9260-8456","https://orcid.org/0000-0002-9260-8456","https://orcid.org/0000-0002-9260-8456"],"source.source-orcid.path":["0000-0002-9260-8456","0000-0002-9260-8456","0000-0002-9260-8456"],"source.source-orcid.host":["orcid.org","orcid.org","orcid.org"],"source.source-name.value":["Clarke Iakovakis","Clarke Iakovakis","Clarke Iakovakis"]},"path":"/0000-0002-9260-8456/keywords"},"external-identifiers":{"last-modified-date":[],"external-identifier":[],"path":"/0000-0002-9260-8456/external-identifiers"},"path":"/0000-0002-9260-8456/person"}},"options":{"mode":"view","modes":["code","form","text","tree","view"]}},"evals":[],"jsHooks":[]}</script>
<p>We see that we are given a list of 2, each containing the person data. We can put this into a data frame using the same code as above.</p>
<pre class="r"><code>my_orcid_person_data <- my_orcid_person %>% {
dplyr::tibble(
created_date = purrr::map_dbl(., purrr::pluck, "name", "created-date", "value", .default=NA_integer_),
given_name = purrr::map_chr(., purrr::pluck, "name", "given-names", "value", .default=NA_character_),
family_name = purrr::map_chr(., purrr::pluck, "name", "family-name", "value", .default=NA_character_),
credit_name = purrr::map_chr(., purrr::pluck, "name", "credit-name", "value", .default=NA_character_),
other_names = purrr::map(., purrr::pluck, "other-names", "other-name", "content", .default=NA_character_),
orcid_identifier_path = purrr::map_chr(., purrr::pluck, "name", "path", .default = NA_character_),
biography = purrr::map_chr(., purrr::pluck, "biography", "content", .default=NA_character_),
researcher_urls = purrr::map(., purrr::pluck, "researcher-urls", "researcher-url", .default=NA_character_),
emails = purrr::map(., purrr::pluck, "emails", "email", "email", .default=NA_character_),
keywords = purrr::map(., purrr::pluck, "keywords", "keyword", "content", .default=NA_character_),
external_ids = purrr::map(., purrr::pluck, "external-identifiers", "external-identifier", .default=NA_character_)
)
} %>%
dplyr::mutate(created_date = anytime::anydate(created_date/1000))
my_orcid_person_data</code></pre>