While I'm on a (posting) roll, here is one more useful function, one that I'm a little embarrassed about discovering only now. It's debug() function in R. You tag you favorite function, foo(), with debug(foo). The next time foo() is executed, either by itself or is called from another function, debug executes foo() line by line, and provides an interactive prompt at each step so you can check values of the variables at the current evaluation, plot things, define things, or do whatever else you want. There are some built-in commands to be used at the prompt (if you can't think of something better):
n - advance to the nextstep
c - continue to the end of the current context: e.g. to the end of the loop if within a loop or to the end of the function
Q - quit debugging
In the end you can run undebug() to stop tracking the function.
For more, see here:
- ► 2014 (19)
- ► 2013 (23)
- ► 2012 (20)
- ► 2011 (41)
- debug() in R
- Taste of Chicago (off-topic)
- fancyvrb package in LaTeX
- Stata: stset and missing values
- BBQ on Friday 7/30 after work (date changed again!...
- R: spaghetti plot using ggplot2 package
- R: Spaghetti Plots for growth curves using lattice...
- SAS: Spaghetti Plots for growth curves using SAS v...
- UPDATE: how to embed pdf or ppt in the blog or web...
- Mathematica: Clearing values for typeset variables...
- how to embed pdf or ppt in the blog or webpage
- Stata 11.1
- lme4: Mixed-eﬀects modeling with R
- you might want to try -xtmixed- instead
- lmer for SAS PROC MIXED Users
- ▼ June (16)