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("pheno-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('pheno') Loading required package: nlme Loading required package: SparseM [1] "SparseM library loaded" Loading required package: quantreg quantreg package loaded quantreg now includes the nlrq and nprq packages Loading required package: nprq nprq is a defunct package: functionality now folded into the package quantreg[1] "pheno library loaded" > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "connectedSets" > > ### * connectedSets > > flush(stderr()); flush(stdout()) > > ### Name: connectedSets > ### Title: Connected sets in a matrix > ### Aliases: connectedSets > ### Keywords: design models > > ### ** Examples > > data(Simple) > connectedSets(Simple) Warning in return(rowclasses, colclasses) : multi-argument returns are deprecated $rowclasses [1] 1 1 2 $colclasses [1] 1 1 2 2 > > > > cleanEx(); ..nameEx <- "daylength" > > ### * daylength > > flush(stderr()); flush(stdout()) > > ### Name: daylength > ### Title: Daylength at julian day i on latitude l > ### Aliases: daylength > ### Keywords: misc utilities > > ### ** Examples > > daylength(120,63) Warning in return(dl, delta) : multi-argument returns are deprecated $dl [1] 16.06945 $delta [1] 0.2532097 > > > > cleanEx(); ..nameEx <- "matrix2raw" > > ### * matrix2raw > > flush(stderr()); flush(stdout()) > > ### Name: matrix2raw > ### Title: Converts numeric matrix to data frame > ### Aliases: matrix2raw > ### Keywords: utilities misc > > ### ** Examples > > data(DWD) > M <- raw2matrix(DWD) # conversion to matrix > D1 <- matrix2raw(M) # back conversion, but with different level names > D2 <- matrix2raw(M,c(1951:1998),c(1:9)) # with original level names > > > > cleanEx(); ..nameEx <- "maxConnectedSet" > > ### * maxConnectedSet > > flush(stderr()); flush(stdout()) > > ### Name: maxConnectedSet > ### Title: Maximal connected set in a matrix > ### Aliases: maxConnectedSet > ### Keywords: design models > > ### ** Examples > > data(Searle) > maxConnectedSet(Searle) Warning in return(rowclasses, colclasses) : multi-argument returns are deprecated Warning in return(ms, maxl, nsets, lsets) : multi-argument returns are deprecated $ms [,1] [,2] [,3] [1,] 1 1 1 [2,] 1 1 1 $maxl [1] 6 $nsets [1] 3 $lsets [1] 4 4 6 > > > > cleanEx(); ..nameEx <- "maxdaylength" > > ### * maxdaylength > > flush(stderr()); flush(stdout()) > > ### Name: maxdaylength > ### Title: Maximal day length on latitude l > ### Aliases: maxdaylength > ### Keywords: misc utilities > > ### ** Examples > > maxdaylength(60) [1] 18.49363 > > > > cleanEx(); ..nameEx <- "pheno.ddm" > > ### * pheno.ddm > > flush(stderr()); flush(stdout()) > > ### Name: pheno.ddm > ### Title: Dense design matrix for phenological data > ### Aliases: pheno.ddm > ### Keywords: robust design models > > ### ** Examples > > data(DWD) > ddm1 <- pheno.ddm(DWD) Warning in return(ddm, D = D) : multi-argument returns are deprecated > attach(DWD) > y <- factor(DWD[[2]]) > s <- factor(DWD[[3]]) > ddm2 <- as.matrix.csr(model.matrix(~ y + s -1, contrasts=list(s=("contr.sum")))) > identical(ddm1$ddm,ddm2) [1] TRUE > > > > cleanEx(); ..nameEx <- "pheno.lad.fit" > > ### * pheno.lad.fit > > flush(stderr()); flush(stdout()) > > ### Name: pheno.lad.fit > ### Title: Fits a robust two-way linear model > ### Aliases: pheno.lad.fit > ### Keywords: design models ts > > ### ** Examples > > data(DWD) > R <- pheno.lad.fit(DWD) # robust parameter estimation Warning in rq.fit.br(x, y, tau = tau, ...) : Solution may be nonunique Warning in return(p1, p2, resid, ierr, D) : multi-argument returns are deprecated > plot(levels(factor(R$D[[2]])),R$p1,type="l") # plot combined time series > R$D[R$resid >= 30,] # observation whose residuals obs year stat 90 128 1959 4 91 138 1960 4 92 128 1961 4 174 141 1952 8 > # are > 30 days (outliers) > > > > cleanEx(); ..nameEx <- "pheno.mlm.fit" > > ### * pheno.mlm.fit > > flush(stderr()); flush(stdout()) > > ### Name: pheno.mlm.fit > ### Title: Fits a two-way linear mixed model > ### Aliases: pheno.mlm.fit > ### Keywords: design models ts > > ### ** Examples > > data(DWD) > R <- pheno.mlm.fit(DWD) # parameter estimation Warning in return(fixed, random, resid, SEf1, lclf, uclf) : multi-argument returns are deprecated > plot(levels(factor(DWD[[2]])),R$fixed,type="l") # plot combined time series > tr <- lm(R$fixed~rank(levels(factor(DWD[[2]])))) # trend estimation > summary(tr)$coef[2] # slope of trend rank(levels(factor(DWD[[2]]))) -0.1119791 > summary(tr)$coef[4] # standard error of trend 0.07716334 > > > > cleanEx(); ..nameEx <- "raw2matrix" > > ### * raw2matrix > > flush(stderr()); flush(stdout()) > > ### Name: raw2matrix > ### Title: Converts a numeric data frame to matrix > ### Aliases: raw2matrix > ### Keywords: utilities misc > > ### ** Examples > > data(DWD) > raw2matrix(DWD) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 117 114 0 122 118 0 0 0 0 [2,] 102 121 0 107 103 0 0 141 0 [3,] 94 0 0 97 120 0 0 0 0 [4,] 104 113 0 0 129 0 0 0 0 [5,] 108 124 0 126 122 0 0 115 0 [6,] 110 116 0 127 134 0 0 156 0 [7,] 85 0 0 118 100 0 0 97 0 [8,] 113 122 119 126 128 0 0 138 0 [9,] 87 94 96 128 97 0 0 0 0 [10,] 93 0 93 138 110 0 0 103 0 [11,] 0 110 86 128 102 0 0 96 0 [12,] 118 130 0 121 115 0 0 115 0 [13,] 0 0 112 115 121 0 0 111 129 [14,] 117 0 106 112 115 0 0 110 109 [15,] 122 128 105 110 118 0 0 108 96 [16,] 116 117 110 112 113 0 0 108 109 [17,] 122 115 108 111 113 0 0 111 105 [18,] 108 110 108 0 113 0 0 108 0 [19,] 117 118 122 0 120 0 0 119 113 [20,] 117 122 122 114 127 0 0 124 115 [21,] 105 111 106 0 114 0 0 112 104 [22,] 95 109 95 86 101 0 0 117 90 [23,] 107 118 115 100 123 0 0 117 115 [24,] 92 0 93 85 102 0 0 110 93 [25,] 117 0 114 113 108 0 0 100 114 [26,] 99 0 104 108 106 0 0 118 122 [27,] 130 0 107 98 103 0 0 115 106 [28,] 117 0 105 107 112 0 0 115 115 [29,] 128 0 117 111 0 0 0 121 112 [30,] 120 0 108 116 0 0 0 126 102 [31,] 117 0 100 94 0 0 0 96 94 [32,] 118 0 111 103 0 0 0 114 0 [33,] 116 0 115 110 0 0 0 115 0 [34,] 0 0 113 118 0 0 0 124 0 [35,] 0 0 113 115 0 0 0 122 0 [36,] 0 0 125 123 0 0 0 124 0 [37,] 0 0 117 119 0 114 0 117 0 [38,] 0 0 111 112 0 108 113 131 0 [39,] 0 0 102 91 0 92 98 106 0 [40,] 0 0 92 97 0 83 106 106 0 [41,] 0 0 107 121 0 105 0 103 0 [42,] 0 0 0 113 0 105 103 116 0 [43,] 0 0 0 112 0 102 106 112 0 [44,] 0 0 0 107 0 98 107 112 0 [45,] 0 0 0 112 0 106 106 112 0 [46,] 0 0 0 115 0 112 0 115 0 [47,] 0 0 0 89 0 96 0 109 0 [48,] 0 0 0 110 0 99 0 108 0 > > > > ### *