Re: [R] slide show with R

From: Greg Snow <>
Date: Wed 30 Mar 2005 - 08:18:18 EST

Another approach is to put your commands below into a text file.

Add a line like:

tmp <- readline('Press Enter to Continue:')

everywhere you want to pause.

Then do:

source('path/to/text/file', echo=T)

it will print out the commands and execute them, but everytime it gets to the tmp <- ... line it will pause and wait for you to press enter before continuing on. you can discuss the lines that have just been executed and the current plot, then press enter for the next chunk.

hope this helps,

Greg Snow, Ph.D.
Statistical Data Center
(801) 408-8111

>>> <> 03/29/05 01:54PM >>>

Trying to use R to build an interactive "slide show", to be displayed on a
projector. The purpose of the presentation is to show how one could construct a simple graph using R. It is meant as a general overview rather
than as detailed instruction.

For example, something like the following sequence of commands. At lecture time, I want the interpreter to read these commands one at a time
from a file, display and execute the command, (or two or three commands)
and then wait for another prompt.

plot(c(0,2*pi),c(-1,1),type="n",ylab="",yaxt="n") mirror<-function(t) { c(t,rev(2*max(t)-t)) } z<-log(1:1000)/log(1000)



Wrapping the following around each command works, sort of :


However, this doesn't work properly for the function definition, and it
gets very clumsy to display two or three lines as a block and then evaluate.

Any help would be much appreciated.


George Heine, PhD
Mathematical Analyst
National IRM Center
U.S. Bureau of Land Management
voice (303) 236-0099

fax       (303) 236-1974
cell      (303) 905-5382

<>=<>=<>=<>=<>=<>=<>=<>=<>=<>=<> mailing list PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Wed Mar 30 08:27:54 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:57 EST