Skip to contents

Used to replace the values stored for a specified field in a BibEntry object.

Usage

# S3 method for class 'BibEntry'
x$name <- value

Arguments

x

a BibEntry object

name

string; the field to assign the new values to.

value

character vector; the replacement field values to be assigned.

Value

an object of class BibEntry with the updated fields.

Note

The method expects date and name list fields to be in the format expected by Biblatex. The field specified by name does not have to be one currently in x.

See also

Other operators: $.BibEntry(), +.BibEntry(), [.BibEntry(), [<-.BibEntry(), [[.BibEntry(), [[<-.BibEntry(), c.BibEntry()

Examples

bib <- BibEntry(bibtype = "misc", key = "mclean", author = "Mathew W. McLean", 
  title = "My Work", year = "2012")
bib$year <- 2014
bib$author <- "McLean, M. W. and Carroll, R. J." 
bib$url <- "https://example.com"
bib
#> [1] M. W. McLean and R. J. Carroll. _My Work_. 2014.
#> <https://example.com>.

bib <- c(bib, as.BibEntry(citation()))
bib[1]$author[2] <- person(c("Raymond", "J."), "Carroll")
#> Error in eval(kal): object '*tmp*' not found
bib$author
#> $mclean
#> [1] "M. W. McLean"  "R. J. Carroll"
#> 
#> $`2024language`
#> [1] "R Core Team"
#>