On 19 August 2024 at 15:15, Thierry Onkelinx wrote:
| Maybe checklist:::author2df() might be useful. It is an unexported function
| from my checklist package. It converts a person() object to a dataframe.
| 
https://github.com/inbo/checklist/blob/5649985b58693acb88337873ae14a7d5bc018d96
| /R/store_authors.R#L38
| 
| df <- tools::CRAN_package_db()
| lapply(
|   df$`Authors@R`[df$Package  %in% c("git2rdata", "qrcode")],
|   function(x) {
|     parse(text = x) |>
|       eval() |>
|       vapply(checklist:::author2df, vector(mode = "list", 1)) |>
|       do.call(what = rbind)
|   }
| )
| 
| 
| [[1]]
|     given       family                       email               orcid 
affiliation usage
| 1 Thierry     Onkelinx    [email protected] 0000-0001-8804-4216        
<NA>     1
| 2  Floris Vanderhaeghe [email protected] 0000-0002-6378-6229        
<NA>     1
| 3   Peter       Desmet        [email protected] 0000-0002-8442-8025        
<NA>     1
| 4     Els     Lommelen        [email protected] 0000-0002-3481-5684        
<NA>     1
| 
| [[2]]
|     given   family                 email               orcid affiliation usage
| 1 Thierry Onkelinx [email protected] 0000-0001-8804-4216        <NA>     1
| 2  Victor      Teh   [email protected]  

That's a very nice start, thank you. (Will also look more closely at
checklist.)  It needs an `na.omit()` or alike, and even with that `rbind`
barked a few entries in (i = 19 if you select the full vector right now).

But definitely something to play with and possibly build upon. Thanks!  (And
the IDs of Floris and you were two of the ones I 'manually' added to a
DESCRIPTION file ;-)

Best,  Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | [email protected]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to