Statistical Cartoons rpanel: simple interactive controls for R - - PowerPoint PPT Presentation

statistical cartoons rpanel simple interactive controls
SMART_READER_LITE
LIVE PREVIEW

Statistical Cartoons rpanel: simple interactive controls for R - - PowerPoint PPT Presentation

Statistical Cartoons rpanel: simple interactive controls for R functions using the tcltk package Ewan Crawford, Adrian Bowman Department of Statistics , The University of Glasgow, UK Elementary example Code for example library(rpanel)


slide-1
SLIDE 1

Statistical Cartoons rpanel: simple interactive controls for R functions using the tcltk package

Ewan Crawford, Adrian Bowman Department of Statistics, The University of Glasgow, UK

slide-2
SLIDE 2

Elementary example

slide-3
SLIDE 3

Code for example library(rpanel) x11(width=4,height=4) qq.draw <- function(panel) { z <- bc.fn(panel$y, panel$lambda) qqnorm(z, main = paste("lambda =", round(panel$lambda, 2))) panel } panel <- rp.control(y = exp(rnorm(50)), lambda = 1) rp.slider(panel, lambda, -2, 2, qq.draw, showvalue = TRUE)

slide-4
SLIDE 4

Second elementary example

slide-5
SLIDE 5

Second elementary example

slide-6
SLIDE 6

Relationship with wider gui packages Relationship with wider ("widgety") gui packages

  • Rgtk2
  • gWidgets
  • playwith
  • rwxwidgets
  • JGR
  • rtcltk

...

slide-7
SLIDE 7

Indication of tools available What we offer in terms of widgets

  • panel/window
  • button (with repeat)
  • slider/scrollbar
  • radiogroup
  • textentry (or multiples)
  • checkbox (or multiples)
  • listbox
  • doublebutton
  • image
  • line
  • messagebox
  • tkrplot

...

slide-8
SLIDE 8

Gulls

slide-9
SLIDE 9

Spatial examples: Geosim

slide-10
SLIDE 10

Spatial examples: Mururoa

slide-11
SLIDE 11

Spatial examples: Rosyth

slide-12
SLIDE 12

Current developments Current developments

  • multi-line text box
  • combo box
  • pos/grid
  • tabbed notebook
  • fonts
  • slider group

...

  • essentially all BWidgets and TkTable
  • More Cartoons
slide-13
SLIDE 13

Web site www.stats.gla.ac.uk/~adrian/rpanel ewan@stats.gla.ac.uk adrian@stats.gla.ac.uk

slide-14
SLIDE 14
slide-15
SLIDE 15

What

  • what i’ll talk about, widgets and their uses
  • cartoons explanation
slide-16
SLIDE 16

Why

  • applications
  • rationale (teach dept etc etc)
  • xlispstat etc
slide-17
SLIDE 17

soa2 Big heading: RGtk2 Sub heading: GTK+ Project page: http://www.gtk.org An example of what can be done with GTK+, The GIMP Illustrated by image

slide-18
SLIDE 18
slide-19
SLIDE 19

soa2 Sub heading: RGtk2 Project page: http://www.ggobi.org/rgtk2/ Example of what can be done with Rgtk2, demo Illustrated by image

slide-20
SLIDE 20
slide-21
SLIDE 21

soa2 ** Third slide: (May not all fit on the one slide, see my about omitting the code below) Big heading: Gwidgets Project page: http://wiener.math.csi.cuny.edu/pmg/gWidgets Illustrated by images

slide-22
SLIDE 22
slide-23
SLIDE 23

Gwidgets code example (for the slider image) Adrian - if you see fit, do not include this code. It may including out of fairness as gwidgets is the only easy alternative using rpanel library(gWidgets)

slide-24
SLIDE 24
  • ptions("guiToolkit"="RGtk2")

require(lattice) dataSet = faithful$eruptions w = gwindow("Slider example") g = gpanedgroup(cont=w) g1 = ggroup(horizontal = FALSE, cont = g) # first is left gg = ggraphics(cont = g) # second is sl <- gslider(1, length(dataSet), by = 1, cont=g1, handler function(h,...) { print(histogram(dataSet, nint = svalue(h$obj))) svalue(sb) <- svalue(h$obj) }) sb <- gspinbutton(1, length(dataSet), by = 1, cont=g1, handler function(h,...) { print(histogram(dataSet, nint = svalue(h$obj)))

slide-25
SLIDE 25

svalue(sl) <- svalue(h$obj) }) l = glabel("adjust number of bins", cont=g1) histogram(dataSet) # start it off

slide-26
SLIDE 26

soa2 ** Slide Four Big heading: rwxwidgets Project page: http://www.omegahat.org/RwxWidgets/ Illustrate rwxwidgets image:

slide-27
SLIDE 27

** Slide Five Big heading: JGR Project page: http://rosuda.org/JGR/ Illustrations:

slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30

** Slide Five ** Slide Six rtcltk Pages: http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/ Illustative image: rtcltk_editbox2.jpg

slide-31
SLIDE 31

soa

  • ---as per lanc --- - get images -

+ new -> Playwith

slide-32
SLIDE 32

method

  • who did what
  • adrian b, simon urbanek, gavin, richard b
  • tcl/tk and internals
  • list of controls/widgets/facilities (but not exhaustive?)
slide-33
SLIDE 33

examples

  • preview of examples - click to run - check what runs
slide-34
SLIDE 34

examples

  • preview of examples - click to run - check what runs
slide-35
SLIDE 35

examples

  • tables(panel)
slide-36
SLIDE 36

examples

  • normal fitting
slide-37
SLIDE 37

examples

  • preview of examples - click to run - check what runs
slide-38
SLIDE 38

examples

  • regression 1d
slide-39
SLIDE 39

examples

  • cosine regression
slide-40
SLIDE 40

examples

  • density est 1d
slide-41
SLIDE 41

examples

  • gulls
slide-42
SLIDE 42

examples

  • clyde map
slide-43
SLIDE 43

examples

  • spatial sim
slide-44
SLIDE 44

examples

  • mururoa
slide-45
SLIDE 45

examples

  • rosyth
slide-46
SLIDE 46

code *** As per Adrian’s build up? *** panel <- rp.control("Clyde data", do = DO, days = Days) panel <- rp.slider(panel, day.adj, 0, 364, action = days.plot) panel <- rp.checkbox(panel, model.showing, model.fn, title = "Show model") Behind the scenes . . . panel <- action(panel)

slide-47
SLIDE 47

reaction

  • discuss with AB
  • applications
slide-48
SLIDE 48

discussion

  • my comments, pros, cons
  • future plans
  • pos, grid, notebook, combo ...
slide-49
SLIDE 49

Web site www.stats.gla.ac.uk/~adrian/rpanel