Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

set_authors() fails when comment: field has more than one entry #91

Closed
januz opened this issue Apr 2, 2020 · 5 comments
Closed

set_authors() fails when comment: field has more than one entry #91

januz opened this issue Apr 2, 2020 · 5 comments
Labels
bug an unexpected problem or unintended behavior good first issue ❤️ good issue for first-time contributors

Comments

@januz
Copy link

januz commented Apr 2, 2020

Besides an author's ORCID-ID, I would like to add their affiliation information to the DESCRIPTION file. If I use the below with only the ORCID or the affiliation entry in the comment: field, it works, when I try to use them both, desc::set_authors() fails with the error:

Error in vapply(x1, deparse, "") : values must be length 1,
 but FUN(X[[5]]) result is length 2

Example:

authors <- c(person(given = "First",
         family = "Last",
         role = c("aut", "cre"),
         email = "flast@email.org",
         comment = c(
           ORCID = "0000-0000-0000-0000",
           affiliation = "University One")
         ),
  person(given = "Second",
         family = "Last",
         role = "aut",
         email = "slast@email.org",
         comment = c(
           ORCID = "0000-0000-0000-0000",
           affiliation = c("University One", "University Two")
         )
  ))

desc <- desc::description$new("!new")
desc$set_authors(authors)
@jackwasey
Copy link

This also results in normalization etc. failing.

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Jun 8, 2020
@gaborcsardi
Copy link
Member

PR is welcome, probably just need to relax the argument check?

@gaborcsardi gaborcsardi added the good first issue ❤️ good issue for first-time contributors label Jun 8, 2020
@wkdavis
Copy link

wkdavis commented Sep 4, 2020

Not sure if it should be its own issue, but the same thing happens with the role field:

desc <- desc::description$new("!new")
desc$set_authors(person(given = "First", family = "Author", role = c("aut", "ctb")))
desc$add_author(given = "Second", family = "Author", role = c("aut", "ctb"))
#> Error: role must be a string or NULL

sessionInfo()
#> R version 3.6.1 (2019-07-05)
#> Platform: x86_64-apple-darwin15.6.0 (64-bit)
#> Running under: macOS Catalina 10.15.6
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] rprojroot_1.3-2  digest_0.6.25    crayon_1.3.4     assertthat_0.2.1
#>  [5] R6_2.4.1         backports_1.1.8  magrittr_1.5     evaluate_0.14   
#>  [9] highr_0.8        rlang_0.4.7      stringi_1.4.6    rmarkdown_2.3   
#> [13] desc_1.2.0       tools_3.6.1      stringr_1.4.0    xfun_0.15       
#> [17] yaml_2.2.1       compiler_3.6.1   htmltools_0.5.0  knitr_1.29

Created on 2020-09-04 by the reprex package (v0.3.0)

@gaborcsardi
Copy link
Member

@wkdavis I believe that this has been fixed already.

@wkdavis
Copy link

wkdavis commented Sep 4, 2020

@gaborcsardi I've updated my reprex with sessionInfo(). Is the fix in the development version? I believe I'm using the latest CRAN release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior good first issue ❤️ good issue for first-time contributors
Projects
None yet
Development

No branches or pull requests

4 participants