asFunctionPointer | R Documentation |
(This looks incomplete.)
This function is used to coerce a value to a reference to a
native routine.
We also have methods for coerce
to do this for strings and NativeSymbolInfo and NativeSymbol
objects.
However, this function is capable of doing more than simple
coercion but testing whether the object is compatible with
the native routine. That means we test the number of parameters
and their types.
asFunctionPointer(obj, numParams, paramTypes = NULL, test = TestFunctionPointers)
obj |
the object to be converted. |
numParams |
the number of parameters the routine will be passed |
paramTypes |
a list giving the types of the parameters. If the we have information about the C routine or about the types of the R function's parameters, we can check that these are compatible with the expected function pointer types. Note that we don't check the return type here! |
test |
a logical value which controls whether we test the number
and types of parameters for R functions passed as |
obj
, or an error is raised.
Duncan Temple Lang
coerce,character,RNativeRoutineReference-method
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.