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("hwde-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('hwde') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "IndianIrish" > > ### * IndianIrish > > flush(stderr()); flush(stdout()) > > ### Name: IndianIrish > ### Title: Observed genotype frequencies at MN and S loci, for 2 > ### populations > ### Aliases: IndianIrish > ### Keywords: datasets > > ### ** Examples > > data(IndianIrish) > hwde(data=IndianIrish) [1] "Analysis of Deviance Table" Resid. Df Resid. Dev Df Deviance 1 17 1724.07 2 16 1090.41 1 633.66 3 14 486.72 2 603.69 4 12 480.31 2 6.41 5 11 463.76 1 16.55 6 10 218.42 1 245.34 7 8 217.15 2 1.28 8 6 37.94 2 179.21 9 4 35.46 2 2.48 10 3 26.29 1 9.16 11 2 5.94 1 20.36 12 0 -4.219e-15 2 5.94 > > > > cleanEx(); ..nameEx <- "MendelABC" > > ### * MendelABC > > flush(stderr()); flush(stdout()) > > ### Name: mendelABC > ### Title: Mendel's F2 trifactorial data for seed shape (A), cotyledon > ### color (B) and seed coat color (C) > ### Aliases: mendelABC > ### Keywords: datasets > > ### ** Examples > > data(mendelABC) > hwde(mendelABC, loci=c("seedshape","cotylcolor","coatcolor")) [1] "Analysis of Deviance Table" Resid. Df Resid. Dev Df Deviance 1 26 210.254 2 23 137.281 3 72.973 3 20 115.573 3 21.708 4 17 105.059 3 10.514 5 14 55.494 3 49.565 6 8 10.789 6 44.705 > > > > cleanEx(); ..nameEx <- "decode.genotypes" > > ### * decode.genotypes > > flush(stderr()); flush(stdout()) > > ### Name: decode.genotypes > ### Title: Creates contrasts that relate to a single locus > ### Aliases: decode.genotypes > ### Keywords: models > > ### ** Examples > > decode.genotypes(rep(c("AA","Aa","aa"),2)) $oset AA Aa aa AA Aa aa 1 2 1 1 2 1 $ma AA Aa aa AA Aa aa 2 1 0 2 1 0 $maa AA Aa aa AA Aa aa 1 0 0 1 0 0 $types [1] "AA" "Aa" "aa" > > > > cleanEx(); ..nameEx <- "hwde" > > ### * hwde > > flush(stderr()); flush(stdout()) > > ### Name: hwde > ### Title: Fit relevant models, and test for various types of departure > ### from Hardy-Weinberg equilibrium. Allows only 2 alleles per locus. The > ### number of loci is arbitrary. > ### Aliases: hwde > ### Keywords: models > > ### ** Examples > > data(IndianIrish) > hwde(data=IndianIrish) [1] "Analysis of Deviance Table" Resid. Df Resid. Dev Df Deviance 1 17 1724.07 2 16 1090.41 1 633.66 3 14 486.72 2 603.69 4 12 480.31 2 6.41 5 11 463.76 1 16.55 6 10 218.42 1 245.34 7 8 217.15 2 1.28 8 6 37.94 2 179.21 9 4 35.46 2 2.48 10 3 26.29 1 9.16 11 2 5.94 1 20.36 12 0 -4.219e-15 2 5.94 > data(mendelABC) > hwde(data=mendelABC, loci=c("seedshape", "cotylcolor", "coatcolor")) [1] "Analysis of Deviance Table" Resid. Df Resid. Dev Df Deviance 1 26 210.254 2 23 137.281 3 72.973 3 20 115.573 3 21.708 4 17 105.059 3 10.514 5 14 55.494 3 49.565 6 8 10.789 6 44.705 > > > > cleanEx(); ..nameEx <- "make.contrasts" > > ### * make.contrasts > > flush(stderr()); flush(stdout()) > > ### Name: make.contrasts > ### Title: Calculate contrasts required by the function > ### Aliases: make.contrasts > ### Keywords: models > > ### ** Examples > > make.contrasts(data=c("AA","Aa","aa")) $contrasts.df data oset a aa 1 AA 1 2 1 2 Aa 2 1 0 3 aa 1 0 0 $list.columns $list.columns$aterms [1] "a" $list.columns$aaterms [1] "aa" > > > > ### *