Skip to content

bug: list-to-df conversion fails for one (rec-id: 515) in latest EndnoteDB #13

@mrustl

Description

@mrustl
#install.packages("remotes")
#remotes::install_github("kwb-r/kwb.endnote@dev", upgrade = "never")
endnote_xml <- kwb.endnote::extdata_file("2020-06-17_KWB-documents.xml")
endnote_list <- kwb.endnote::create_endnote_list(endnote_xml)
endnote_df <- kwb.endnote::create_references_df(endnote_list)
rec_ids <- as.numeric(unlist(sapply(endnote_list, function(x) x$`rec-number`)))

missing_rec_ids <- !rec_ids %in% endnote_df$rec_number
if (any(missing_rec_ids)) {
print(rec_ids[missing_rec_ids])
tmp_list <- endnote_list[which(missing_rec_ids)]
str(tmp_list)
kwb.endnote::create_references_df(tmp_list)
}
#> [1] 515
#> List of 1
#>  $ record:List of 16
#>   ..$ database    :List of 1
#>   .. ..$ : chr "KWB-documents_20191205.enl"
#>   .. ..- attr(*, "name")= chr "KWB-documents_20191205.enl"
#>   .. ..- attr(*, "path")= chr "P:\\dms\\KWB-documents_20191205.enl"
#>   ..$ source-app  :List of 1
#>   .. ..$ : chr "EndNote"
#>   .. ..- attr(*, "name")= chr "EndNote"
#>   .. ..- attr(*, "version")= chr "19.3"
#>   ..$ rec-number  :List of 1
#>   .. ..$ : chr "515"
#>   ..$ foreign-keys:List of 1
#>   .. ..$ key:List of 1
#>   .. .. ..$ : chr "515"
#>   .. .. ..- attr(*, "app")= chr "EN"
#>   .. .. ..- attr(*, "db-id")= chr "z90eszwadd95piezvwmxvr9z9ww9xssrfp5t"
#>   ..$ ref-type    :List of 1
#>   .. ..$ : chr "47"
#>   .. ..- attr(*, "name")= chr "Conference Paper"
#>   ..$ contributors:List of 2
#>   .. ..$ authors          :List of 3
#>   .. .. ..$ author:List of 1
#>   .. .. .. ..$ style:List of 1
#>   .. .. .. .. ..$ : chr "Remy, Christian"
#>   .. .. .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. .. .. ..- attr(*, "font")= chr "default"
#>   .. .. .. .. ..- attr(*, "size")= chr "100%"
#>   .. .. ..$ author:List of 1
#>   .. .. .. ..$ style:List of 1
#>   .. .. .. .. ..$ : chr "Lesjean, Boris"
#>   .. .. .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. .. .. ..- attr(*, "font")= chr "default"
#>   .. .. .. .. ..- attr(*, "size")= chr "100%"
#>   .. .. ..$ author:List of 1
#>   .. .. .. ..$ style:List of 1
#>   .. .. .. .. ..$ : chr "Siemers, Christoph"
#>   .. .. .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. .. .. ..- attr(*, "font")= chr "default"
#>   .. .. .. .. ..- attr(*, "size")= chr "100%"
#>   .. ..$ secondary-authors: list()
#>   ..$ titles      :List of 2
#>   .. ..$ title          :List of 1
#>   .. .. ..$ style:List of 1
#>   .. .. .. ..$ : chr "Evaluation and optimisation of the environmental footprint of the Braunschweig sanitation concept with Life Cycle Assessment"
#>   .. .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. .. ..- attr(*, "font")= chr "default"
#>   .. .. .. ..- attr(*, "size")= chr "100%"
#>   .. ..$ secondary-title:List of 1
#>   .. .. ..$ style:List of 1
#>   .. .. .. ..$ : chr "IWA World Congress on Water, Climate and Energy"
#>   .. .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. .. ..- attr(*, "font")= chr "default"
#>   .. .. .. ..- attr(*, "size")= chr "100%"
#>   ..$ pages       :List of 1
#>   .. ..$ style:List of 1
#>   .. .. ..$ : chr "20"
#>   .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. ..- attr(*, "font")= chr "default"
#>   .. .. ..- attr(*, "size")= chr "100%"
#>   ..$ dates       :List of 2
#>   .. ..$ year     :List of 1
#>   .. .. ..$ style:List of 1
#>   .. .. .. ..$ : chr "2012"
#>   .. .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. .. ..- attr(*, "font")= chr "default"
#>   .. .. .. ..- attr(*, "size")= chr "100%"
#>   .. ..$ pub-dates:List of 1
#>   .. .. ..$ date:List of 1
#>   .. .. .. ..$ style:List of 1
#>   .. .. .. .. ..$ : chr "13-18 May 2012"
#>   .. .. .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. .. .. ..- attr(*, "font")= chr "default"
#>   .. .. .. .. ..- attr(*, "size")= chr "100%"
#>   ..$ pub-location:List of 1
#>   .. ..$ style:List of 1
#>   .. .. ..$ : chr "Dublin, Ireland"
#>   .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. ..- attr(*, "font")= chr "default"
#>   .. .. ..- attr(*, "size")= chr "100%"
#>   ..$ abstract    :List of 1
#>   .. ..$ style:List of 1
#>   .. .. ..$ : chr "This paper presents the results of an evaluation of the environmental footprint of the Braunschweig wastewater "| __truncated__
#>   .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. ..- attr(*, "font")= chr "default"
#>   .. .. ..- attr(*, "size")= chr "100%"
#>   ..$ label       :List of 1
#>   .. ..$ style:List of 1
#>   .. .. ..$ : chr "codigreen"
#>   .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. ..- attr(*, "font")= chr "default"
#>   .. .. ..- attr(*, "size")= chr "100%"
#>   ..$ notes       :List of 1
#>   .. ..$ style:List of 1
#>   .. .. ..$ : chr "  "
#>   .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. ..- attr(*, "font")= chr "default"
#>   .. .. ..- attr(*, "size")= chr "100%"
#>   ..$ urls        :List of 1
#>   .. ..$ pdf-urls:List of 2
#>   .. .. ..$ url:List of 1
#>   .. .. .. ..$ : chr "internal-pdf://0230639875/Remy-2012-515.pdf"
#>   .. .. ..$ url:List of 1
#>   .. .. .. ..$ : chr "internal-pdf://3553642818/Remy-2012-5152.pdf"
#>   ..$ custom2     :List of 1
#>   .. ..$ style:List of 1
#>   .. .. ..$ : chr "CoDiGreen"
#>   .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. ..- attr(*, "font")= chr "default"
#>   .. .. ..- attr(*, "size")= chr "100%"
#>   ..$ language    :List of 1
#>   .. ..$ style:List of 1
#>   .. .. ..$ : chr "en"
#>   .. .. ..- attr(*, "face")= chr "normal"
#>   .. .. ..- attr(*, "font")= chr "default"
#>   .. .. ..- attr(*, "size")= chr "100%"
#> # A tibble: 0 x 41
#> # ... with 41 variables: rec_number <dbl>, ref_type <dbl>, ref_type_name <chr>,
#> #   year <chr>, title <chr>, title_secondary <chr>, title_tertiary <chr>,
#> #   abstract <chr>, author_tertiary01 <chr>, author01 <chr>, author02 <chr>,
#> #   author03 <chr>, authaddress <chr>, periodical_title_full <chr>,
#> #   periodical_title_abbr <chr>, pages <chr>, volume <chr>, numvols <chr>,
#> #   section <chr>, edition <chr>, pubdates <chr>, publisher <chr>,
#> #   publocation <chr>, puborig <chr>, urls_pdf01 <chr>, urls_pdf02 <chr>,
#> #   urls_related <chr>, electronic_resource_num <chr>, worktype <chr>,
#> #   label <chr>, keyword01 <chr>, notes <chr>, caption <chr>, custom1 <chr>,
#> #   custom2 <chr>, custom3 <chr>, custom7 <chr>, isbn <chr>, language <chr>,
#> #   database_name <chr>, database_path <chr>

sessionInfo()
#> R version 4.0.0 (2020-04-24)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 18363)
#> 
#> Matrix products: default
#> 
#> locale:
#> [1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
#> [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
#> [5] LC_TIME=German_Germany.1252    
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] zip_2.0.4           Rcpp_1.0.4.6        pillar_1.4.4       
#>  [4] compiler_4.0.0      highr_0.8           forcats_0.5.0      
#>  [7] tools_4.0.0         kwb.utils_0.6.0     digest_0.6.25      
#> [10] kwb.read_0.0.0.9000 evaluate_0.14       lifecycle_0.2.0    
#> [13] kwb.endnote_0.1.0   tibble_3.0.1        gtable_0.3.0       
#> [16] pkgconfig_2.0.3     rlang_0.4.6         openxlsx_4.1.5     
#> [19] cli_2.0.2           yaml_2.2.1          xfun_0.14          
#> [22] xml2_1.3.2          stringr_1.4.0       dplyr_1.0.0        
#> [25] httr_1.4.1          knitr_1.28          htmlwidgets_1.5.1  
#> [28] generics_0.0.2      vctrs_0.3.1         fs_1.4.1           
#> [31] grid_4.0.0          tidyselect_1.1.0    glue_1.4.1         
#> [34] kwb.file_0.3.1      R6_2.4.1            fansi_0.4.1        
#> [37] rmarkdown_2.3       wordcloud2_0.2.1    tidyr_1.1.0        
#> [40] ggplot2_3.3.1       purrr_0.3.4         magrittr_1.5       
#> [43] scales_1.1.1        ellipsis_0.3.1      htmltools_0.5.0    
#> [46] assertthat_0.2.1    colorspace_1.4-1    utf8_1.1.4         
#> [49] stringi_1.4.6       munsell_0.5.0       crayon_1.3.4

Created on 2020-06-19 by the reprex package (v0.3.0)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions