R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("Rcmdr-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('Rcmdr') Loading required package: tcltk Loading Tcl/Tk interface ... done Loading required package: rgl Loading required package: zoo Loading required package: strucchange Loading required package: sandwich Loading required package: relimp Loading required package: nnet Loading required package: nlme Loading required package: mvtnorm Loading required package: multcomp Loading required package: mgcv This is mgcv 1.3-1 Loading required package: MASS Loading required package: lmtest Loading required package: lattice Loading required package: grid Loading required package: foreign Loading required package: effects Loading required package: car Loading required package: abind Rcmdr Version 1.0-2 > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "Commander" > > ### * Commander > > flush(stderr()); flush(stdout()) > > ### Name: Commander > ### Title: R Commander > ### Aliases: Commander > ### Keywords: misc > > ### ** Examples > > options(Rcmdr=list(log.font.size=12, contrasts=c("contr.Sum", "contr.poly"))) > > > > cleanEx(); ..nameEx <- "Hist" > > ### * Hist > > flush(stderr()); flush(stdout()) > > ### Name: Hist > ### Title: Plot a Histogram > ### Aliases: Hist > ### Keywords: hplot > > ### ** Examples > > data(Prestige) > Hist(Prestige$income, scale="percent") > > > > cleanEx(); ..nameEx <- "KMeans" > > ### * KMeans > > flush(stderr()); flush(stdout()) > > ### Name: KMeans > ### Title: K-Means Clustering Using Multiple Random Seeds > ### Aliases: KMeans > ### Keywords: misc > > ### ** Examples > > data(USArrests) > KMeans(USArrests, centers=3, iter.max=5, num.seeds=5) K-means clustering with 3 clusters of sizes 14, 20, 16 Cluster means: Murder Assault UrbanPop Rape 1 8.214286 173.2857 70.64286 22.84286 2 4.270000 87.5500 59.75000 14.39000 3 11.812500 272.5625 68.31250 28.37500 Clustering vector: Alabama Alaska Arizona Arkansas California 3 3 3 1 3 Colorado Connecticut Delaware Florida Georgia 1 2 3 3 1 Hawaii Idaho Illinois Indiana Iowa 2 2 3 2 2 Kansas Kentucky Louisiana Maine Maryland 2 2 3 2 3 Massachusetts Michigan Minnesota Mississippi Missouri 1 3 2 3 1 Montana Nebraska Nevada New Hampshire New Jersey 2 2 3 2 1 New Mexico New York North Carolina North Dakota Ohio 3 3 3 2 2 Oklahoma Oregon Pennsylvania Rhode Island South Carolina 1 1 2 1 3 South Dakota Tennessee Texas Utah Vermont 2 1 1 2 2 Virginia Washington West Virginia Wisconsin Wyoming 1 1 2 2 1 Within cluster sum of squares by cluster: [1] 9136.643 19263.760 19563.863 Available components: [1] "cluster" "centers" "withinss" "size" "tot.withinss" [6] "betweenss" > > > > cleanEx(); ..nameEx <- "assignCluster" > > ### * assignCluster > > flush(stderr()); flush(stdout()) > > ### Name: assignCluster > ### Title: Append a Cluster Membership Variable to a Dataframe > ### Aliases: assignCluster > ### Keywords: misc > > ### ** Examples > > data(USArrests) > USArrkm3 <- KMeans(USArrests[USArrests$UrbanPop<66, ], centers=3) > assignCluster(USArrests[USArrests$UrbanPop<66, ], USArrests, USArrkm3$cluster) [1] 3 3 1 1 2 2 2 [16] 2 2 3 2 2 2 [31] 3 2 3 2 1 2 [46] 1 2 1 Levels: 1 2 3 > > > > cleanEx(); ..nameEx <- "bin.var" > > ### * bin.var > > flush(stderr()); flush(stdout()) > > ### Name: bin.var > ### Title: Bin a Numeric Varisible > ### Aliases: bin.var > ### Keywords: manip > > ### ** Examples > > summary(bin.var(rnorm(100), method="prop", labels=letters[1:4])) a b c d 25 25 25 25 > > > > cleanEx(); ..nameEx <- "partial.cor" > > ### * partial.cor > > flush(stderr()); flush(stdout()) > > ### Name: partial.cor > ### Title: Partial Correlations > ### Aliases: partial.cor > ### Keywords: misc > > ### ** Examples > > data(DavisThin) > partial.cor(DavisThin) DT1 DT2 DT3 DT4 DT5 DT6 DT1 0.00000000 0.0357340 0.14209261 0.14285942 0.01959653 0.03525015 DT2 0.03573400 0.0000000 0.18502957 0.13533799 0.20693471 0.40200133 DT3 0.14209261 0.1850296 0.00000000 0.16761250 0.28663322 0.07136172 DT4 0.14285942 0.1353380 0.16761250 0.00000000 0.04145664 0.14143893 DT5 0.01959653 0.2069347 0.28663322 0.04145664 0.00000000 0.20627942 DT6 0.03525015 0.4020013 0.07136172 0.14143893 0.20627942 0.00000000 DT7 0.03574554 -0.1564957 0.40138892 -0.07975909 0.13224306 0.33582129 DT7 DT1 0.03574554 DT2 -0.15649565 DT3 0.40138892 DT4 -0.07975909 DT5 0.13224306 DT6 0.33582129 DT7 0.00000000 > > > > cleanEx(); ..nameEx <- "reliability" > > ### * reliability > > flush(stderr()); flush(stdout()) > > ### Name: reliability > ### Title: Reliability of a Composite Scale > ### Aliases: reliability print.reliability > ### Keywords: misc > > ### ** Examples > > data(DavisThin) > reliability(cov(DavisThin)) Alpha reliability = 0.8919 Standardized alpha = 0.8888 Reliability deleting each item in turn: Alpha Std.Alpha r(item, total) DT1 0.8997 0.8991 0.4512 DT2 0.8720 0.8681 0.7267 DT3 0.8598 0.8566 0.8139 DT4 0.8902 0.8861 0.5698 DT5 0.8660 0.8630 0.7716 DT6 0.8601 0.8576 0.8117 DT7 0.8758 0.8728 0.6934 > > > > cleanEx(); ..nameEx <- "scatter3d" > > ### * scatter3d > > flush(stderr()); flush(stdout()) > > ### Name: scatter3d > ### Title: Three-Dimensional Scatterplots > ### Aliases: scatter3d > ### Keywords: hplot > > ### ** Examples > > ## Not run: > ##D data(state) > ##D State.x77 <- as.data.frame(state.x77) > ##D with(State.x77, scatter3d(Income, Murder, Illiteracy)) > ##D with(State.x77, scatter3d(Income, Murder, Illiteracy, fit=c("linear", "quadratic"))) > ##D > ## End(Not run) > > > > cleanEx(); ..nameEx <- "stem.leaf" > > ### * stem.leaf > > flush(stderr()); flush(stdout()) > > ### Name: stem.leaf > ### Title: Stem-and-Leaf Display > ### Aliases: stem.leaf print.stem.leaf > ### Keywords: misc > > ### ** Examples > > data(Prestige) > stem.leaf(Prestige$income) 1 | 2: represents 1200 leaf unit: 100 n: 102 2 0 | 69 4 1 | 68 9 2 | 34589 24 3 | 001114445667999 38 4 | 00123345666777 (14) 5 | 00111245567899 50 6 | 112344556899 38 7 | 01445789 30 8 | 000122344788888 15 9 | 25 13 10 | 4 12 11 | 003 9 12 | 34 13 | 7 14 | 015 HI: 17498 19263 25308 25879 > > > > ### *