knitr - How do I provide only the year in a citation in R markdown? -


my rmarkdown script looks follows:

--- title: "untitled" author: "me" date: '`r format(sys.time(), "%d %b, %y")`' output:   pdf_document: default   bibliography: bibliography.bib ---  in book helsel explains how approach censored environmental data [@helsel_statistics_2012]. 

my .bib file such:

@book{helsel_statistics_2012,     address = {hoboken, n.j},     edition = {2nd ed},     series = {wiley series in statistics in practice},     title = {statistics censored environmental data using {minitab} , {r}},     isbn = {978-0-470-47988-9},     publisher = {wiley},     author = {helsel, dennis r.},     year = {2012},     note = {00003 oclc: ocn748290711},     keywords = {environmental sciences, measurement statistical methods, minitab, pollution, r (computer program language), statistical methods}, } 

when knit file following output:

in book helsel explains how approach censored environmental data (helsel 2012).

question: how can return year in in citation (as state author in text)?

in book helsel (2012) explains how approach censored environmental data.

in rmarkdown (.rmd) file put following (note removal of [ ] brackets [@helsel_statistics_2012]):

in book @helsel_statistics_2012 explains how approach censored environmental data. 

once rendered give desired output:

in book helsel (2012) explains how approach censored environmental data. 

if want year citation then:

[-@helsel_statistics_2012] 

returns:

(2012) 

for more details see rmarkdown documetation on citations http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -