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

Assigning author attributes #100

Open
AlanInTsukuba opened this issue Oct 17, 2023 · 2 comments · May be fixed by #101
Open

Assigning author attributes #100

AlanInTsukuba opened this issue Oct 17, 2023 · 2 comments · May be fixed by #101

Comments

@AlanInTsukuba
Copy link

I am trying to assign author attributes in a BibEntry using person.

I start with a bib record:

@inproceedings{ICUS01:T01:S01:1,
crossref={ICUS01},
author={Camilo Dagum},
title={The Impact of Unified Science on Economics}
}

str() gives

.. ..$ author :Class 'person' hidden list of 1
.. .. ..$ :List of 5
.. .. .. ..$ given : chr "Camilo"
.. .. .. ..$ family : chr "Dagum"
.. .. .. ..$ role : NULL
.. .. .. ..$ email : NULL
.. .. .. ..$ comment: NULL

then make a person

p <- person(given = "Camilo", family = "Dagum", role = c("spk") )

This looks okay:

str(p)
Class 'person' hidden list of 1
$ :List of 5
..$ given : chr "Camilo"
..$ family : chr "Dagum"
..$ role : chr "spk"
..$ email : NULL
..$ comment: NULL

But then assign to author

bib[[1]]$author<- p

Get:
str()
..$ author :Class 'person' hidden list of 1
.. ..$ :List of 5
.. .. ..$ given : chr [1:2] "Camilo" "Dagum"
.. .. ..$ family : chr "[spk]"
.. .. ..$ role : NULL
.. .. ..$ email : NULL
.. .. ..$ comment: NULL

Try assigning individually

bib[[1]]$author$family <- "Dagum"
bib[[1]]$author$given <- "Camilo"
bib[[1]]$author$role <- "spk"

Same result:

str(bib)
..$ author :Class 'person' hidden list of 1
.. ..$ :List of 5
.. .. ..$ given : chr [1:2] "Camilo" "Dagum"
.. .. ..$ family : chr "[spk]"
.. .. ..$ role : NULL
.. .. ..$ email : NULL
.. .. ..$ comment: NULL

Similar for comment:
bib[[1]]$author$family <- "Dagum"
bib[[1]]$author$given <- "Camilo"
bib[[1]]$author$role <- "spk"
bib[[1]]$author$comment <- c(ORCID = "0000-0003-0918-3766")

str(bib)
..$ author :Class 'person' hidden list of 1
.. ..$ :List of 5
.. .. ..$ given : chr [1:3] "Camilo" "Dagum" "[spk]"
.. .. ..$ family : chr "(0000-0003-0918-3766)"
.. .. ..$ role : NULL
.. .. ..$ email : NULL
.. .. ..$ comment: NULL

All help is appreciated.

mwmclean added a commit that referenced this issue Oct 19, 2023
@mwmclean mwmclean linked a pull request Oct 19, 2023 that will close this issue
@mwmclean
Copy link
Collaborator

This should be fixed by #101. If you'd like to test it, you can install the remotes package and run remotes::install_github("ROpenSci/RefManageR#101").

@AlanInTsukuba
Copy link
Author

Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants