

REPLESENTR: PRESENTATIONS INSIDE THE R REPL


author: Sebastian Warnholz
date: 2019-11-25
email: wahani@gmail.com



FEATURES


-   Tools to do presentations inside the R REPL
-   Take advantage of RMarkdown and pandoc
-   Evaluate code on slides
-   Integrate data visualisations using the fantastic ‘txtplot’ package

//empty

-   Wish-list:
    -   Syntax highlighting on slides
    -   Colours on slides
    -   Satisfying set of formats for slides
    -   Number of slide in lower right corner



COMMANDS IN PRESENTATION MODE


-   n – next slide
-   p – previous slide
-   f – first slide
-   l – last slide
-   e – evaluate code
-   ee – evaluate code until here
-   cc – recompile slide deck
-   q – quit presentation
-   h – show this help



EVALUATION OF CODE


Try this now by typing ‘e’

//code

    hi <- "Hi\n"
    cat(hi)



SLIDE FORMATS


-   //center
    -   needs to be at the beginning of a line
    -   in the title it defines the slide layout
-   //code
    -   put this right in front of a code block
    -   will make this code block available for evaluation
-   //empty
    -   for empty lines



SLIDE FORMATS EXAMPLES


//center type ‘e’ to see the source of this slide

//empty

//code

    .fileName <- system.file("Introduction.Rmd", package = "REPLesentR")
    .allSlide <- readLines(.fileName)
    .thisSlidePosition <- grep("^# slide formats examples", .allSlide, TRUE)
    .thisSlide <- .allSlide[.thisSlidePosition:(.thisSlidePosition + 14)]
    for (row in .thisSlide) cat(row, "\n")



//CENTER MAKE GREAT PLOTS WITH ‘TXTPLOT’!


        +-----+-----------+----------+-----------+-----------+-+
        |                                               *   *  |
     10 +                                                 *    +
        |                                        *             |
      5 +                                     *  *             +
        |                                 *     *              |
        |                           *  *                       |
      0 +                  *     * *  **                       +
        |               *                                      |
     -5 +                *                                     +
        |                                                      |
        |                                                      |
    -10 + *                                                    +
        +-----+-----------+----------+-----------+-----------+-+
             -2          -1          0           1           2  



START FROM AN EXAMPLE


You can find the source of this presentation by typing ‘e’:

//code

    print(system.file("Introduction.Rmd", package = "REPLesentR"))



//CENTER INSPIRATION FOR THIS PACKAGE COMES FROM:


//center https://github.com/marconilanna/REPLesent



//CENTER THE END!
