[R-gregmisc-commits] r2062 - in pkg: SASxport SASxport/R SASxport/tests exp.ssize/inst/Presentation fork gdata gdata/tests gmodels gmodels/tests gplots gplots/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jul 22 02:48:52 CEST 2015


Author: warnes
Date: 2015-07-22 02:48:51 +0200 (Wed, 22 Jul 2015)
New Revision: 2062

Added:
   pkg/gmodels/tests/
   pkg/gplots/R/layout_set.R
Removed:
   pkg/gmodels/test/
Modified:
   pkg/SASxport/NAMESPACE
   pkg/SASxport/R/SASiformat.R
   pkg/SASxport/tests/datetime.xpt
   pkg/SASxport/tests/dfAttributes.R
   pkg/exp.ssize/inst/Presentation/Warnes-SampleSize-Omics.ppt
   pkg/fork/DESCRIPTION
   pkg/gdata/DESCRIPTION
   pkg/gdata/NAMESPACE
   pkg/gdata/tests/test.humanReadable.Rout.save
   pkg/gdata/tests/test.read.xls.R
   pkg/gdata/tests/test.read.xls.Rout.save
   pkg/gdata/tests/test.reorder.factor.Rout.save
   pkg/gdata/tests/tests.write.fwf.Rout.save
   pkg/gmodels/tests/lme-test.R
   pkg/gplots/DESCRIPTION
   pkg/gplots/R/heatmap.2.R
Log:
Renamed 'test' directory to 'tests', commented out tests for lme4 which has a changed API

Modified: pkg/SASxport/NAMESPACE
===================================================================
--- pkg/SASxport/NAMESPACE	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/SASxport/NAMESPACE	2015-07-22 00:48:51 UTC (rev 2062)
@@ -34,15 +34,25 @@
 S3method(toSAS, default)
 
 ## S3method(label, default)
-S3method(SASformat, default)
+S3method(SASformat,  default)
 S3method(SASiformat, default)
-S3method(SAStype, default)
+S3method(SAStype,    default)
 
+## S3method(label,   data.frame)
+S3method(SASformat,  data.frame)
+S3method(SASiformat, data.frame)
+S3method(SAStype,    data.frame)
+
 ## S3method("label<-", default)
-S3method("SASformat<-", default)
+S3method("SASformat<-",  default)
 S3method("SASiformat<-", default)
-S3method("SAStype<-", default)
+S3method("SAStype<-",    default)
 
+## S3method("label<-", data.frame)
+S3method("SASformat<-",  data.frame)
+S3method("SASiformat<-", data.frame)
+S3method("SAStype<-",    data.frame)
+
 S3method(print, lookup.xport)
 S3method(summary, lookup.xport)
 S3method(print, summary.lookup.xport)

Modified: pkg/SASxport/R/SASiformat.R
===================================================================
--- pkg/SASxport/R/SASiformat.R	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/SASxport/R/SASiformat.R	2015-07-22 00:48:51 UTC (rev 2062)
@@ -10,6 +10,14 @@
   lab
 }
 
+
+SASiformat.data.frame <- function(x, default=NULL)
+{
+  sapply( x, SASiformat)
+}
+
+
+
 "SASiformat<-" <- function(x, value)
   UseMethod("SASiformat<-")
 
@@ -18,3 +26,13 @@
   attr(x,'SASiformat') <- value
   x
 }
+
+"SASiformat<-.data.frame" <- function(x, value)
+{
+  if( ncol(x) != length(value) )
+    stop("vector of iformats must match number of data frame columns")
+
+  for(i in 1:ncol(x))
+    attr(x[[i]],'SASiformat') <- value[i]
+  x
+}

Modified: pkg/SASxport/tests/datetime.xpt
===================================================================
(Binary files differ)

Modified: pkg/SASxport/tests/dfAttributes.R
===================================================================
--- pkg/SASxport/tests/dfAttributes.R	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/SASxport/tests/dfAttributes.R	2015-07-22 00:48:51 UTC (rev 2062)
@@ -9,7 +9,8 @@
 SAStype(abc.out) <- "normal"
 
 ## add a format specifier (not used by R)
-SASformat(abc.out$x) <- 'date7.'
+SASformat(abc.out$x)  <- 'DATE7.'
+SASiformat(abc.out$x) <- 'DATE7.'
 
 ## add a variable label (not used by R)
 label(abc.out$y)  <- 'character variable'
@@ -25,20 +26,30 @@
 
 # read the SAS data back in
 abc.in <- read.xport("dfAttributes.xpt",
-                     names.tolower=FALSE,
+                     names.tolower=TRUE,
                      verbose=TRUE)
 
 ## Test that the files are otherwise identical
 label(abc.out, self=TRUE, "MISSING!")
 label(abc.in , self=TRUE, "MISSING!")
 
+stopifnot( label(abc.out, self=TRUE, "MISSING!") ==
+           label(abc.in, self=TRUE, "MISSING!")
+          )
+
 SAStype(abc.out, "MISSING!")
 SAStype(abc.in , "MISSING!")
 
-stopifnot( label  (abc.out, self=TRUE, "MISSING!") ==
-           label  (abc.in,  self=TRUE, "MISSING!") )
-
 stopifnot( SAStype(abc.out, "MISSING!") ==
            SAStype(abc.in,  "MISSING!") )
 
+SASformat(abc.out)
+SASformat(abc.in)
 
+stopifnot( unlist(SASformat(abc.out)) == unlist(SASformat(abc.in))  )
+
+SASiformat(abc.out)
+SASiformat(abc.in)
+
+stopifnot( unlist(SASiformat(abc.out)) == unlist(SASiformat(abc.in))  )
+

Modified: pkg/exp.ssize/inst/Presentation/Warnes-SampleSize-Omics.ppt
===================================================================
(Binary files differ)

Modified: pkg/fork/DESCRIPTION
===================================================================
--- pkg/fork/DESCRIPTION	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/fork/DESCRIPTION	2015-07-22 00:48:51 UTC (rev 2062)
@@ -11,3 +11,5 @@
     processes.
 Maintainer: Gregory R. Warnes <greg at warnes.net>
 License: GPL-2
+URL: https://r-forge.r-project.org/projects/r-gregmisc/
+BugReports: https://r-forge.r-project.org/tracker/?func=browse&group_id=2031&atid=5378

Modified: pkg/gdata/DESCRIPTION
===================================================================
--- pkg/gdata/DESCRIPTION	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/gdata/DESCRIPTION	2015-07-22 00:48:51 UTC (rev 2062)
@@ -22,7 +22,7 @@
      scalar and vector arguments ('resample').
 Depends: R (>= 2.3.0)
 SystemRequirements: perl (>= 5.10.0)
-Imports: gtools
+Imports: gtools, stats, methods, utils
 Version: 2.17.0
 Date: 2015-07-02
 Author: Gregory R. Warnes, Ben Bolker, Gregor Gorjanc, Gabor

Modified: pkg/gdata/NAMESPACE
===================================================================
--- pkg/gdata/NAMESPACE	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/gdata/NAMESPACE	2015-07-22 00:48:51 UTC (rev 2062)
@@ -66,6 +66,8 @@
 importFrom(stats, reorder)
 importFrom(stats, nobs)
 importFrom(gtools, mixedsort)
+importFrom(methods, is)
+importFrom(utils, data, download.file, head, read.csv, read.delim, read.table, tail, write.table)
 
 S3method(reorder, factor)
 
@@ -161,3 +163,5 @@
 S3method(left,  matrix)
 S3method(right, data.frame)
 S3method(right, matrix)
+
+

Modified: pkg/gdata/tests/test.humanReadable.Rout.save
===================================================================
--- pkg/gdata/tests/test.humanReadable.Rout.save	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/gdata/tests/test.humanReadable.Rout.save	2015-07-22 00:48:51 UTC (rev 2062)
@@ -235,4 +235,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.414   0.050   0.461 
+  0.421   0.052   0.464 

Modified: pkg/gdata/tests/test.read.xls.R
===================================================================
--- pkg/gdata/tests/test.read.xls.R	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/gdata/tests/test.read.xls.R	2015-07-22 00:48:51 UTC (rev 2062)
@@ -29,26 +29,27 @@
 # see the number and names of sheets:
 sheetCount(exampleFile)
 
-if( 'XLSX' %in% xlsFormats() )
+if(! 'XLSX' %in% xlsFormats() )
   {
+    cat("************************************************************\n")
+    cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
+    cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
+    cat("************************************************************\n")
+  } else {
     sheetCount(exampleFileX)
-  } else {
-      cat("************************************************************\n")
-      cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
-      cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
-      cat("************************************************************\n")
   }
 
+
 sheetNames(exampleFile)
 
-if( 'XLSX' %in% xlsFormats() )
+if(! 'XLSX' %in% xlsFormats() )
   {
+    cat("************************************************************\n")
+    cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
+    cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
+    cat("************************************************************\n")
+  } else {
     sheetNames(exampleFileX)
-  } else {
-      cat("************************************************************\n")
-      cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
-      cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
-      cat("************************************************************\n")
   }
 
 
@@ -64,8 +65,13 @@
 example.4 <- read.xls(exampleFile, sheet=4, header=FALSE) # fourth worksheet by number
 example.4
 
-if( 'XLSX' %in% xlsFormats() )
+if(! 'XLSX' %in% xlsFormats() )
   {
+    cat("************************************************************\n")
+    cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
+    cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
+    cat("************************************************************\n")
+  } else {
     example.x.1 <- read.xls(exampleFileX, sheet=1) # default is first worksheet
     print(example.x.1)
 
@@ -84,9 +90,6 @@
     # load the third worksheet, skipping the first two non-data lines...
     data <- read.xls(exampleFileX, sheet="Sheet with initial text", skip=2)
     print(data)
-  } else {
-    cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
-    cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED **\n")
   }
 
 ## Check handling of skip.blank.lines=FALSE
@@ -94,18 +97,19 @@
 example.skip <- read.xls(exampleFile, sheet=2, blank.lines.skip=FALSE)
 example.skip
 
-if( 'XLSX' %in% xlsFormats() )
+if(! 'XLSX' %in% xlsFormats() )
   {
+    cat("************************************************************\n")
+    cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
+    cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
+    cat("************************************************************\n")
+  } else {
     example.x.skip <- read.xls(exampleFileX, sheet=2, blank.lines.skip=FALSE)
     example.x.skip
-  } else {
-      cat("************************************************************\n")
-      cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
-      cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
-      cat("************************************************************\n")
   }
 
 
+
 ## Check handing of fileEncoding for latin-1 characters
 
 latin1File  <- file.path(path.package('gdata'),'xls', 'latin-1.xls' )
@@ -124,8 +128,13 @@
                                  stringsAsFactors=FALSE)
   }
 
-if( 'XLSX' %in% xlsFormats() )
+if(! 'XLSX' %in% xlsFormats() )
   {
+    cat("************************************************************\n")
+    cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
+    cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
+    cat("************************************************************\n")
+  } else {
       if(.Platform$OS.type=="unix")
           {
               example.latin1.x <- read.xls(latin1FileX,
@@ -138,12 +147,7 @@
                                          encoding='latin1',
                                          stringsAsFactors=FALSE)
           }
-  } else {
-    cat("************************************************************\n")
-    cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
-    cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
-    cat("************************************************************\n")
-}
+  }
 
 
 ## Check handling of very wide file
@@ -154,13 +158,15 @@
 example.wide <- read.xls(wideFile)
 stopifnot(dim(example.wide)==c(0,256))
 
-if( 'XLSX' %in% xlsFormats() )
+if( !'XLSX' %in% xlsFormats() )
   {
-     example.wide.x <- read.xls(wideFileX)
-     stopifnot(dim(example.wide.x)==c(0,16384))
+    cat("************************************************************\n")
+    cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
+    cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
+    cat("************************************************************\n")
   } else {
-    cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
-    cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED **\n")
+    example.wide.x <- read.xls(wideFileX)
+    stopifnot(dim(example.wide.x)==c(0,16384))
   }
 
 ## Check handling of files with dates calulcated relative to

Modified: pkg/gdata/tests/test.read.xls.Rout.save
===================================================================
--- pkg/gdata/tests/test.read.xls.Rout.save	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/gdata/tests/test.read.xls.Rout.save	2015-07-22 00:48:51 UTC (rev 2062)
@@ -514,29 +514,30 @@
 > sheetCount(exampleFile)
 [1] 4
 > 
-> if( 'XLSX' %in% xlsFormats() )
+> if(! 'XLSX' %in% xlsFormats() )
 +   {
++     cat("************************************************************\n")
++     cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
++     cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
++     cat("************************************************************\n")
++   } else {
 +     sheetCount(exampleFileX)
-+   } else {
-+       cat("************************************************************\n")
-+       cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
-+       cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
-+       cat("************************************************************\n")
 +   }
 [1] 4
 > 
+> 
 > sheetNames(exampleFile)
 [1] "Sheet First"                  "Sheet Second"                
 [3] "Sheet with a very long name!" "Sheet with initial text"     
 > 
-> if( 'XLSX' %in% xlsFormats() )
+> if(! 'XLSX' %in% xlsFormats() )
 +   {
++     cat("************************************************************\n")
++     cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
++     cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
++     cat("************************************************************\n")
++   } else {
 +     sheetNames(exampleFileX)
-+   } else {
-+       cat("************************************************************\n")
-+       cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
-+       cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
-+       cat("************************************************************\n")
 +   }
 [1] "Sheet First"                  "Sheet Second"                
 [3] "Sheet with a very long name!" "Sheet with initial text"     
@@ -605,8 +606,13 @@
 6       ThirdRow  3    2    1 <NA>    Red
 7      FourthRow  4    3    2    1  Black
 > 
-> if( 'XLSX' %in% xlsFormats() )
+> if(! 'XLSX' %in% xlsFormats() )
 +   {
++     cat("************************************************************\n")
++     cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
++     cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
++     cat("************************************************************\n")
++   } else {
 +     example.x.1 <- read.xls(exampleFileX, sheet=1) # default is first worksheet
 +     print(example.x.1)
 + 
@@ -625,9 +631,6 @@
 +     # load the third worksheet, skipping the first two non-data lines...
 +     data <- read.xls(exampleFileX, sheet="Sheet with initial text", skip=2)
 +     print(data)
-+   } else {
-+     cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
-+     cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED **\n")
 +   }
   A  B   C
 1 1  1   1
@@ -702,15 +705,15 @@
 4  ThirdRow  3  2  1 NA    Red
 5 FourthRow  4  3  2  1  Black
 > 
-> if( 'XLSX' %in% xlsFormats() )
+> if(! 'XLSX' %in% xlsFormats() )
 +   {
++     cat("************************************************************\n")
++     cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
++     cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
++     cat("************************************************************\n")
++   } else {
 +     example.x.skip <- read.xls(exampleFileX, sheet=2, blank.lines.skip=FALSE)
 +     example.x.skip
-+   } else {
-+       cat("************************************************************\n")
-+       cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
-+       cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
-+       cat("************************************************************\n")
 +   }
           X  D E.  F  G Factor
 1  FirstRow  1 NA NA NA    Red
@@ -720,6 +723,7 @@
 5 FourthRow  4  3  2  1  Black
 > 
 > 
+> 
 > ## Check handing of fileEncoding for latin-1 characters
 > 
 > latin1File  <- file.path(path.package('gdata'),'xls', 'latin-1.xls' )
@@ -738,8 +742,13 @@
 +                                  stringsAsFactors=FALSE)
 +   }
 > 
-> if( 'XLSX' %in% xlsFormats() )
+> if(! 'XLSX' %in% xlsFormats() )
 +   {
++     cat("************************************************************\n")
++     cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
++     cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
++     cat("************************************************************\n")
++   } else {
 +       if(.Platform$OS.type=="unix")
 +           {
 +               example.latin1.x <- read.xls(latin1FileX,
@@ -752,12 +761,7 @@
 +                                          encoding='latin1',
 +                                          stringsAsFactors=FALSE)
 +           }
-+   } else {
-+     cat("************************************************************\n")
-+     cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
-+     cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
-+     cat("************************************************************\n")
-+ }
++   }
 > 
 > 
 > ## Check handling of very wide file
@@ -768,13 +772,15 @@
 > example.wide <- read.xls(wideFile)
 > stopifnot(dim(example.wide)==c(0,256))
 > 
-> if( 'XLSX' %in% xlsFormats() )
+> if( !'XLSX' %in% xlsFormats() )
 +   {
-+      example.wide.x <- read.xls(wideFileX)
-+      stopifnot(dim(example.wide.x)==c(0,16384))
++     cat("************************************************************\n")
++     cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
++     cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED                  **\n")
++     cat("************************************************************\n")
 +   } else {
-+     cat("** DIFF IN THIS SECTION IS EXPECTED BECAUSE PERL PACKAGES **\n")
-+     cat("** FOR SUPPORTING XLSX ARE NOT INSTALLED **\n")
++     example.wide.x <- read.xls(wideFileX)
++     stopifnot(dim(example.wide.x)==c(0,16384))
 +   }
 > 
 > ## Check handling of files with dates calulcated relative to
@@ -898,4 +904,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 14.560   0.980  15.861 
+ 13.495   0.834  14.549 

Modified: pkg/gdata/tests/test.reorder.factor.Rout.save
===================================================================
--- pkg/gdata/tests/test.reorder.factor.Rout.save	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/gdata/tests/test.reorder.factor.Rout.save	2015-07-22 00:48:51 UTC (rev 2062)
@@ -53,4 +53,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.411   0.059   0.489 
+  0.341   0.046   0.381 

Modified: pkg/gdata/tests/tests.write.fwf.Rout.save
===================================================================
--- pkg/gdata/tests/tests.write.fwf.Rout.save	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/gdata/tests/tests.write.fwf.Rout.save	2015-07-22 00:48:51 UTC (rev 2062)
@@ -231,4 +231,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  0.517   0.054   0.583 
+  0.426   0.048   0.462 

Modified: pkg/gmodels/tests/lme-test.R
===================================================================
--- pkg/gmodels/test/lme-test.R	2015-06-29 22:40:22 UTC (rev 2055)
+++ pkg/gmodels/tests/lme-test.R	2015-07-22 00:48:51 UTC (rev 2062)
@@ -1,76 +1,76 @@
-library(gmodels)
-library(lme4)
-set.seed(314159)
+## library(gmodels)
+## library(lme4)
+## set.seed(314159)
 
-sleepstudy$dayGroup <- cut(sleepstudy$Days, seq(-1,9,by=2), include=T)
+## sleepstudy$dayGroup <- cut(sleepstudy$Days, seq(-1,9,by=2), include=T)
 
-# ci example
-fm2 <- lmer(Reaction ~ dayGroup + (1|Subject) + (0+Days|Subject), sleepstudy)
-ci(fm2)
+## # ci example
+## fm2 <- lmer(Reaction ~ dayGroup + (1|Subject) + (0+Days|Subject), sleepstudy)
+## ci(fm2)
 
 
-# estimable examples
-estimable(fm2, c( 0, -1, 1, 0,  0 )  ) # list all terms
-estimable(fm2, c("dayGroup(1,3]"=-1, "dayGroup(3,5]"=1)) # just the nonzero terms
-estimable(fm2, c("dayGroup(1,3]"=-1, "dayGroup(3,5]"=1), n.sim=5000 ) # more simulations...
+## # estimable examples
+## estimable(fm2, c( 0, -1, 1, 0,  0 )  ) # list all terms
+## estimable(fm2, c("dayGroup(1,3]"=-1, "dayGroup(3,5]"=1)) # just the nonzero terms
+## estimable(fm2, c("dayGroup(1,3]"=-1, "dayGroup(3,5]"=1), n.sim=5000 ) # more simulations...
 
 
-# fit.contrast example
-fit.contrast( fm2, "dayGroup",
-              rbind("0-1 vs 3-4"=c(-1,0,1,0,0),
-                    "3-4 vs 5-6"=c(0,0,-1,1,0)
-                  ),
-            conf=0.95 )
+## # fit.contrast example
+## fit.contrast( fm2, "dayGroup",
+##               rbind("0-1 vs 3-4"=c(-1,0,1,0,0),
+##                     "3-4 vs 5-6"=c(0,0,-1,1,0)
+##                   ),
+##             conf=0.95 )
 
-# Example from Ariel.Muldoon at oregonstate.edu
-homerange=c(
-        "male","1","fall","0.1",
-	"male","1","winter","0.3",
-	"male","1","spring","5.2",
-	"male","1","summer","3.1",
-	"male","2","fall","3.4",
-	"male","2","winter","1.3",
-	"male","2","spring","4.8",
-	"male","2","summer","4.3",
-	"male","3","fall","3.9",
-	"male","3","winter","3.8",
-	"male","3","spring","5.7",
-	"male","3","summer","2.0",
-	"male","4","fall","3.7",
-	"male","4","winter","4.3",
-	"male","4","spring","6.0",
-	"male","4","summer","1.8",
-	"female","5","fall","4.3",
-	"female","5","winter","1.9",
-	"female","5","spring","7.2",
-	"female","5","summer","6.9",
-	"female","6","fall","5.3",
-	"female","6","winter","4.3",
-	"female","6","spring","6.2",
-	"female","6","summer","4.8",
-	"female","7","fall","7.1",
-	"female","7","winter","4.9",
-	"female","7","spring","8.3",
-	"female","7","summer","7.7"
-	)
- 
-homerange <- data.frame(matrix(homerange,ncol=4, byrow=T))
-names(homerange) <- c("sex", "animal", "season", "area")
-homerange$area = as.numeric(as.character(homerange$area))
+## # Example from Ariel.Muldoon at oregonstate.edu
+## homerange=c(
+##         "male","1","fall","0.1",
+## 	"male","1","winter","0.3",
+## 	"male","1","spring","5.2",
+## 	"male","1","summer","3.1",
+## 	"male","2","fall","3.4",
+## 	"male","2","winter","1.3",
+## 	"male","2","spring","4.8",
+## 	"male","2","summer","4.3",
+## 	"male","3","fall","3.9",
+## 	"male","3","winter","3.8",
+## 	"male","3","spring","5.7",
+## 	"male","3","summer","2.0",
+## 	"male","4","fall","3.7",
+## 	"male","4","winter","4.3",
+## 	"male","4","spring","6.0",
+## 	"male","4","summer","1.8",
+## 	"female","5","fall","4.3",
+## 	"female","5","winter","1.9",
+## 	"female","5","spring","7.2",
+## 	"female","5","summer","6.9",
+## 	"female","6","fall","5.3",
+## 	"female","6","winter","4.3",
+## 	"female","6","spring","6.2",
+## 	"female","6","summer","4.8",
+## 	"female","7","fall","7.1",
+## 	"female","7","winter","4.9",
+## 	"female","7","spring","8.3",
+## 	"female","7","summer","7.7"
+## 	)
 
-fit1 <- lmer(area ~ sex*season + (1|animal), data=homerange)
-summary(fit1)
-anova(fit1)
- 
+## homerange <- data.frame(matrix(homerange,ncol=4, byrow=T))
+## names(homerange) <- c("sex", "animal", "season", "area")
+## homerange$area = as.numeric(as.character(homerange$area))
 
-#matrix to give estimable for making estimates
+## fit1 <- lmer(area ~ sex*season + (1|animal), data=homerange)
+## summary(fit1)
+## anova(fit1)
 
-spr <- rbind(c(1,0,1,0,0,0,0,0),
-             c(1,1,0,0,0,1,0,0),
-             c(1,0,0,1,0,0,0,0),
-             c(1,1,0,0,0,0,1,0),
-             c(1,0,0,0,1,0,0,0),
-             c(1,1,0,0,0,0,0,1))
 
- 
-estimable(fit1, spr)
+## #matrix to give estimable for making estimates
+
+## spr <- rbind(c(1,0,1,0,0,0,0,0),
+##              c(1,1,0,0,0,1,0,0),
+##              c(1,0,0,1,0,0,0,0),
+##              c(1,1,0,0,0,0,1,0),
+##              c(1,0,0,0,1,0,0,0),
+##              c(1,1,0,0,0,0,0,1))
+
+
+## estimable(fit1, spr)

Modified: pkg/gplots/DESCRIPTION
===================================================================
--- pkg/gplots/DESCRIPTION	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/gplots/DESCRIPTION	2015-07-22 00:48:51 UTC (rev 2062)
@@ -1,7 +1,7 @@
 Package: gplots
 Title: Various R Programming Tools for Plotting Data
 Description: Various R programming tools for plotting data, including:
-  - calculating and plotting locally smoothed summary functionas
+  - calculating and plotting locally smoothed summary functionals
     ('bandplot', 'wapply'),
   - enhanced versions of standard plots ('barplot2', 'boxplot2',
     'heatmap.2', 'smartlegend'),
@@ -14,11 +14,11 @@
   - displaying textual data in plots ('textplot', 'sinkplot'),
   - plotting a matrix where each cell contains a dot whose size
     reflects the relative magnitude of the elements ('balloonplot'),
-  - plotting venn diagrams ('venn'),
-  - displaying Open-Office syle plots ('ooplot'),
-  - plotting multiple datasets on same region, with separate axes
+  - plotting Venn diagrams ('venn'),
+  - displaying Open-Office style plots ('ooplot'),
+  - plotting multiple data sets on same region, with separate axes
     ('overplot'),
-  - plotting means and cofidence intervals ('plotCI', 'plotmeans'),
+  - plotting means and confidence intervals ('plotCI', 'plotmeans'),
   - spacing points in an x-y plot so they don't overlap ('space').
 Depends: R (>= 3.0)
 Imports: gtools, gdata, stats, caTools, KernSmooth

Modified: pkg/gplots/R/heatmap.2.R
===================================================================
--- pkg/gplots/R/heatmap.2.R	2015-07-20 23:38:07 UTC (rev 2061)
+++ pkg/gplots/R/heatmap.2.R	2015-07-22 00:48:51 UTC (rev 2062)
@@ -107,6 +107,9 @@
   if(length(col)==1 && is.character(col) )
     col <- get(col, mode="function")
 
+  if(!missing(breaks) && any(duplicated(breaks)) )
+      stop("breaks may not contian duplicate values")
+
   if(!missing(breaks) && (scale!="none"))
     warning("Using scale=\"row\" or scale=\"column\" when breaks are",
             "specified can produce unpredictable results.",
@@ -384,14 +387,18 @@
   on.exit(par(op))
   layout(lmat, widths = lwid, heights = lhei, respect = FALSE)
 
+  plot.index <- 1
+
   ## draw the side bars
   if(!missing(RowSideColors)) {
     par(mar = c(margins[1],0, 0,0.5))
     image(rbind(1:nr), col = RowSideColors[rowInd], axes = FALSE)
+    plot.index <- plot.index + 1
   }
   if(!missing(ColSideColors)) {
     par(mar = c(0.5,0, 0,margins[2]))
     image(cbind(1:nc), col = ColSideColors[colInd], axes = FALSE)
+    plot.index <- plot.index + 1
   }
   ## draw the main carpet
   par(mar = c(margins[1], 0, 0, margins[2]))
@@ -576,6 +583,13 @@
          col=notecol,
          cex=notecex)
 
+  plot.index <- plot.index + 1
+
+  ## increment plot.index and then do
+  ##   latout_set( lmat, plot.index )
+  ## to set to the correct plot region, instead of
+  ## relying on plot.new().
+
   ## the two dendrograms :
   par(mar = c(margins[1], 0, 0, 0))
   if( dendrogram %in% c("both","row") )
@@ -614,6 +628,7 @@
   if(!is.null(main)) title(main, cex.main = 1.5*op[["cex.main"]])
 
   ## Add the color-key
+  browser()
   if(key)
     {
       mar <- c(5, 4, 2, 1)
@@ -721,7 +736,6 @@
           if (is.null(key.title))
               title("Color Key")
 
-
       if(trace %in% c("both","column") )
           {
               vline.vals <- scale01(vline, min.raw, max.raw)

Added: pkg/gplots/R/layout_set.R
===================================================================
--- pkg/gplots/R/layout_set.R	                        (rev 0)
+++ pkg/gplots/R/layout_set.R	2015-07-22 00:48:51 UTC (rev 2062)
@@ -0,0 +1,13 @@
+layout_set <- function(mat, index)
+  {
+    mfg <- par("mfg")
+    mfg[1:2] = which(mat==index, arr.ind=TRUE)[1,]
+    par(mfg=mfg)
+    invisible(mfg)
+  }
+
+layout_show <- function(mat)
+  {
+    graphics::layout.show( max(mat) )
+    mat
+  }



More information about the R-gregmisc-commits mailing list