Git Product home page Git Product logo

handlr's Introduction

handlr

Project Status: Active – The project has reached a stable, usable state and is being actively developed. cran checks R-check codecov.io rstudio mirror downloads cran version

a tool for converting among citation formats.

heavily influenced by, and code ported from the Ruby gem bolognese

supported readers:

  • citeproc
  • ris
  • bibtex
  • codemeta
  • cff

supported writers:

  • citeproc
  • ris
  • bibtex
  • schemaorg
  • rdfxml
  • codemeta
  • cff

not supported yet, but plan to:

  • crosscite

Installation

stable version

install.packages("handlr")

dev version

remotes::install_github("ropensci/handlr")
library("handlr")

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for handlr in R doing citation(package = 'handlr')
  • Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

ropensci_footer

handlr's People

Contributors

bwiernik avatar dieghernan avatar sckott avatar thierryo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

handlr's Issues

change maintainer on cran

@bwiernik @ThierryO when you get a chance, could you submit a new version to cran changing the maintainer to whoever the new maintainer is? not urgent, but any correspondence from cran will go to me right now, so it'd be good to have it go to you instead. thanks!

fix: when reading from string/json some functions give file attribute as that string

z <- system.file('extdata/citeproc.json', package = "handlr")
x <- codemeta_writer(citeproc_reader(z))
out <- codemeta_reader(x)
attr(out, "file")
{
  "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
  "@type": "BlogPosting",
  "@id": "https://doi.org/10.5438/4k3m-nyvg",
  "identifier": "https://doi.org/10.5438/4k3m-nyvg",
  "title": "Eating your own Dog Food",
  "agents": [
    {
      "@type": "Person",
      "name": "Martin Fenner",
      "givenName": "Martin",
      "familyName": "Fenner"
    }
  ],
  "description": "Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for...",
  "tags": ["Phylogeny", "Malaria", "Parasites", "Taxonomy", "Mitochondrial genome", "Africa", "Plasmodium"],
  "datePublished": "2016-12-20",
  "publisher": "DataCite"
}

Support the Citation File Format

The Citation File Format is a human- and machine-readable and -writable format implemented in YAML to provide citation-relevant metadata for software. It has been conceived to make it possible for developers to provide the correct citation metadata for their software, and for users to gain access to the relevant information quickly. Its implementation takes into account the Software Citation Principles through requiring the necessary minimal information where feasible.

It would be great if handlr supported this format as well, most importantly as source, perhaps also as target format.

I'll be happy to put some work into this, but as I'm an R newbie may need some help.

If this is something that the project finds useful, I'd start with looking at the available readers and try my hand at implementing a reader for CFF. This could possibly be done as part of the CollabW19 hack day.

Please let me know your thoughts on this.

GitHub version help files fail

With the GitHub version of handlr installed none of the help files are available. They all have the following error message
Error in fetch(key) : lazy-load database '/Users/gcn/Library/R/3.5/library/handlr/help/handlr.rdb' is corrupt

Session Info
devtools::session_info()
─ Session info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.5.2 (2018-12-20)
 os       macOS Mojave 10.14.3        
 system   x86_64, darwin15.6.0        
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/Denver              
 date     2019-03-10Packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version    date       lib source                              
 assertthat    0.2.0      2017-04-11 [2] CRAN (R 3.5.0)                      
 backports     1.1.3      2018-12-14 [2] CRAN (R 3.5.0)                      
 bibtex      * 0.4.2      2017-06-30 [1] CRAN (R 3.5.0)                      
 callr         3.1.1      2018-12-21 [2] CRAN (R 3.5.0)                      
 cli           1.0.1      2018-09-25 [2] CRAN (R 3.5.0)                      
 crayon        1.3.4      2017-09-16 [2] CRAN (R 3.5.0)                      
 crul          0.7.0      2019-01-04 [1] CRAN (R 3.5.2)                      
 curl          3.3        2019-01-10 [2] CRAN (R 3.5.2)                      
 data.table  * 1.12.0     2019-01-13 [2] CRAN (R 3.5.2)                      
 desc          1.2.0      2018-05-01 [2] CRAN (R 3.5.0)                      
 devtools    * 2.0.1      2018-10-26 [2] CRAN (R 3.5.1)                      
 digest        0.6.18     2018-10-10 [2] CRAN (R 3.5.0)                      
 fs            1.2.6      2018-08-23 [2] CRAN (R 3.5.0)                      
 glue          1.3.0      2018-07-17 [2] CRAN (R 3.5.0)                      
 handlr      * 0.1.0.9110 2019-03-10 [1] Github (ropensci/handlr@33bb39d)    
 hms           0.4.2      2018-03-10 [2] CRAN (R 3.5.0)                      
 httpcode      0.2.0      2016-11-14 [1] CRAN (R 3.5.0)                      
 httr          1.4.0      2018-12-11 [2] CRAN (R 3.5.0)                      
 jsonlite      1.6        2018-12-07 [2] CRAN (R 3.5.0)                      
 lubridate     1.7.4      2018-04-11 [1] CRAN (R 3.5.0)                      
 magrittr      1.5        2014-11-22 [2] CRAN (R 3.5.0)                      
 memoise       1.1.0      2017-04-21 [2] CRAN (R 3.5.0)                      
 mime          0.6        2018-10-05 [2] CRAN (R 3.5.1)                      
 packrat       0.5.0      2018-11-14 [2] CRAN (R 3.5.0)                      
 pillar        1.3.1      2018-12-15 [2] CRAN (R 3.5.0)                      
 pkgbuild      1.0.2      2018-10-16 [2] CRAN (R 3.5.1)                      
 pkgconfig     2.0.2      2018-08-16 [2] CRAN (R 3.5.1)                      
 pkgload       1.0.2      2018-10-29 [2] CRAN (R 3.5.1)                      
 plyr          1.8.4      2016-06-08 [2] CRAN (R 3.5.0)                      
 prettyunits   1.0.2      2015-07-13 [2] CRAN (R 3.5.0)                      
 processx      3.2.1      2018-12-05 [2] CRAN (R 3.5.0)                      
 ps            1.3.0      2018-12-21 [2] CRAN (R 3.5.0)                      
 R6            2.4.0      2019-02-14 [2] CRAN (R 3.5.2)                      
 Rcpp          1.0.0      2018-11-07 [2] CRAN (R 3.5.1)                      
 readr       * 1.3.1      2018-12-21 [2] CRAN (R 3.5.0)                      
 RefManageR  * 1.2.8      2019-03-02 [1] Github (ropensci/RefManageR@a1c9d05)
 remotes       2.0.2      2018-10-30 [2] CRAN (R 3.5.1)                      
 rlang         0.3.1      2019-01-08 [2] CRAN (R 3.5.2)                      
 rprojroot     1.3-2      2018-01-03 [2] CRAN (R 3.5.0)                      
 rstudioapi    0.9.0      2019-01-09 [2] CRAN (R 3.5.2)                      
 sessioninfo   1.1.1      2018-11-05 [2] CRAN (R 3.5.1)                      
 stringi       1.3.1      2019-02-13 [2] CRAN (R 3.5.2)                      
 stringr       1.4.0      2019-02-10 [2] CRAN (R 3.5.2)                      
 testthat      2.0.1      2018-10-13 [2] CRAN (R 3.5.1)                      
 tibble        2.0.1      2019-01-12 [2] CRAN (R 3.5.2)                      
 triebeard     0.3.0      2016-08-04 [2] CRAN (R 3.5.0)                      
 urltools      1.7.2      2019-02-04 [2] CRAN (R 3.5.2)                      
 usethis     * 1.4.0      2018-08-14 [2] CRAN (R 3.5.0)                      
 withr         2.1.2      2018-03-15 [2] CRAN (R 3.5.0)                      
 xml2          1.2.0      2018-01-24 [2] CRAN (R 3.5.0)                      

[1] /Users/gcn/Library/R/3.5/library
[2] /Library/Frameworks/R.framework/Versions/3.5/Resources/library

failure to read ris file

Dear authors
thanks for the useful package and I have the following error reporting:

> Embase <- ris_reader(
+   "/Users/zhangzhongheng/Downloads/records.ris"
+ )
Error: 'x' is not likely RIS format

this records.ris is exported from Embase; and I have tried several times by different number of citations, it reports the same error.

Data loss on citeproc import

cp_txt <- '[  {"id":"JolySilencetablemanners2008","accessed":{"date-parts":[[2019,10,27]]},"author":[{"family":"Joly","given":"Janneke F."},{"family":"Stapel","given":"Diederik A."},{"family":"Lindenberg","given":"Siegwart M."}],"container-title":"Personality and Social Psychology Bulletin","container-title-short":"Pers. Soc. Psychol. Bull.","DOI":"10.1177/0146167208318401","ISSN":"0146-1672, 1552-7433","issue":"8","issued":{"date-parts":[[2008,8]]},"language":"en","page":"1047-1056","references":"Retraction published 2012, <i>Personality and Social Psychology Bulletin, 38</i>[10], 1378, https://doi.org/10.1177/0146167212462821","source":"Crossref","title":"Silence and table manners: when environments activate norms","title-short":"Silence and table manners","type":"article-journal","URL":"http://journals.sagepub.com/doi/10.1177/0146167208318401","volume":"34"}]'
cp_parsed <- citeproc_reader(cp_txt)
names(cp_parsed)

When reading the Citeproc/CSL JSON format, handlr currently discards any valid CSL variables that are not part of its internal Crosscite format. This seems quite suboptimal, because it means that handlr can really only properly work with Citeproc data for a small number of item types (pretty much just article-journal and webpage). For example, the genre and medium variables that are used to indicate the category for a report or thesis are discarded. The variable editor is used for books and book chapters. In the example data I provide above, the variable references is discarded.

If I were to generate a reference for this item using the American Psychological Association CSL style, it would be:
Joly, J. F., Stapel, D. A., & Lindenberg, S. M. (2008). Silence and table manners: When environments activate norms. Personality and Social Psychology Bulletin, 34(8), 1047–1056. https://doi.org/10.1177/0146167208318401 (Retraction published 2012, Personality and Social Psychology Bulletin, 38[10], 1378, https://doi.org/10.1177/0146167212462821)

However, if I import the item to handlr, export to CSL JSON again, and render the citation, it's:
Joly, J. F., Stapel, D. A., & Lindenberg, S. M. (2008). Silence and table manners: When environments activate norms. Personality and Social Psychology Bulletin, 34(8), 1047–1056. https://doi.org/10.1177/0146167208318401

The retraction information has been lost.

Other variables, such as annote, , genre, note, medium, collection-title, number, and illustrator are also all discarded on import
For item types and fields that don't have a Crosscite analogue, it seems like it would be wise to store these in the item data (e.g., as csl_note, csl_medium) and map them to other formats at translation time as needed.

large buffer overflows in bib

x <- handlr::HandlrClient$new(x = '~/Desktop/mrg.bib')
x$read("bibtex")
#> Error in do_read_bib(file, encoding = .Encoding, srcfile): lex fatal error:
#> input buffer overflow, can't enlarge buffer because scanner uses REJECT
Session Info
Session info --------------------------------------------------------------
 setting  value                       
 version  R version 3.5.1 (2018-07-02)
 system   x86_64, darwin15.6.0        
 ui       RStudio (1.2.1162)          
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/New_York            
 date     2018-12-18                  

Packages ------------------------------------------------------------------
 package    * version    date       source                          
 base       * 3.5.1      2018-07-05 local                           
 bibtex       0.4.2      2017-06-30 CRAN (R 3.5.0)                  
 compiler     3.5.1      2018-07-05 local                           
 crul         0.6.0      2018-07-10 CRAN (R 3.5.0)                  
 curl         3.2        2018-03-28 CRAN (R 3.5.0)                  
 datasets   * 3.5.1      2018-07-05 local                           
 devtools     1.13.6     2018-06-27 CRAN (R 3.5.0)                  
 digest       0.6.18     2018-10-10 CRAN (R 3.5.0)                  
 graphics   * 3.5.1      2018-07-05 local                           
 grDevices  * 3.5.1      2018-07-05 local                           
 handlr     * 0.0.4.9210 2018-12-19 Github (ropensci/handlr@0252efc)
 httpcode     0.2.0      2016-11-14 CRAN (R 3.5.0)                  
 httr         1.4.0      2018-12-11 CRAN (R 3.5.0)                  
 jsonlite     1.6        2018-12-07 CRAN (R 3.5.0)                  
 lubridate    1.7.4      2018-04-11 CRAN (R 3.5.0)                  
 magrittr     1.5        2014-11-22 CRAN (R 3.5.0)                  
 memoise      1.1.0      2017-04-21 CRAN (R 3.5.0)                  
 methods    * 3.5.1      2018-07-05 local                           
 packrat      0.4.9-3    2018-06-01 CRAN (R 3.5.0)                  
 plyr         1.8.4      2016-06-08 CRAN (R 3.5.0)                  
 R6           2.3.0      2018-10-04 CRAN (R 3.5.0)                  
 Rcpp         1.0.0      2018-11-07 CRAN (R 3.5.0)                  
 RefManageR   1.2.0      2018-04-25 CRAN (R 3.5.0)                  
 stats      * 3.5.1      2018-07-05 local                           
 stringi      1.2.4      2018-07-20 CRAN (R 3.5.0)                  
 stringr      1.3.1      2018-05-10 CRAN (R 3.5.0)                  
 tools        3.5.1      2018-07-05 local                           
 triebeard    0.3.0      2016-08-04 CRAN (R 3.5.0)                  
 urltools     1.7.1      2018-08-03 CRAN (R 3.5.0)                  
 utils      * 3.5.1      2018-07-05 local                           
 withr        2.1.2      2018-03-15 CRAN (R 3.5.0)                  
 xml2         1.2.0      2018-01-24 CRAN (R 3.5.0)  

Support for CFF v1.2.0

Session Info
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=Spanish_Spain.1252  LC_CTYPE=Spanish_Spain.1252    LC_MONETARY=Spanish_Spain.1252
[4] LC_NUMERIC=C                   LC_TIME=Spanish_Spain.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] handlr_0.3.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7        pillar_1.6.2      compiler_4.1.0    prettyunits_1.1.1 remotes_2.4.0    
 [6] tools_4.1.0       testthat_3.0.4    digest_0.6.27     pkgbuild_1.2.0    pkgload_1.2.1    
[11] tibble_3.1.4      lifecycle_1.0.0   jsonlite_1.7.2    evaluate_0.14     memoise_2.0.0    
[16] pkgconfig_2.0.3   rlang_0.4.11      rstudioapi_0.13   cli_3.0.1         crul_1.1.0       
[21] curl_4.3.2        yaml_2.2.1        xfun_0.25         fastmap_1.1.0     withr_2.4.2      
[26] xml2_1.3.2        knitr_1.33        vctrs_0.3.8       desc_1.3.0        fs_1.5.0         
[31] devtools_2.4.2    triebeard_0.3.0   rprojroot_2.0.2   glue_1.4.2        httpcode_0.3.0   
[36] R6_2.5.1          processx_3.5.2    fansi_0.5.0       rmarkdown_2.10    sessioninfo_1.1.1
[41] purrr_0.3.4       callr_3.7.0       magrittr_2.0.1    urltools_1.7.3    ps_1.6.0         
[46] ellipsis_0.3.2    htmltools_0.5.2   usethis_2.0.1     mime_0.11         utf8_1.2.2       
[51] cachem_1.0.6      crayon_1.4.1     

Hi:

There is a new version of CFF (released on 31 May 2021) with some important changes (see changelog)

Among other changes, CFF v1.2.0 does not require some fields:

version, date-released no longer required elements of a minimal CFF

This is causing an error when trying to convert CFF v1.2.0 to another format, see a minimal example:

``` r
#devtools::install_github("dieghernan/cffr")

library(cffr)

# Minimal cff structure as per v1.2.0

minimal <- cff()

minimal
#> authors:
#> - family-names: Druskat
#>   given-names: Stephan
#> cff-version: 1.2.0
#> message: If you use this software, please cite it using these metadata.
#> title: My Research Software

# Validate against the official schema.json v1.2.0 with {jsonvalidate}
# https://github.com/citation-file-format/citation-file-format/blob/main/schema.json

cff_validate(minimal)
#> 
#> cff_validate results-----
#> Congratulations! This cff object is valid

# Try to parse with handlr

library(handlr)
#> Warning: package 'handlr' was built under R version 4.1.1
library(yaml)

tohandlr <- cff_reader(as.yaml(minimal))
#> Error: 'date-released' is required

# Fix by forcing required arguments only in v1.1.0
# Force version and date-released
fix <- minimal
fix$`date-released` <- "2010-01-01"
fix$version <- "beta"

cff_validate(fix)
#> 
#> cff_validate results-----
#> Congratulations! This cff object is valid

tohandlr <- cff_reader(as.yaml(fix))
unclass(tohandlr)
#> $cff_version
#> [1] "1.2.0"
#> 
#> $message
#> [1] "If you use this software, please cite it using these metadata."
#> 
#> $id
#> NULL
#> 
#> $type
#> [1] "SoftwareSourceCode"
#> 
#> $citeproc_type
#> [1] "article-journal"
#> 
#> $bibtex_type
#> [1] "misc"
#> 
#> $ris_type
#> [1] "COMP"
#> 
#> $resource_type_general
#> [1] "Software"
#> 
#> $identifier
#> NULL
#> 
#> $doi
#> NULL
#> 
#> $b_url
#> NULL
#> 
#> $title
#> [1] "My Research Software"
#> 
#> $author
#> $author[[1]]
#> $author[[1]]$type
#> [1] "Person"
#> 
#> $author[[1]]$name
#> [1] "Stephan Druskat"
#> 
#> $author[[1]]$givenName
#> [1] "Stephan"
#> 
#> $author[[1]]$familyName
#> [1] "Druskat"
#> 
#> $author[[1]]$orcid
#> [1] ""
#> 
#> 
#> 
#> $date_published
#> [1] "2010-01-01"
#> 
#> $software_version
#> [1] "beta"
#> 
#> $description
#> $description$text
#> NULL
#> 
#> 
#> $license
#> $license$id
#> NULL
#> 
#> 
#> $keywords
#> NULL
#> 
#> $state
#> [1] "not_found"
#> 
#> $references
#> NULL
#> 
#> attr(,"from")
#> [1] "cff"
#> attr(,"source_type")
#> [1] "string"
#> attr(,"file")
#> [1] ""
#> attr(,"many")
#> [1] FALSE

Created on 2021-09-15 by the reprex package (v2.0.0)

write handlr list with multiple citations to bibtex file

I have successfully used handlr to convert between bibilography file formats (yay!), and I can print my bibtex to teh console using bibtex_write. How do I write this to a text file external to R?

File: references.json.txt

library(handlr)
tmp <- citeproc_reader("references.json.txt")
bibtex_writer(tmp) # prints to console as a list

I tried an lapply approach and was unsuccesful:

lapply(tmp, function(x) write.table(x, 'test.bib', append= T, sep='\n', quote = F))
Session Info ``` > session_info() ─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────── setting value version R version 4.0.2 (2020-06-22) os macOS Catalina 10.15.2 system x86_64, darwin17.0 ui RStudio language (EN) collate en_US.UTF-8 ctype en_US.UTF-8 tz America/Los_Angeles date 2020-10-30

─ Packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────
package * version date lib source
abind 1.4-5 2016-07-21 [1] CRAN (R 4.0.0)
ade4 1.7-15 2020-02-13 [1] CRAN (R 4.0.0)
AnnotationDbi * 1.50.3 2020-07-25 [1] Bioconductor
ape 5.4-1 2020-08-13 [1] CRAN (R 4.0.2)
assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0)
backports 1.1.10 2020-09-15 [1] CRAN (R 4.0.2)
Biobase * 2.48.0 2020-04-27 [1] Bioconductor
BiocGenerics * 0.34.0 2020-04-27 [1] Bioconductor
BiocManager 1.30.10 2019-11-16 [1] CRAN (R 4.0.0)
BiocParallel 1.22.0 2020-04-27 [1] Bioconductor
biomformat 1.16.0 2020-04-27 [1] Bioconductor
Biostrings 2.56.0 2020-04-27 [1] Bioconductor
bit 4.0.4 2020-08-04 [1] CRAN (R 4.0.2)
bit64 4.0.5 2020-08-30 [1] CRAN (R 4.0.2)
bitops 1.0-6 2013-08-17 [1] CRAN (R 4.0.0)
blob 1.2.1 2020-01-20 [1] CRAN (R 4.0.0)
bookdown 0.20 2020-06-23 [1] CRAN (R 4.0.2)
boot 1.3-25 2020-04-26 [1] CRAN (R 4.0.2)
broom * 0.7.0 2020-07-09 [1] CRAN (R 4.0.2)
callr 3.4.4 2020-09-07 [1] CRAN (R 4.0.2)
car 3.0-9 2020-08-11 [1] CRAN (R 4.0.2)
carData 3.0-4 2020-05-22 [1] CRAN (R 4.0.0)
caret * 6.0-86 2020-03-20 [1] CRAN (R 4.0.0)
cellranger 1.1.0 2016-07-27 [1] CRAN (R 4.0.0)
class 7.3-17 2020-04-26 [1] CRAN (R 4.0.2)
cli 2.0.2 2020-02-28 [1] CRAN (R 4.0.0)
cluster 2.1.0 2019-06-19 [1] CRAN (R 4.0.2)
clusterProfiler * 3.16.0 2020-04-27 [1] Bioconductor
codetools 0.2-16 2018-12-24 [1] CRAN (R 4.0.2)
colorspace 1.4-1 2019-03-18 [1] CRAN (R 4.0.0)
ComplexUpset * 0.5.15 2020-07-10 [1] Github (krassowski/complex-upset@f5dbafe)
cowplot * 1.1.0 2020-09-08 [1] CRAN (R 4.0.2)
crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.0)
crosstalk 1.1.0.1 2020-03-13 [1] CRAN (R 4.0.0)
crul 1.0.0 2020-07-30 [1] CRAN (R 4.0.2)
curl 4.3 2019-12-02 [1] CRAN (R 4.0.0)
data.table 1.13.0 2020-07-24 [1] CRAN (R 4.0.2)
DBI 1.1.0 2019-12-15 [1] CRAN (R 4.0.0)
dbplyr 1.4.4 2020-05-27 [1] CRAN (R 4.0.0)
DelayedArray 0.14.1 2020-07-14 [1] Bioconductor
deldir 0.1-29 2020-09-13 [1] CRAN (R 4.0.2)
DEoptimR 1.0-8 2016-11-19 [1] CRAN (R 4.0.0)
desc 1.2.0 2018-05-01 [1] CRAN (R 4.0.0)
destiny * 3.2.0 2020-04-27 [1] Bioconductor
devtools * 2.3.2 2020-09-18 [1] CRAN (R 4.0.2)
digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.0)
DO.db 2.9 2020-06-08 [1] Bioconductor
DOSE 3.14.0 2020-04-27 [1] Bioconductor
downloader 0.4 2015-07-09 [1] CRAN (R 4.0.0)
dplyr * 1.0.2 2020-08-18 [1] CRAN (R 4.0.2)
e1071 1.7-3 2019-11-26 [1] CRAN (R 4.0.0)
edgeR * 3.30.3 2020-06-02 [1] Bioconductor
ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.0)
enrichplot 1.8.1 2020-04-29 [1] Bioconductor
europepmc 0.4 2020-05-31 [1] CRAN (R 4.0.0)
evaluate 0.14 2019-05-28 [1] CRAN (R 4.0.0)
fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.0)
farver 2.0.3 2020-01-16 [1] CRAN (R 4.0.0)
fastmatch 1.1-0 2017-01-28 [1] CRAN (R 4.0.0)
fgsea 1.14.0 2020-04-27 [1] Bioconductor
forcats * 0.5.0 2020-03-01 [1] CRAN (R 4.0.0)
foreach 1.5.0 2020-03-30 [1] CRAN (R 4.0.0)
foreign 0.8-80 2020-05-24 [1] CRAN (R 4.0.2)
fs 1.5.0 2020-07-31 [1] CRAN (R 4.0.2)
generics 0.0.2 2018-11-29 [1] CRAN (R 4.0.0)
GenomeInfoDb 1.24.2 2020-06-15 [1] Bioconductor
GenomeInfoDbData 1.2.3 2020-05-19 [1] Bioconductor
GenomicAlignments 1.24.0 2020-04-27 [1] Bioconductor
GenomicRanges 1.40.0 2020-04-27 [1] Bioconductor
geosphere * 1.5-10 2019-05-26 [1] CRAN (R 4.0.2)
ggcorrplot * 0.1.3 2019-05-19 [1] CRAN (R 4.0.2)
ggforce 0.3.2 2020-06-23 [1] CRAN (R 4.0.2)
ggplot.multistats 1.0.0 2019-10-28 [1] CRAN (R 4.0.0)
ggplot2 * 3.3.2 2020-06-19 [1] CRAN (R 4.0.2)
ggplotify * 0.0.5 2020-03-12 [1] CRAN (R 4.0.0)
ggpmisc * 0.3.6 2020-09-07 [1] CRAN (R 4.0.2)
ggpubr * 0.4.0 2020-06-27 [1] CRAN (R 4.0.2)
ggraph 2.0.3 2020-05-20 [1] CRAN (R 4.0.0)
ggrepel * 0.8.2 2020-03-08 [1] CRAN (R 4.0.0)
ggridges 0.5.2 2020-01-12 [1] CRAN (R 4.0.0)
ggsignif 0.6.0 2019-08-08 [1] CRAN (R 4.0.0)
ggthemes * 4.2.0 2019-05-13 [1] CRAN (R 4.0.0)
glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.2)
GO.db 3.11.4 2020-06-08 [1] Bioconductor
goftest 1.2-2 2019-12-02 [1] CRAN (R 4.0.2)
GOSemSim 2.14.1 2020-07-25 [1] Bioconductor
gower 0.2.2 2020-06-23 [1] CRAN (R 4.0.2)
graphlayouts 0.7.0 2020-04-25 [1] CRAN (R 4.0.0)
gridExtra * 2.3 2017-09-09 [1] CRAN (R 4.0.0)
gridGraphics 0.5-0 2020-02-25 [1] CRAN (R 4.0.0)
gtable 0.3.0 2019-03-25 [1] CRAN (R 4.0.0)
handlr * 0.3.0 2020-10-15 [1] CRAN (R 4.0.2)
haven 2.3.1 2020-06-01 [1] CRAN (R 4.0.0)
hexbin 1.28.1 2020-02-03 [1] CRAN (R 4.0.0)
highr 0.8 2019-03-20 [1] CRAN (R 4.0.0)
hms 0.5.3 2020-01-08 [1] CRAN (R 4.0.0)
htmltools 0.5.0 2020-06-16 [1] CRAN (R 4.0.2)
htmlwidgets 1.5.1 2019-10-08 [1] CRAN (R 4.0.0)
httpcode 0.3.0 2020-04-10 [1] CRAN (R 4.0.0)
httr 1.4.2 2020-07-20 [1] CRAN (R 4.0.2)
igraph 1.2.5 2020-03-19 [1] CRAN (R 4.0.0)
ipred 0.9-9 2019-04-28 [1] CRAN (R 4.0.0)
IRanges * 2.22.2 2020-05-21 [1] Bioconductor
irlba 2.3.3 2019-02-05 [1] CRAN (R 4.0.0)
iterators 1.0.12 2019-07-26 [1] CRAN (R 4.0.0)
jsonlite 1.7.1 2020-09-07 [1] CRAN (R 4.0.2)
kableExtra * 1.2.1 2020-08-27 [1] CRAN (R 4.0.2)
knitr * 1.29 2020-06-23 [1] CRAN (R 4.0.2)
knn.covertree 1.0 2019-10-28 [1] CRAN (R 4.0.0)
labeling 0.3 2014-08-23 [1] CRAN (R 4.0.0)
laeken 0.5.1 2020-02-05 [1] CRAN (R 4.0.0)
lattice * 0.20-41 2020-04-02 [1] CRAN (R 4.0.2)
lava 1.6.7 2020-03-05 [1] CRAN (R 4.0.0)
lazyeval 0.2.2 2019-03-15 [1] CRAN (R 4.0.0)
lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.0)
limma * 3.44.3 2020-06-12 [1] Bioconductor
lmtest 0.9-38 2020-09-09 [1] CRAN (R 4.0.2)
locfit 1.5-9.4 2020-03-25 [1] CRAN (R 4.0.0)
lubridate 1.7.9 2020-06-08 [1] CRAN (R 4.0.2)
magrittr * 1.5 2014-11-22 [1] CRAN (R 4.0.0)
MASS 7.3-53 2020-09-09 [1] CRAN (R 4.0.2)
Matrix 1.2-18 2019-11-27 [1] CRAN (R 4.0.2)
matrixStats 0.56.0 2020-03-13 [1] CRAN (R 4.0.0)
memoise 1.1.0 2017-04-21 [1] CRAN (R 4.0.0)
mgcv 1.8-33 2020-08-27 [1] CRAN (R 4.0.2)
microbiome * 1.10.0 2020-04-27 [1] Bioconductor
microbiomeutilities * 1.00.00 2020-10-02 [1] Github (microsud/microbiomeutilities@e17fff4)
mime 0.9 2020-02-04 [1] CRAN (R 4.0.0)
ModelMetrics 1.2.2.2 2020-03-17 [1] CRAN (R 4.0.0)
modelr 0.1.8 2020-05-19 [1] CRAN (R 4.0.0)
multtest 2.44.0 2020-04-27 [1] Bioconductor
munsell 0.5.0 2018-06-12 [1] CRAN (R 4.0.0)
nlme * 3.1-149 2020-08-23 [1] CRAN (R 4.0.2)
nnet 7.3-14 2020-04-26 [1] CRAN (R 4.0.2)
openxlsx 4.1.5 2020-05-06 [1] CRAN (R 4.0.2)
org.Sc.sgd.db * 3.11.4 2020-06-13 [1] Bioconductor
parallelDist * 0.2.4 2018-12-12 [1] CRAN (R 4.0.2)
patchwork * 1.0.1 2020-06-22 [1] CRAN (R 4.0.0)
pcaMethods 1.80.0 2020-04-27 [1] Bioconductor
permute * 0.9-5 2019-03-12 [1] CRAN (R 4.0.0)
pheatmap 1.0.12 2019-01-04 [1] CRAN (R 4.0.0)
phyloseq * 1.32.0 2020-04-27 [1] Bioconductor
pillar 1.4.6 2020-07-10 [1] CRAN (R 4.0.2)
pkgbuild 1.1.0 2020-07-13 [1] CRAN (R 4.0.2)
pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.0)
pkgload 1.1.0 2020-05-29 [1] CRAN (R 4.0.0)
plotly * 4.9.2.1 2020-04-04 [1] CRAN (R 4.0.0)
plyr 1.8.6 2020-03-03 [1] CRAN (R 4.0.0)
polyclip 1.10-0 2019-03-14 [1] CRAN (R 4.0.0)
prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.0)
pROC 1.16.2 2020-03-19 [1] CRAN (R 4.0.0)
processx 3.4.4 2020-09-03 [1] CRAN (R 4.0.2)
prodlim 2019.11.13 2019-11-17 [1] CRAN (R 4.0.0)
progress 1.2.2 2019-05-16 [1] CRAN (R 4.0.0)
proxy 0.4-24 2020-04-25 [1] CRAN (R 4.0.0)
ps 1.3.4 2020-08-11 [1] CRAN (R 4.0.2)
purrr * 0.3.4 2020-04-17 [1] CRAN (R 4.0.0)
qvalue 2.20.0 2020-04-27 [1] Bioconductor
R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.0)
ranger * 0.12.1 2020-01-10 [1] CRAN (R 4.0.0)
rbibutils * 1.3 2020-10-05 [1] CRAN (R 4.0.2)
RColorBrewer * 1.1-2 2014-12-07 [1] CRAN (R 4.0.0)
Rcpp 1.0.5 2020-07-06 [1] CRAN (R 4.0.2)
RcppEigen 0.3.3.7.0 2019-11-16 [1] CRAN (R 4.0.0)
RcppHNSW 0.3.0 2020-09-06 [1] CRAN (R 4.0.2)
RcppParallel 5.0.2 2020-06-24 [1] CRAN (R 4.0.2)
RCurl 1.98-1.2 2020-04-18 [1] CRAN (R 4.0.0)
readr * 1.3.1 2018-12-21 [1] CRAN (R 4.0.0)
readxl * 1.3.1 2019-03-13 [1] CRAN (R 4.0.0)
recipes 0.1.13 2020-06-23 [1] CRAN (R 4.0.2)
remotes 2.2.0 2020-07-21 [1] CRAN (R 4.0.2)
rentrez * 1.2.2 2019-05-02 [1] CRAN (R 4.0.2)
reprex 0.3.0 2019-05-16 [1] CRAN (R 4.0.0)
reshape2 * 1.4.4 2020-04-09 [1] CRAN (R 4.0.0)
rhdf5 2.32.2 2020-07-03 [1] Bioconductor
Rhdf5lib 1.10.1 2020-07-09 [1] Bioconductor
rio 0.5.16 2018-11-26 [1] CRAN (R 4.0.0)
rlang 0.4.7 2020-07-09 [1] CRAN (R 4.0.2)
rmarkdown 2.3 2020-06-18 [1] CRAN (R 4.0.2)
robustbase 0.93-6 2020-03-23 [1] CRAN (R 4.0.0)
rpart * 4.1-15 2019-04-12 [1] CRAN (R 4.0.2)
rprojroot 1.3-2 2018-01-03 [1] CRAN (R 4.0.0)
Rsamtools 2.4.0 2020-04-27 [1] Bioconductor
RSpectra 0.16-0 2019-12-01 [1] CRAN (R 4.0.0)
RSQLite 2.2.0 2020-01-07 [1] CRAN (R 4.0.0)
rstatix 0.6.0 2020-06-18 [1] CRAN (R 4.0.2)
rstudioapi 0.11 2020-02-07 [1] CRAN (R 4.0.0)
rtracklayer 1.48.0 2020-04-27 [1] Bioconductor
Rtsne 0.15 2018-11-10 [1] CRAN (R 4.0.0)
rvcheck 0.1.8 2020-03-01 [1] CRAN (R 4.0.0)
rvest 0.3.6 2020-07-25 [1] CRAN (R 4.0.2)
S4Vectors * 0.26.1 2020-05-16 [1] Bioconductor
scales * 1.1.1 2020-05-11 [1] CRAN (R 4.0.0)
scatterpie 0.1.5 2020-09-09 [1] CRAN (R 4.0.2)
scatterplot3d 0.3-41 2018-03-14 [1] CRAN (R 4.0.0)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.0)
SingleCellExperiment 1.10.1 2020-04-28 [1] Bioconductor
smoother 1.1 2015-04-16 [1] CRAN (R 4.0.0)
sp 1.4-2 2020-05-20 [1] CRAN (R 4.0.0)
spatstat * 1.64-1 2020-05-12 [1] CRAN (R 4.0.2)
spatstat.data * 1.4-3 2020-01-26 [1] CRAN (R 4.0.2)
spatstat.utils 1.17-0 2020-02-07 [1] CRAN (R 4.0.2)
stringi 1.5.3 2020-09-09 [1] CRAN (R 4.0.2)
stringr * 1.4.0 2019-02-10 [1] CRAN (R 4.0.0)
SummarizedExperiment 1.18.2 2020-07-14 [1] Bioconductor
survival 3.2-3 2020-06-13 [1] CRAN (R 4.0.2)
tensor 1.5 2012-05-05 [1] CRAN (R 4.0.2)
testthat * 2.3.2 2020-03-02 [1] CRAN (R 4.0.0)
tibble * 3.0.3 2020-07-10 [1] CRAN (R 4.0.2)
tidygraph 1.2.0 2020-05-12 [1] CRAN (R 4.0.0)
tidyr * 1.1.2 2020-08-27 [1] CRAN (R 4.0.2)
tidyselect 1.1.0 2020-05-11 [1] CRAN (R 4.0.0)
tidyverse * 1.3.0 2019-11-21 [1] CRAN (R 4.0.0)
timeDate 3043.102 2018-02-21 [1] CRAN (R 4.0.0)
triebeard 0.3.0 2016-08-04 [1] CRAN (R 4.0.0)
TTR 0.24.2 2020-09-01 [1] CRAN (R 4.0.2)
tweenr 1.0.1 2018-12-14 [1] CRAN (R 4.0.0)
UpSetR * 1.4.0 2019-05-22 [1] CRAN (R 4.0.0)
urltools 1.7.3 2019-04-14 [1] CRAN (R 4.0.0)
usethis * 1.6.3 2020-09-17 [1] CRAN (R 4.0.2)
utf8 1.1.4 2018-05-24 [1] CRAN (R 4.0.0)
vcd 1.4-7 2020-04-02 [1] CRAN (R 4.0.0)
vctrs 0.3.4 2020-08-29 [1] CRAN (R 4.0.2)
vegan * 2.5-6 2019-09-01 [1] CRAN (R 4.0.0)
VIM 6.0.0 2020-05-08 [1] CRAN (R 4.0.0)
viridis * 0.5.1 2018-03-29 [1] CRAN (R 4.0.0)
viridisLite * 0.3.0 2018-02-01 [1] CRAN (R 4.0.0)
webshot 0.5.2 2019-11-22 [1] CRAN (R 4.0.0)
withr 2.2.0 2020-04-20 [1] CRAN (R 4.0.0)
xfun 0.17 2020-09-09 [1] CRAN (R 4.0.2)
XML 3.99-0.5 2020-07-23 [1] CRAN (R 4.0.2)
xml2 1.3.2 2020-04-23 [1] CRAN (R 4.0.0)
xts 0.12.1 2020-09-09 [1] CRAN (R 4.0.2)
XVector 0.28.0 2020-04-27 [1] Bioconductor
yaml 2.2.1 2020-02-01 [1] CRAN (R 4.0.0)
zip 2.1.1 2020-08-27 [1] CRAN (R 4.0.2)
zlibbioc 1.34.0 2020-04-27 [1] Bioconductor
zoo 1.8-8 2020-05-02 [1] CRAN (R 4.0.0)

[1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

</details>

[feature request] Default action on `could not figure out the mime type`

Hello,

I wonder if there could be a default action specified on mime type exception.

Despite I have octet-stream in a application list and handlr should've not fail.

 $ cat ~/.config/mimeapps.list | grep octet-stream
application/octet-stream=nvim.desktop;
 $ handlr open user
could not figure out the mime type of 'user'
 $ file user                                    
user: GVariant Database file, version 0
 $ file --mime user        
user: application/octet-stream; charset=binary

p.s. If you acknowledge that it's a bug I can create a new ticket.

I can even upload the file, it's basically default dconf registry

Add `.zenodo.json` writer

It's often useful to add a .zenodo.json file before uploading the package to zenodo to customise metadata.

Unfortunately, I don't know any tool to assist you in producing such a file. And even though zenodo allows you to export a CFF file, it doesn't look like it can read from one to create the deposit metadata.

I believe handlr would be the perfect place to help users create a .zenodo.json file from any existing file. What do you think?

codemeta: `@context` item should be changed I think

right now codemeta_writer is assigning https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld to @context, but I think it should be the below:

"@context": [
    "http://purl.org/codemeta/2.0",
    "http://schema.org"
  ]

Error in `ris_reader()` for files with more than one abstract

For RIS files with multiple abstracts the ris_reader() function aborts with the following error message:

> handlr::ris_reader("example.ris")
Error in if (!nchar(grep("^AB|^N2", x, value = TRUE)) > 200) { : 
  the condition has length > 1

My example RIS looks like this (as exported by Zotero):

TY  - JOUR
TI  - Energy Poverty in Europe: A Multidimensional Approach
AU  - Bollino, Carlo Andrea
AU  - Botti, Fabrizio
T2  - PSL Quarterly Review
AB  - With the European Commission’s “Third Energy Package”, the challenges posed by energy poverty have been recently acknowledged by European legislation.  The paper develops a synthetic indicator of energy poverty for the purpose of assessing households’ well-being across different domains of inequality in access to energy services and to a healthy domestic environment. These dimensions are broadly defined in terms of energy affordability and thermal efficiency, two of the main manifestations of energy poverty. The analysis focuses on Europe and expands on existing economic literature by employing a fuzzy analysis for the definition of a multidimensional energy poverty index, which is then used to investigate the role of individual and household characteristics in shaping energy poverty. We find that during the European crisis energy poverty has been more stable than monetary poverty, and that thermal efficiency plays a crucial role in shaping individual and countries’ average degrees of energy poverty. 

 
JEL codes: I32; Q41; D10; D63
DA  - 2017/12/04/
PY  - 2017
DO  - 10.13133/2037-3643_70.283_4
DP  - DOI.org (Datacite)
VL  - V. 70
SP  - 473
EP  - 507 Paginazione
LA  - en
ST  - Energy Poverty in Europe
UR  - https://ojs.uniroma1.it/index.php/PSLQuarterlyReview/article/view/14155
Y2  - 2023/05/09/13:08:44
KW  - Energy Poverty, Fuel Poverty, Multidimensional Poverty, Fuzzy Analysis
KW  - I32; Q41; D10; D63
ER  - 

TY  - JOUR
TI  - The energy divide: Integrating energy transitions, regional inequalities and poverty trends in the European Union
AU  - Bouzarovski, Stefan
AU  - Tirado Herrero, Sergio
T2  - European Urban and Regional Studies
AB  - Energy poverty can be understood as the inability of a household to secure a socially and materially necessitated level of energy services in the home. While the condition is widespread across Europe, its spatial and social distribution is highly uneven. In this paper, the existence of a geographical energy poverty divide in the European Union (EU) provides a starting point for conceptualizing and exploring the relationship between energy transitions – commonly described as wide-ranging processes of socio-technical change – and existing patterns of regional economic inequality. We have undertaken a comprehensive analysis of spatial and temporal trends in the national-scale patterns of energy poverty, as well as gas and electricity prices. The results of our work indicate that the classic economic development distinction between the core and periphery also holds true in the case of energy poverty, as the incidence of this phenomenon is significantly higher in Southern and Eastern European EU Member States. The paper thus aims to provide the building blocks for a novel theoretical integration of questions of path-dependency, uneven development and material deprivation in existing interpretations of energy transitions.
DA  - 2017/01//
PY  - 2017
DO  - 10.1177/0969776415596449
DP  - DOI.org (Crossref)
VL  - 24
IS  - 1
SP  - 69
EP  - 86
J2  - European Urban and Regional Studies
LA  - en
SN  - 0969-7764, 1461-7145
ST  - The energy divide
UR  - http://journals.sagepub.com/doi/10.1177/0969776415596449
Y2  - 2023/05/09/13:08:56
L1  - https://europepmc.org/articles/pmc5477826?pdf=render
ER  - 

If I remove abstracts beforehand, the error does not occur:

clean_ris <- function(file) {
  ris <- readLines(file, encoding = "UTF-8")
  ris <- paste(ris[!grepl("^AB|^N2", ris)], collapse = "\n")
  cat(ris, "\n", file = file)
  file
}

handlr::ris_reader(clean_ris("example.ris"))

It seems like this issue relates to the fact that when multiple abstracts are found, the if condition to determine abstract length (Line 113 in ris_reader.R) is not valid. My workaround is to add a call to any() to ensure that a single logical value is passed to if:

if (!any(nchar(grep("^AB|^N2", x, value = TRUE)) > 200))

I don't know if this is a reliable fix or if it introduces issues down the line, but in the case of my example RIS, it seems to work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.