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("edci-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('edci') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "circMclust" > > ### * circMclust > > flush(stderr()); flush(stdout()) > > ### Name: circMclust > ### Title: Circular Clustering > ### Aliases: circMclust plot.circMclust print.circMclust > ### Keywords: cluster regression robust > > ### ** Examples > > z <- (1:100 * pi)/50 > x <- c(sin(z) * 10 + 20,sin(z) * 30 + 80)+rnorm(200,0,2) > y <- c(cos(z) * 10 + 20,cos(z) * 30 + 80)+rnorm(200,0,2) > > circ <- circMclust(x,y,5,method="prob",prec=1,nsc=20,minsd=10,maxsd=40) Break with -C (linux) or (windows) Found clusters: 3 Found clusters: 3 > bestMclust(circ,2) cx cy r value count [1,] 20.1 20.6 10.4 37.44975 34 [2,] 80.1 80.6 30.0 37.27295 4 > plot(bestMclust(circ,2),x,y) > > > > cleanEx(); ..nameEx <- "edgecluster" > > ### * edgecluster > > flush(stderr()); flush(stdout()) > > ### Name: edgecluster > ### Title: Edge detection in noisy images > ### Aliases: edgecluster > ### Keywords: robust multivariate nonparametric > > ### ** Examples > > y <- matrix(rep(0,60*60),nrow=60) > y[21:40,21:40]<-1 > y <- y + matrix(rnorm(60*60,0,0.2),nrow=60) > image(y,col=gray(seq(0,1,1/255))) > > ec <- edgecluster(y,0.05,0.05,0.7, + estimator="M_median",kernel="gauss") row: 0/60 row: 1/60 row: 2/60 row: 3/60 row: 4/60 row: 5/60 row: 6/60 row: 7/60 row: 8/60 row: 9/60 row: 10/60 row: 11/60 row: 12/60 row: 13/60 row: 14/60 row: 15/60 row: 16/60 row: 17/60 row: 18/60 row: 19/60 row: 20/60 row: 21/60 row: 22/60 row: 23/60 row: 24/60 row: 25/60 row: 26/60 row: 27/60 row: 28/60 row: 29/60 row: 30/60 row: 31/60 row: 32/60 row: 33/60 row: 34/60 row: 35/60 row: 36/60 row: 37/60 row: 38/60 row: 39/60 row: 40/60 row: 41/60 row: 42/60 row: 43/60 row: 44/60 row: 45/60 row: 46/60 row: 47/60 row: 48/60 row: 49/60 row: 50/60 row: 51/60 row: 52/60 row: 53/60 row: 54/60 row: 55/60 row: 56/60 row: 57/60 row: 58/60 row: 59/60 Break with -C (linux) or (windows) starting point: 0/156 starting point: 100/156 > plot(bestMclust(ec[[1]],4),ec[[2]],xlim=c(0,1),ylim=c(0,1)) > > > > cleanEx(); ..nameEx <- "edgepoints" > > ### * edgepoints > > flush(stderr()); flush(stdout()) > > ### Name: edgepoints > ### Title: Edge detection in noisy images > ### Aliases: edgepoints > ### Keywords: robust multivariate nonparametric > > ### ** Examples > > y <- matrix(rep(0,60*60),nrow=60) > y[21:40,21:40]<-1 > y <- y + matrix(rnorm(60*60,0,0.2),nrow=60) > image(y,col=gray(seq(0,1,1/255))) > > ye <- edgepoints(y,0.05,0.05,estimator="M_median",kernel="gauss") row: 0/60 row: 1/60 row: 2/60 row: 3/60 row: 4/60 row: 5/60 row: 6/60 row: 7/60 row: 8/60 row: 9/60 row: 10/60 row: 11/60 row: 12/60 row: 13/60 row: 14/60 row: 15/60 row: 16/60 row: 17/60 row: 18/60 row: 19/60 row: 20/60 row: 21/60 row: 22/60 row: 23/60 row: 24/60 row: 25/60 row: 26/60 row: 27/60 row: 28/60 row: 29/60 row: 30/60 row: 31/60 row: 32/60 row: 33/60 row: 34/60 row: 35/60 row: 36/60 row: 37/60 row: 38/60 row: 39/60 row: 40/60 row: 41/60 row: 42/60 row: 43/60 row: 44/60 row: 45/60 row: 46/60 row: 47/60 row: 48/60 row: 49/60 row: 50/60 row: 51/60 row: 52/60 row: 53/60 row: 54/60 row: 55/60 row: 56/60 row: 57/60 row: 58/60 row: 59/60 > image(ye[[1]]>0.7,col=gray(c(1,0))) > > > > cleanEx(); ..nameEx <- "oregMclust" > > ### * oregMclust > > flush(stderr()); flush(stdout()) > > ### Name: oregMclust > ### Title: Orthogonal Regression Clustering > ### Aliases: oregMclust regparm plot.oregMclust print.oregMclust > ### Keywords: cluster regression robust > > ### ** Examples > > x <- c(rnorm(100,0,3),rnorm(100,5,3)) > y <- c(-2*x[1:100]-5,0.5*x[101:200]+30)/2 > x <- x + rnorm(200,0,0.5) > y <- y + rnorm(200,0,0.5) > > reg <- oregMclust(x,y,1,method="prob") Break with -C (linux) or (windows) Found clusters: 1 Found clusters: 1 > reg <- projMclust(reg,x,y) > reg alpha beta value 0 0 0 > plot(bestMclust(reg,2,crit="proj"),x,y) > > > > ### *