[R] Returning .Call / / .External results invisibly

Andrew Simmons @kw@|mmo @end|ng |rom gm@||@com
Sun Aug 15 21:47:25 CEST 2021


Hello,


I have a C function in which I want to return a result visibly or invisibly
(depends on the arguments provided). My current implementation was to
return a list like 'withVisible' does, where element "value" is the value
the function returns, and element "visible" is TRUE or FALSE depending on
whether the result is returned visibly or not. Something like:

{
    value <- .External(C_fun, ...)
    if (value$visible)
        value$value
    else invisible(value$value)
}

Is there a way to do this in C instead? Thank you!

	[[alternative HTML version deleted]]



More information about the R-help mailing list