title: Use a prior triangular distribution in rethinking - R
body: <p>I’m using the rethinking package in R to make a simple linear model. In the folowing code  I use a prior normal distribution for the dependent variable and everything works good.</p>
  
  <pre><code>library(rethinking)
  col &lt;- alist(
    courework_n ~ dnorm(mean,0.2),
    mean &lt;- a + b*result_n + c,
    a ~ dnorm(0,10),
    b ~ dnorm(0,10),
    c ~ dnorm(0,10)
  )
  colmap &lt;- map( col , data.frame(data) )
  </code></pre>
  
  <p>But when I use a package for triangular distribution which is not supported directly by R, I get the following error </p>
  
  <blockquote>
    <p><strong>Error in map(col, data.frame(data)) : unused argument (log = TRUE)</strong></p>
  </blockquote>
  
  <p>This is the code for defining the model with the triangle distribution</p>
  
  <pre><code>install.packages("RTriangle") 
  library(triangle)
  
  col &lt;- alist(
    courework_n ~ dtriangle(0,1,mode),
    moda &lt;- a + b*result_n + c,
    a ~ dnorm(0,10),
    b ~ dnorm(0,10),
    c ~ dnorm(0,10)
  )
  
  col_map &lt;- map( col , data.frame(data) )
  </code></pre>