[R] Function call on every prompt

2010-11-19 Thread Barry Rowlingson
Someone on stackoverflow.com was wondering how to display the current time in the R prompt. I could have swore there was a mechanism for hooking a function into R such that it is was called before the prompt was given, but no amount of searching in R's docs, R's source, or RSiteSearch can find

Re: [R] Function call on every prompt

2010-11-19 Thread Marc Schwartz
On Nov 19, 2010, at 9:23 AM, Barry Rowlingson wrote: Someone on stackoverflow.com was wondering how to display the current time in the R prompt. I could have swore there was a mechanism for hooking a function into R such that it is was called before the prompt was given, but no amount of

Re: [R] Function call on every prompt

2010-11-19 Thread Duncan Murdoch
On 19/11/2010 10:31 AM, Marc Schwartz wrote: On Nov 19, 2010, at 9:23 AM, Barry Rowlingson wrote: Someone on stackoverflow.com was wondering how to display the current time in the R prompt. I could have swore there was a mechanism for hooking a function into R such that it is was called

Re: [R] Function call on every prompt

2010-11-19 Thread Marc Schwartz
On Nov 19, 2010, at 9:36 AM, Duncan Murdoch wrote: On 19/11/2010 10:31 AM, Marc Schwartz wrote: On Nov 19, 2010, at 9:23 AM, Barry Rowlingson wrote: Someone on stackoverflow.com was wondering how to display the current time in the R prompt. I could have swore there was a mechanism for

Re: [R] Function call on every prompt

2010-11-19 Thread Barry Rowlingson
On Fri, Nov 19, 2010 at 3:36 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: Barry was probably remembering SweaveHook. The key is the taskCallbackManager. Does exactly what it says on the tin. Doesn't come up with any of my search strings! Hopefully now this is in R-help it'll come up

Re: [R] Function call on every prompt

2010-11-19 Thread David Winsemius
On Nov 19, 2010, at 10:23 AM, Barry Rowlingson wrote: Someone on stackoverflow.com was wondering how to display the current time in the R prompt. I could have swore there was a mechanism for hooking a function into R such that it is was called before the prompt was given, but no amount of

Re: [R] Function call on every prompt

2010-11-19 Thread David Winsemius
On Nov 19, 2010, at 10:38 AM, Marc Schwartz wrote: What's wrong with: options(prompt = paste(format(Sys.time(), %a %b %d %X %Y %Z), )) Fri Nov 19 09:30:53 2010 CST Fri Nov 19 09:30:53 2010 CST Fri Nov 19 09:30:53 2010 CST That one doesn't get updated with every prompt. Duncan Murdoch