davidr@rhotrading.com
2004-Nov-08 21:47 UTC
[R] can one evaluate an expression in a comment? (or insert results into history?)
I'd like to insert (for example) the current datetime into a comment so it goes into the history. I can of course cut and paste the results of date() into a comment line, but it would be easier and more powerful to be able to type something like> hstamp()and have it go into the history. More generally, I would like to put any expression to be evaluated into this function. For example,> hstamp(memory.size(TRUE))would insert a comment like # 12279808 after the hstamp command into the history. Probably one should avoid any expressions with assignment effects or large amounts of output. Maybe I'm thinking about this all wrong, so please enlighten me if so. I searched all the help and archives as well as I could. --------------> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status Patched major 2 minor 0.0 year 2004 month 10 day 18 language R Thanks! David L. Reiner Rho Trading 440 S. LaSalle St -- Suite 620 Chicago IL 60605 312-362-4963 (voice) 312-362-4941 (fax) [[alternative HTML version deleted]]
partha_bagchi@hgsi.com
2004-Nov-08 22:07 UTC
[R] can one evaluate an expression in a comment? (or insert results into history?)
Have you perchance looked at ?paste For example:> paste("The current time is ", date())[1] "The current time is Mon Nov 08 17:06:25 2004"><davidr at rhotrading.com> Sent by: r-help-bounces at stat.math.ethz.ch 11/08/2004 04:47 PM To: <r-help at stat.math.ethz.ch> cc: Subject: [R] can one evaluate an expression in a comment? (or insert results into history?) I'd like to insert (for example) the current datetime into a comment so it goes into the history. I can of course cut and paste the results of date() into a comment line, but it would be easier and more powerful to be able to type something like> hstamp()and have it go into the history. More generally, I would like to put any expression to be evaluated into this function. For example,> hstamp(memory.size(TRUE))would insert a comment like # 12279808 after the hstamp command into the history. Probably one should avoid any expressions with assignment effects or large amounts of output. Maybe I'm thinking about this all wrong, so please enlighten me if so. I searched all the help and archives as well as I could. --------------> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status Patched major 2 minor 0.0 year 2004 month 10 day 18 language R Thanks! David L. Reiner Rho Trading 440 S. LaSalle St -- Suite 620 Chicago IL 60605 312-362-4963 (voice) 312-362-4941 (fax) [[alternative HTML version deleted]] ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html