Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dieghernan
Copy link
Member

@dieghernan dieghernan commented Apr 17, 2023

Description

New parameter in cff_create() and cff_write() that allows to control which roles would appear as "authors" on the CITATION.cff file /cffobject

Related Issue

Close #49

Example

library(cffr)

packageVersion("cffr")
#> [1] '0.4.1.9000'

# Download desc
tempdesc <- file.path(tempdir(), "DESCRIPTION")
download.file(
  "https://raw.githubusercontent.com/Global-Health-Engineering/durbanplasticwaste22/main/DESCRIPTION",
  tempdesc
)

# From
dfile <- desc::desc(tempdesc)
dfile$get_authors()
#> [1] "Raúl Bergen <[email protected]> [aut] (<https://orcid.org/0000-0002-0678-6425>)"              
#> [2] "Lars Schöbitz <[email protected]> [cre] (<https://orcid.org/0000-0003-2196-5015>)"            
#> [3] "Chiara Meyer-Piening <[email protected]> [aut] (<https://orcid.org/0000-0003-2368-7418>)" 
#> [4] "Boynton Lin <[email protected]> [ctb] (<https://orcid.org/0000-0002-9944-3834>)"                
#> [5] "Elizabeth Tilley <[email protected]> [ctb] (<https://orcid.org/0000-0002-2095-9724>)"            
#> [6] "Marc Kalina <[email protected]> [ctb] (<https://orcid.org/0000-0002-6335-3845>)"                 
#> [7] "Siphiwe Rakgabale <[email protected]> [ctb] (<https://orcid.org/0009-0007-3253-6327>)"
#> [8] "Sfiso Nduduzo Luvuno <[email protected]> [ctb]"                                    
#> [9] "Global Health Engineering [fnd]"

# By default only aut or cre
orig <- cff_create(tempdesc, dependencies = FALSE)

orig$authors
#> - family-names: Bergen
#>   given-names: Raúl
#>   email: [email protected]
#>   orcid: https://orcid.org/0000-0002-0678-6425
#> - family-names: Schöbitz
#>   given-names: Lars
#>   email: [email protected]
#>   orcid: https://orcid.org/0000-0003-2196-5015
#> - family-names: Meyer-Piening
#>   given-names: Chiara
#>   email: [email protected]
#>   orcid: https://orcid.org/0000-0003-2368-7418

# Now add ctb and founders
mod <- cff_create(tempdesc,
  authors_roles = c("aut", "cre", "ctb", "fnd"), dependencies = FALSE
)

mod$authors
#> - family-names: Bergen
#>   given-names: Raúl
#>   email: [email protected]
#>   orcid: https://orcid.org/0000-0002-0678-6425
#> - family-names: Schöbitz
#>   given-names: Lars
#>   email: [email protected]
#>   orcid: https://orcid.org/0000-0003-2196-5015
#> - family-names: Meyer-Piening
#>   given-names: Chiara
#>   email: [email protected]
#>   orcid: https://orcid.org/0000-0003-2368-7418
#> - family-names: Lin
#>   given-names: Boynton
#>   email: [email protected]
#>   orcid: https://orcid.org/0000-0002-9944-3834
#> - family-names: Tilley
#>   given-names: Elizabeth
#>   email: [email protected]
#>   orcid: https://orcid.org/0000-0002-2095-9724
#> - family-names: Kalina
#>   given-names: Marc
#>   email: [email protected]
#>   orcid: https://orcid.org/0000-0002-6335-3845
#> - family-names: Rakgabale
#>   given-names: Siphiwe
#>   email: [email protected]
#>   orcid: https://orcid.org/0009-0007-3253-6327
#> - family-names: Luvuno
#>   given-names: Sfiso Nduduzo
#>   email: [email protected]
#> - name: Global Health Engineering

Created on 2023-04-17 with reprex v2.0.2

@dieghernan dieghernan merged commit e940846 into main Apr 17, 2023
@dieghernan dieghernan deleted the addroles branch February 7, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Add additional roles from utils::person() function to cff_schema_key() value author

2 participants