Learn R Programming

SamplerCompare (version 1.3.4)

raw.symbol: Locate a symbol

Description

Call R_FindSymbol and return function pointer in a raw vector

Usage

raw.symbol(symbol)

Value

A raw vector containing a function pointer.

Arguments

symbol

a length one character vector containing a C symbol

Details

This function calls R_FindSymbol(symbol, "", NULL) in C. If the symbol is found, the function pointer is returned as a raw vector. If not, an error is thrown.

This is intended to be used to fill in context objects for samplers and distributions implemented in C. Exposing this interface in R prevents the need for extra C glue that does nothing except call R_FindSymbol.

See Also

wrap.c.sampler, make.c.dist, “R/C Glue in SamplerCompare” (vignette)