Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lookup

Look up the Stan function that corresponds to a R function or name.


Description

This function helps to map between R functions and Stan functions.

Usage

lookup(FUN, ReturnType = character())

Arguments

FUN

A character string naming a R function or a R function for which the (near) equivalent Stan function is sought. If no matching R function is found, FUN is reinterpreted as a regexp and matches are sought.

ReturnType

A character string of positive length naming a valid return type for a Stan function: int, int[], matrix, real, real[,], real[], row_vector, T[], vector, or void. If "ANY" is passed, then the entire data.frame is returned and can be inspected with the View function, for example.

Value

Ordinarily, a data.frame with rows equal to the number of partial matches and four columns:

  1. StanFunction Character string for the Stan function's name.

  2. Arguments Character string indicating the arguments to that Stan function.

  3. ReturnType Character string indicating the return type of that Stan function.

  4. Page Integer indicating the page of the Stan reference manual where that Stan function is defined.

If there are no matching Stan functions, a character string indicating so is returned.

References

The Stan Development Team Stan Modeling Language User's Guide and Reference Manual. http://mc-stan.org/.

The Stan Development Team CmdStan Interface User's Guide. http://mc-stan.org.

Examples

lookup(dnorm)      # Stan equivalents for the normal PDF (in log form)
lookup("foo")      # fails
lookup("Student")  # succeeds even though there is no such R function
lookup("^poisson") # every Stan function that starts with poisson

rstan

R Interface to Stan

v2.21.2
GPL (>= 3)
Authors
Jiqiang Guo [aut], Jonah Gabry [aut], Ben Goodrich [cre, aut], Sebastian Weber [aut], Daniel Lee [ctb], Krzysztof Sakrejda [ctb], Modrak Martin [ctb], Trustees of Columbia University [cph], Oleg Sklyar [cph] (R/cxxfunplus.R), The R Core Team [cph] (R/pairs.R, R/dynGet.R), Jens Oehlschlaegel-Akiyoshi [cph] (R/pairs.R), John Maddock [cph] (gamma.hpp), Paul Bristow [cph] (gamma.hpp), Nikhar Agrawal [cph] (gamma.hpp), Christopher Kormanyos [cph] (gamma.hpp), Bronder Steve [ctb]
Initial release
2020-07-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.