To cite package 'margins' in publications use:

Leeper TJ (2021). margins: Marginal Effects for Model Objects. R package version 0.3.26.

Corresponding BibTeX entry:

  @Manual{,
    title = {margins: Marginal Effects for Model Objects},
    author = {Thomas J. Leeper},
    year = {2021},
    note = {R package version 0.3.26},
  }