# Rstan::expose\_stan\_functions inside a package?

**URL:** <https://discourse.mc-stan.org/t/rstan-expose-stan-functions-inside-a-package/7360>\
**Category:** General\
**Created:** [January 21, 2019, 3:33pm UTC](https://discourse.mc-stan.org/t/rstan-expose-stan-functions-inside-a-package/7360 "2019-01-21T15:33:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [January 21, 2019, 4:31pm UTC](https://discourse.mc-stan.org/t/rstan-expose-stan-functions-inside-a-package/7360/2 "2019-01-21T16:31:02Z")

</div>

> [@Saving the dso from expose\_stan\_functions](https://discourse.mc-stan.org/t/saving-the-dso-from-expose-stan-functions/705/4):
>
> Thank you guys for pointing me in this direction. This rcpp.cache.dir is a life-saver. A few notes for anyone who finds this: If you want to avoid recompilation every time you load the exposed stan functions, you have to follow these steps: set the rcpp.cache.dir option as described avove Use the stanc\_builder function with the (default) obfuscate\_model\_name=FALSE setting in order to ensure that the same c++ code is generated each time pass the result from stanc\_builder into expose\_stan\_funct…

---

_[View the full topic](https://discourse.mc-stan.org/t/rstan-expose-stan-functions-inside-a-package/7360)._
