Learn R Programming

TeachingDemos (version 2.13)

TeachingDemos-package: Various functions for demonstration and learning.

Description

This package provides various demonstrations that can be used in classes or by individuals to better learn statistical concepts and usage of R. Various utility functions are also included

Arguments

Author

Greg Snow 538280@gmail.com

Details

Package:TeachingDemos
Type:Package
License:Artistic-2.0

Demonstration functions in this package include:

ci.examp, run.ci.exampConfidence Interval Examples
clt.exampCentral Limit Theorem Example
dice, plot.diceRoll and Plot dice (possibly loaded)
faces, faces2Chernoff face plots
fagan.plotFagan plot for screening designs
lattice.demoThe 3d slicing idea behind lattice/trellis graphics
loess.demoInteractive demo to show ideas of loess smooths
mle.demoInteractive demo of Maximum Likelihood Estimation
plot.rgl.coin, plot.rgl.dieAnimate flipping a coin or rolling a die
power.exampDemonstrate concepts of Power.
put.points.demoAdd/move points on a plot and see the effect on correlation and regression.
roc.demoInteractive demo of ROC curves.
rotate.cloudInteractively rotate 3d plots.
run.cor.exampShow plots representing different correlations.
run.hist.demoInteractively change parameters for histograms.
SensSpec.demoShow relationship between Sensitivity, Specificity, Prevalence and PPV and NPV.
TkApproxInteractive linear interpolations of data.
tkBrushBrush points in a scatterplot matrix.
TkSplineInteractive spline interpolations of data.
tree.demoInteractively Recursive partition data (create trees).
vis.binomPlot various probability distributions and interactively change parameters.
vis.boxcoxInteractively change lambda for Box Cox Transforms.
z.testZ-test similar to t.test for students who have not learned t tests yet.
Pvalue.norm.sim
Pvalue.binom.simSimulate P-values to see how they are distributed.
run.Pvalue.norm.simGUI for above.
run.Pvalue.binom.sim
HWidentify
HTKidentifyIdentify the point Hovered over with the mouse.
vis.testtest a null hypothesis by comparing graphs.

Utility functions include:

bctBox-Cox Transforms.
char2seedset or create the random number seed using a character string
clipplotclip a plot to a rectangular region within the plot
col2greyconvert colors to greyscale
cnvrt.coordsConvert between the different coordinate systems
dynIdentifyScatterplot with point labels that can be dragged to a new position
TkIdentifyScatterplot with lables that can be dragged to new positions
gp.plot gp.splotsend commands to gnuplot
hpdHighest Posterior Density intervals
my.symbolsCreate plots using user defined symbols.
panel.my.symbolsCreate lattice plots using user defined symbols.
plot2scriptCreate a script file that recreates the current plot.
shadowtextplot text with contrasting shadow for better readability.
squishplotSet the margins so that a plot has a specific aspect ratio without large white space inside.
spread.labsSpread out coordinates so that labels do not overlap.
subplotcreate a plot inside of an existing plot.
tkexampcreate plots that can have parameters adjusted interactively.
triplotTrilinear plot for 3 proportions.
txtStart/etxtStart/wdtxtStartSave commands and output to a text file (possibly for post processing with enscript).
zoomplotrecreate the current plot with different x/y limits (zoom in out).

See Also

The tkrplot package

Examples

Run this code
ci.examp()

clt.examp()
clt.examp(5)

plot.dice( expand.grid(1:6,1:6), layout=c(6,6) )

faces(rbind(1:3,5:3,3:5,5:7))

plot(1:10, 1:10)
my.symbols( 1:10, 1:10, ms.polygram, n=1:10, inches=0.3 )

x <- seq(1,100)
y <- rnorm(100)
plot(x,y, type='b', col='blue')
clipplot( lines(x,y, type='b', col='red'), ylim=c(par('usr')[3],0))

power.examp()
power.examp(n=25)
power.examp(alpha=0.1)


Run the code above in your browser using DataLab