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

Add a custom field to export ? #29

Open
amelinevallet opened this issue Jul 22, 2024 · 0 comments
Open

Add a custom field to export ? #29

amelinevallet opened this issue Jul 22, 2024 · 0 comments

Comments

@amelinevallet
Copy link

Hello,
I would like to add to the exported bibliographic information, a custom field, containing a unique ID defined within the context of our review project. Is this possible ? The unique ID is contained in the column of a dataframe, that I can export to a .ris file with the write_refs function (everything work fine). How can I specifiy / add a custom fields to the export ? I have tried to use the tag_naming option from the read_refs and write_refs functions, but did not succeeded to using it for this purpose. Any recommandation about how to proceed ?
I am looking for an option doing this :

references <- data.frame(
  AU = c("Smith, John", "Doe, Jane"),
  TI = c("Sample Title 1", "Sample Title 2"),
  PY = c("2023", "2022"),
  ID = c("CustomID1", "CustomID2") # Custom citation unique identifier
)
bibliography <- as.bibliography(references)

custom_fields <- list(
  ID = "ID" # Adding the ID variable to the list of custom fields to add to the export
)

write_refs(bibliography, format = "ris", file = "output.ris", custom_fields = custom_fields)

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

No branches or pull requests

1 participant