Skip to content

Commit 41f8f03

Browse files
authored
Merge pull request #610 from tfjaeger/main
Fixing write_bib for packages with multiple citation entries
2 parents 8286d75 + b1cd173 commit 41f8f03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/r_refs.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ create_bib <- function(x, file, append = TRUE, prefix = "R-", type_pref = c("Art
102102
bibtypes <- unlist(cite$bibtype)
103103

104104
pref_entry <- type_pref[tolower(type_pref) %in% tolower(bibtypes)][1]
105-
cite <- if(is.na(pref_entry)) cite[[1]] else cite[[bibtypes == pref_entry]]
105+
cite <- if(is.na(pref_entry)) cite[[1]] else cite[[which(bibtypes %in% pref_entry)]]
106106
}
107107

108108
if(tweak) {

0 commit comments

Comments
 (0)