To cite package 'margins' in publications use:

Thomas J. Leeper (2018). margins: Marginal Effects for Model Objects. R package version 0.3.20.

Corresponding BibTeX entry:

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