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("diamonds-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('diamonds') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "diamond.base" > > ### * diamond.base > > flush(stderr()); flush(stdout()) > > ### Name: diamond.base > ### Title: Create a base diamond > ### Aliases: diamond.base > ### Keywords: dplot > > ### ** Examples > > base <- diamond.base () > > diamond.plot (diamond.edges (base, 1)) > lines (diamond.edges (base, 4)) > > # kites for levels 2-4 > diamond.plot (diamond.edges (base, 1)) > lines (diamond.edges (base, 4), lwd=1, col="blue") > lines (diamond.triedges (base, 4), lwd=1, col="blue") > lines (diamond.dualedges (base, 4), lwd=1, col="blue") > lines (diamond.edges (base, 3), lwd=2, col="green") > lines (diamond.triedges (base, 3), lwd=2, col="green") > lines (diamond.dualedges (base, 3), lwd=2, col="green") > lines (diamond.edges (base, 2), lwd=3, col="red") > lines (diamond.triedges (base, 2), lwd=3, col="red") > lines (diamond.dualedges (base, 2), lwd=3, col="red") > lines (diamond.edges (base, 1), lwd=2, col="black") > title ("'Kites' for Levels 2-4", line=0) > > > > cleanEx(); ..nameEx <- "diamond.centers" > > ### * diamond.centers > > flush(stderr()); flush(stdout()) > > ### Name: diamond.centers > ### Title: Coordinates of centers of diamonds > ### Aliases: diamond.centers > ### Keywords: dplot > > ### ** Examples > > base <- diamond.base () > diamond.plot (diamond.edges (base, 1)) > points (diamond.centers (base, 4), pch=19, col="red") > lines (diamond.edges (base, 1), lwd=2, col="black") > title ("Diamond Centers at Level 4", line=0) > > > > cleanEx(); ..nameEx <- "diamond.dualcents" > > ### * diamond.dualcents > > flush(stderr()); flush(stdout()) > > ### Name: diamond.dualcents > ### Title: Coordinates of centers of hexagons > ### Aliases: diamond.dualcents > ### Keywords: dplot > > ### ** Examples > > base <- diamond.base () > diamond.plot (diamond.edges (base, 1)) > lines (diamond.dualedges (base, 4), col="blue") > points (diamond.dualcents (base, 4), pch=19, col="red") > lines (diamond.edges (base, 1), lwd=2, col="black") > title ("Centers of Dual Hexagons at Level 4", line=0) > > > > cleanEx(); ..nameEx <- "diamond.dualedges" > > ### * diamond.dualedges > > flush(stderr()); flush(stdout()) > > ### Name: diamond.dualedges > ### Title: Coordinates of edges of hexagons > ### Aliases: diamond.dualedges > ### Keywords: dplot > > ### ** Examples > > base <- diamond.base () > diamond.plot (diamond.edges (base, 1)) > lines (diamond.dualedges (base, 4), col="blue") > lines (diamond.edges (base, 1), lwd=2, col="black") > title ("Dual Hexagons at Level 4", line=0) > > > > cleanEx(); ..nameEx <- "diamond.edges" > > ### * diamond.edges > > flush(stderr()); flush(stdout()) > > ### Name: diamond.edges > ### Title: Coordinates of edges of diamonds > ### Aliases: diamond.edges > ### Keywords: dplot > > ### ** Examples > > base <- diamond.base () > diamond.plot (diamond.edges (base, 1)) > lines (diamond.edges (base, 4)) > lines (diamond.edges (base, 1), lwd=2) > title ("Diamond Partition at Level 4", line=0) > > > > cleanEx(); ..nameEx <- "diamond.hierwalk" > > ### * diamond.hierwalk > > flush(stderr()); flush(stdout()) > > ### Name: diamond.hierwalk > ### Title: Coordinates of hierarchical walk > ### Aliases: diamond.hierwalk > ### Keywords: dplot > > ### ** Examples > > base <- diamond.base () > diamond.plot (diamond.edges (base, 1)) > points (diamond.centers (base, 4), pch=19, col="red") > lines (diamond.hierwalk (base, 4), lwd=1, col="blue") > lines (diamond.edges (base, 1), lwd=2, col="black") > title ("Hierarchical Walk at Level 4", line=0) > > > > cleanEx(); ..nameEx <- "diamond.labels" > > ### * diamond.labels > > flush(stderr()); flush(stdout()) > > ### Name: diamond.labels > ### Title: Labels for a diamond partition > ### Aliases: diamond.labels > ### Keywords: dplot > > ### ** Examples > > base <- diamond.base () > diamond.plot (diamond.edges (base, 1)) > lines (diamond.edges (base, 4), lwd=1, col="blue") > lines (diamond.edges (base, 1), lwd=2, col="black") > text (diamond.centers (base, 4), diamond.labels (4)) > title ("Morton/Peano Numbers at Level 4", line=0) > > > > cleanEx(); ..nameEx <- "diamond.plot" > > ### * diamond.plot > > flush(stderr()); flush(stdout()) > > ### Name: diamond.plot > ### Title: Define a fixed aspect ratio plot > ### Aliases: diamond.plot > ### Keywords: hplot > > ### ** Examples > > base <- diamond.base () > diamond.plot (diamond.edges (base, 1)) > lines (diamond.edges (base, 4)) > lines (diamond.edges (base, 1), lwd=2) > title ("Diamond Partition at Level 4", line=0) > > > cleanEx(); ..nameEx <- "diamond.randlabels" > > ### * diamond.randlabels > > flush(stderr()); flush(stdout()) > > ### Name: diamond.randlabels > ### Title: Labels for a hierarchically randomized partition > ### Aliases: diamond.randlabels > ### Keywords: dplot > > ### ** Examples > > diamond.randlabels (2) [1] "1" "3" "2" "0" > > > > cleanEx(); ..nameEx <- "diamond.randpts" > > ### * diamond.randpts > > flush(stderr()); flush(stdout()) > > ### Name: diamond.randpts > ### Title: Coordinates of random points > ### Aliases: diamond.randpts > ### Keywords: dplot > > ### ** Examples > > base <- diamond.base () > diamond.plot (diamond.edges (base, 1)) > lines (diamond.edges (base, 4), lwd=1, col="blue") > lines (diamond.edges (base, 1), lwd=2, col="black") > points (diamond.randpts (base, 4), pch=19, col="red") > title ("Random Points at Level 4", line=0) > > > > cleanEx(); ..nameEx <- "diamond.randwalk" > > ### * diamond.randwalk > > flush(stderr()); flush(stdout()) > > ### Name: diamond.randwalk > ### Title: Coordinates of hierarchical random walk > ### Aliases: diamond.randwalk > ### Keywords: dplot > > ### ** Examples > > base <- diamond.base () > diamond.plot (diamond.edges (base, 1)) > points (diamond.centers (base, 4), pch=19, col="red") > lines (diamond.randwalk (base, 4), lwd=1, col="blue") > lines (diamond.edges (base, 1), lwd=2, col="black") > title ("Hierarchical Random Walk at Level 4", line=0) > > > > cleanEx(); ..nameEx <- "diamond.triedges" > > ### * diamond.triedges > > flush(stderr()); flush(stdout()) > > ### Name: diamond.triedges > ### Title: Coordinates of edges of triangles > ### Aliases: diamond.triedges > ### Keywords: dplot > > ### ** Examples > > base <- diamond.base () > diamond.plot (diamond.edges (base, 1)) > lines (diamond.edges (base, 4)) > lines (diamond.triedges (base, 4)) > title ("Triangles at Level 4", line=0) > > > > ### *