Skip to content
Prev 49155 / 63424 Next

Is this an incorrect use of the R-API?

Hi Utkarsh

 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

 invisible(addTaskCallback(function(...) { 
                             options(prompt = format(Sys.time(), "[%H:%M:%S] >"))
                             TRUE
                           }))

  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!). 

   D.
On 10/12/14, 8:13 AM, Utkarsh Upadhyay wrote: