@@ -440,7 +440,9 @@ processed further to extract the needed information.
440
440
``` r
441
441
parseDataCiteDescription <- function (x ) {
442
442
if (length(x ) > 0 ) {
443
- if (x $ descriptionType == " Abstract" ) {
443
+ # descriptionType and description are character vectors, spanning content of description field
444
+ # testing (2022-08) found that selecting on "Abstract" could be omitted
445
+ if (" Abstract" %in% x $ descriptionType ) {
444
446
return (str_to_sentence(str_c(x $ description , collapse = " ; " )))
445
447
} else {
446
448
return (NA_character_ )
@@ -459,7 +461,10 @@ parseDataCitePreprints <- function(item) {
459
461
title = map_chr(item $ data $ attributes $ titles ,
460
462
~ str_to_sentence(str_c(.x $ title , collapse = " ; " ))),
461
463
abstract = map_chr(item $ data $ attributes $ descriptions ,
462
- function (x ) parseDataCiteDescription(x )))
464
+ function (x ) parseDataCiteDescription(x )),
465
+ abstract_length = map_int(item $ data $ attributes $ descriptions ,
466
+ function (x ) length(x ))
467
+ )
463
468
}
464
469
465
470
dc_preprints_df <- map_df(dc_preprints , parseDataCitePreprints ) %> %
@@ -620,7 +625,7 @@ covid_preprints_update <- covid_preprints_update %>%
620
625
title = str_squish(title ))
621
626
```
622
627
623
- #Remove duplicate records (incl. versions) on same preprint server
628
+ \ # Remove duplicate records (incl. versions) on same preprint server
624
629
625
630
``` r
626
631
covid_preprints_previous <- read_csv(" data/covid19_preprints.csv" )
0 commit comments