[Rd] Is this an incorrect use of the R-API?
Duncan Temple Lang
dtemplelang at ucdavis.edu
Sun Oct 12 21:45:24 CEST 2014
If the package is an experiment and exploration, great - good for you
getting into this level of detail.
However, if your goal is to get the dynamic prompt, a simpler mechanism
that is almost equivalent is the R code
options(prompt = format(Sys.time(), "[%H:%M:%S] >"))
The only difference is that when you hit return at the prompt with no expression,
the prompt doesn't change (since there was no task).
As for incorrectly using the API - yes. Since R CMD check is telling you this is a
problem, it is officially a problem. This is of no consequence if the package works for you and any
users of it, and the package is not to be hosted on CRAN. However, using this symbol in your code may not
work on all platforms, and is not guaranteed to work in the future (but probably will!).
On 10/12/14, 8:13 AM, Utkarsh Upadhyay wrote:
> I am trying to create a small extension for R here for embedding the
> current time on the R prompt: https://github.com/musically-ut/extPrompt
> Things seem to be working overall, but `R CMD check .` raised a warning:
>> File '[truncated]..Rcheck/extPrompt/libs/extPrompt.so’:
>> Found non-API call to R: ‘ptr_R_ReadConsole’
>> Compiled code should not call non-API entry points in R.
> The concerned file is this:
> https://github.com/musically-ut/extPrompt/blob/master/src/extPrompt.c and
> occurs on line 38, I think .
> I am trying to make the R_ReadConsole API call. However, since a different
> plugin (like mine) could have overridden it already, I do not want to
> directly invoke `R_ReadConsole` but the function which previously was at
> Is this an incorrect use of the API?
> Best Regards,
> Utkarsh Upadhyay
> : I am impressed at how well the static code analysis works for R CMD
> [[alternative HTML version deleted]]
> R-devel at r-project.org mailing list
More information about the R-devel