To cite spam in publications use:

Reinhard Furrer, Stephan R. Sain (2010). spam: A Sparse Matrix R Package with Emphasis on MCMC Methods for Gaussian Markov Random Fields. Journal of Statistical Software, 36(10), 1-25. URL http://www.jstatsoft.org/v36/i10/.

Corresponding BibTeX entry:

  @Article{,
    title = {{spam}: A Sparse Matrix {R} Package with Emphasis on MCMC
      Methods for Gaussian Markov Random Fields},
    author = {Reinhard Furrer and Stephan R. Sain},
    journal = {Journal of Statistical Software},
    year = {2010},
    volume = {36},
    number = {10},
    pages = {1--25},
    url = {http://www.jstatsoft.org/v36/i10/},
  }