From noreply at r-forge.r-project.org Fri Aug 12 19:10:44 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 12 Aug 2016 19:10:44 +0200 (CEST) Subject: [R-gregmisc-commits] r2129 - pkg/SASxport Message-ID: <20160812171044.11A721868F7@r-forge.r-project.org> Author: warnes Date: 2016-08-12 19:10:43 +0200 (Fri, 12 Aug 2016) New Revision: 2129 Modified: pkg/SASxport/DESCRIPTION pkg/SASxport/NAMESPACE Log: Commit linkgering changes. Modified: pkg/SASxport/DESCRIPTION =================================================================== --- pkg/SASxport/DESCRIPTION 2016-05-31 17:03:33 UTC (rev 2128) +++ pkg/SASxport/DESCRIPTION 2016-08-12 17:10:43 UTC (rev 2129) @@ -3,8 +3,8 @@ Title: Read and Write SAS XPORT Files Version: 1.5.4 Date: 2016-03-25 -Description: This package provides functions for reading, listing - the contents of, and writing SAS xport format files. +Description: Functions for reading, listing + the contents of, and writing SAS xport format files. The functions support reading and writing of either individual data frames or sets of data frames. Further, a mechanism has been provided for customizing how Modified: pkg/SASxport/NAMESPACE =================================================================== --- pkg/SASxport/NAMESPACE 2016-05-31 17:03:33 UTC (rev 2128) +++ pkg/SASxport/NAMESPACE 2016-08-12 17:10:43 UTC (rev 2129) @@ -3,6 +3,7 @@ importFrom(chron, chron, times) importFrom(utils, packageDescription) importFrom(Hmisc, label, label.default, "label<-", "label<-.default") +importFrom(utils, download.file) export( toSAS, From noreply at r-forge.r-project.org Fri Aug 12 19:11:58 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 12 Aug 2016 19:11:58 +0200 (CEST) Subject: [R-gregmisc-commits] r2130 - pkg/gdata Message-ID: <20160812171158.880561868F7@r-forge.r-project.org> Author: warnes Date: 2016-08-12 19:11:58 +0200 (Fri, 12 Aug 2016) New Revision: 2130 Modified: pkg/gdata/NAMESPACE Log: Add mv to exported namespace Modified: pkg/gdata/NAMESPACE =================================================================== --- pkg/gdata/NAMESPACE 2016-08-12 17:10:43 UTC (rev 2129) +++ pkg/gdata/NAMESPACE 2016-08-12 17:11:58 UTC (rev 2130) @@ -30,6 +30,7 @@ matchcols, nobs, # default method now provided by stats package nPairs, + mv, read.xls, rename.vars, remove.vars, From noreply at r-forge.r-project.org Fri Aug 12 19:15:40 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 12 Aug 2016 19:15:40 +0200 (CEST) Subject: [R-gregmisc-commits] r2131 - in pkg/gmodels: . R inst man Message-ID: <20160812171540.573BF1868F7@r-forge.r-project.org> Author: warnes Date: 2016-08-12 19:15:39 +0200 (Fri, 12 Aug 2016) New Revision: 2131 Modified: pkg/gmodels/DESCRIPTION pkg/gmodels/NAMESPACE pkg/gmodels/R/ci.R pkg/gmodels/R/fit.contrast.R pkg/gmodels/inst/ChangeLog pkg/gmodels/inst/NEWS pkg/gmodels/man/ci.Rd pkg/gmodels/man/estimable.Rd pkg/gmodels/man/fit.contrast.Rd Log: Updates... Modified: pkg/gmodels/DESCRIPTION =================================================================== --- pkg/gmodels/DESCRIPTION 2016-08-12 17:11:58 UTC (rev 2130) +++ pkg/gmodels/DESCRIPTION 2016-08-12 17:15:39 UTC (rev 2131) @@ -1,14 +1,14 @@ Package: gmodels -Version: 2.16.2 -Date: 2015-07-21 -Title: Various R Programming Tools for Model Fitting +Version: 2.16.0 +Date: 2014-07-24 +Title: Various R programming tools for model fitting Author: Gregory R. Warnes, Ben Bolker, Thomas Lumley, and Randall C Johnson. Contributions from Randall C. Johnson are Copyright (2005) SAIC-Frederick, Inc. Funded by the Intramural Research Program, of the NIH, National Cancer Institute, Center for Cancer Research under NCI Contract NO1-CO-12400. Maintainer: Gregory R. Warnes -Description: Various R programming tools for model fitting. +Description: Various R programming tools for model fitting Depends: R (>= 1.9.0) Suggests: gplots, gtools, Matrix, nlme, lme4 (>= 0.999999-0) Imports: MASS, gdata Modified: pkg/gmodels/NAMESPACE =================================================================== --- pkg/gmodels/NAMESPACE 2016-08-12 17:11:58 UTC (rev 2130) +++ pkg/gmodels/NAMESPACE 2016-08-12 17:15:39 UTC (rev 2131) @@ -14,19 +14,19 @@ summary.glh.test ) -S3method(ci, numeric) +S3method(ci, default) S3method(ci, binom) S3method(ci, lm) S3method(ci, lme) -##S3method(ci, mer) +S3method(ci, mer) S3method(ci, estimable) S3method(fit.contrast, lm) S3method(fit.contrast, lme) -##S3method(fit.contrast, mer) +S3method(fit.contrast, mer) S3method(estimable, default) -##S3method(estimable, mer) +S3method(estimable, mer) S3method(estimable, mlm) S3method(print, glh.test) @@ -35,17 +35,3 @@ importFrom(MASS, ginv) importFrom(gdata, frameApply) importFrom(gdata, nobs) - -importFrom(stats, "chisq.test") -importFrom(stats, "coef") -importFrom(stats, "family") -importFrom(stats, "fisher.test") -importFrom(stats, "mcnemar.test") -importFrom(stats, "pchisq") -importFrom(stats, "pf") -importFrom(stats, "pt") -importFrom(stats, "qbeta") -importFrom(stats, "qt") -importFrom(stats, "sd") -importFrom(stats, "summary.glm") -importFrom(stats, "summary.lm") Modified: pkg/gmodels/R/ci.R =================================================================== --- pkg/gmodels/R/ci.R 2016-08-12 17:11:58 UTC (rev 2130) +++ pkg/gmodels/R/ci.R 2016-08-12 17:15:39 UTC (rev 2131) @@ -5,6 +5,7 @@ ci.numeric <- function(x, confidence=0.95,alpha=1-confidence,na.rm=FALSE,...) { + warning("No class or unkown class. Using default calcuation.") est <- mean(x, na.rm=na.rm) stderr <- sd(x, na.rm=na.rm)/sqrt(nobs(x)); ci.low <- est + qt(alpha/2, nobs(x)-1) * stderr @@ -113,3 +114,14 @@ retval } + + +ci.fit_contrast <- function (x, confidence = 0.95, alpha = 1 - confidence, ...) +{ + if( !all(c("lower CI", "upper CI") %in% colnames(x) ) ) + stop("object does not contain confidence interval information.") + colnames(x) <- c("Estimate", "Std. Error", "Delete", + "p-value", + "CI lower", "CI upper") + x[, c(1, 5:6, 2, 4), drop=FALSE] +} Modified: pkg/gmodels/R/fit.contrast.R =================================================================== --- pkg/gmodels/R/fit.contrast.R 2016-08-12 17:11:58 UTC (rev 2130) +++ pkg/gmodels/R/fit.contrast.R 2016-08-12 17:15:39 UTC (rev 2131) @@ -1,7 +1,9 @@ # $Id$ fit.contrast.lm <- function(model, varname, coeff, showall=FALSE, - conf.int=NULL, df=FALSE, ...) + conf.int, + df=FALSE, + ...) { # check class of model if( !(any(class(model) %in% c("lm", "aov", "lme") ) )) @@ -88,7 +90,7 @@ } - if(!is.null(conf.int)) # add confidence intervals + if(!missing(conf.int) && !is.null(conf.int)) # add confidence intervals { alpha <- 1-conf.int retval <- cbind( retval, @@ -99,9 +101,11 @@ } if(!df) - return(retval[,-5,drop=FALSE]) - else - return(retval) + retval <- retval[,-5,drop=FALSE] + + class(retval) <- "fit_contrast" + + retval } # fit.contrast.lme and fit.contrast.mer are necessary because @@ -202,3 +206,8 @@ fit.contrast <- function(model, varname, coeff, ...) UseMethod("fit.contrast") +coef.fit_contrast <- function(object, ...) + object + +print.fit_contrast <- function(object, ...) + print(unclass(object)) Modified: pkg/gmodels/inst/ChangeLog =================================================================== --- pkg/gmodels/inst/ChangeLog 2016-08-12 17:11:58 UTC (rev 2130) +++ pkg/gmodels/inst/ChangeLog 2016-08-12 17:15:39 UTC (rev 2131) @@ -1,182 +1,194 @@ -2015-07-19 warnes - - * [r2058] R/ci.R, man/ci.Rd: ci.binom() was using an incorrect - method for calculating binomial confidence interval. The revised - code calculates the Clopper-Pearson 'exect' interval, which is - *conservative* due to the discrete nature of the binomial - distribution. - -2015-05-02 warnes - - * [r2018] Rename 'trunk' to 'pkg' for compatibility with R-forge - -2015-04-06 warnes - - * [r1916] Add ChangeLog files to repository - 2014-07-24 warnes - * [r1869] Update NEWS for gmodels 2.16.0 - * [r1868] - Estimable now adds the class 'estimable' to returned - objects. + * [r1868] DESCRIPTION, NAMESPACE, R/ci.R, R/estimable.R, man/ci.Rd, + man/estimable.Rd: - Estimable now adds the class 'estimable' to + returned objects. - New ci() method for estimable objects. - Minor improvemets to man page formatting. 2013-07-18 warnes - * [r1710] Looks like Brian Ripley repackaged for R 3.0.0 and bumped - version number, so change it to 2.15.5 - * [r1709] Update for gmodels 2.15.4 - * [r1708] Update to current Rd syntax - * [r1707] Correct bug in estimable.mlm + * [r1710] DESCRIPTION, inst/NEWS: Looks like Brian Ripley + repackaged for R 3.0.0 and bumped version number, so change it to + 2.15.5 + * [r1709] DESCRIPTION, inst/NEWS: Update for gmodels 2.15.4 + * [r1708] man/ci.Rd: Update to current Rd syntax + * [r1707] R/estimable.mlm.R, test/test_estimable_mlm.R: Correct bug + in estimable.mlm 2013-07-15 warnes - * [r1706] Remove unused argument to ci.mer + * [r1706] R/ci.R, man/ci.Rd: Remove unused argument to ci.mer 2012-06-28 warnes - * [r1577] Update for gmodels version 2.15.3. - * [r1576] Move percentile() function to a separate file. - * [r1575] Update est.mer() to support new S4 "mer" class. - * [r1574] Make lme4 example executable. + * [r1577] DESCRIPTION, inst/NEWS: Update for gmodels version + 2.15.3. + * [r1576] R/percentile.R: Move percentile() function to a separate + file. + * [r1575] R/est.lmer.R, R/est.mer.R: Update est.mer() to support + new S4 "mer" class. + * [r1574] man/ci.Rd: Make lme4 example executable. 2012-06-27 warnes - * [r1573] Add test code submitted by Ariel.Muldoon at oregonstate.edu. + * [r1573] test/lme-test.R: Add test code submitted by + Ariel.Muldoon at oregonstate.edu. 2012-04-19 warnes - * [r1528] Update for release 2.15.2 - * [r1527] Update version and date. - * [r1526] The 'Design' package has been replaced my 'rms', so - update man page references. - * [r1525] More fixes for support of S4 'mer' class from lme4 - package. - * [r1524] Split long line. - * [r1523] Changes to pass R CMD check + * [r1528] inst/NEWS: Update for release 2.15.2 + * [r1527] DESCRIPTION: Update version and date. + * [r1526] man/estimable.Rd: The 'Design' package has been replaced + my 'rms', so update man page references. + * [r1525] R/ci.R, R/est.mer.R: More fixes for support of S4 'mer' + class from lme4 package. + * [r1524] man/coefFrame.Rd: Split long line. + * [r1523] man/ci.Rd, man/glh.test.Rd: Changes to pass R CMD check 2011-12-14 warnes - * [r1521] Improve formatting of ci.mer(). - * [r1520] Modify est.mer to work with recent lme4 'mer' S4 objects. + * [r1521] R/ci.R: Improve formatting of ci.mer(). + * [r1520] R/est.mer.R: Modify est.mer to work with recent lme4 + 'mer' S4 objects. 2011-01-16 warnes - * [r1466] Fix warnings reported by R CMD check. Update version - number to 2.15.1. + * [r1466] DESCRIPTION, inst/NEWS, man/ci.Rd, man/estimable.Rd, + man/fast.prcomp.Rd, man/fit.contrast.Rd, man/glh.test.Rd, + man/make.contrasts.Rd: Fix warnings reported by R CMD check. + Update version number to 2.15.1. 2009-05-09 warnes - * [r1337] Add tests for lme4 'mer' objects - * [r1336] Update for 2.15.0 - * [r1335] Update description for 2.15.0 - * [r1334] Add support for lme4's 'mer' objects - * [r1333] Add support for lme4's 'mer' objects - * [r1332] Fix .Rd syntax error - * [r1331] Add softlinks for ChangeLog and NEWS to top level dir for - convenience - * [r1330] Move ChangeLog and NEWS files into inst directory - * [r1329] Update Greg's email address + * [r1337] test, test/lme-test.R: Add tests for lme4 'mer' objects + * [r1336] inst/NEWS: Update for 2.15.0 + * [r1335] DESCRIPTION: Update description for 2.15.0 + * [r1334] R/est.mer.R: Add support for lme4's 'mer' objects + * [r1333] NAMESPACE, R/ci.R, R/est.lmer.R, R/estimable.R, + R/fit.contrast.R, R/to.est.R: Add support for lme4's 'mer' + objects + * [r1332] man/glh.test.Rd: Fix .Rd syntax error + * [r1331] NEWS: Add softlinks for ChangeLog and NEWS to top level + dir for convenience + * [r1330] ChangeLog, NEWS, inst, inst/NEWS: Move ChangeLog and NEWS + files into inst directory + * [r1329] DESCRIPTION, man/ci.Rd, man/estimable.Rd, + man/fast.prcomp.Rd, man/fit.contrast.Rd, man/glh.test.Rd, + man/make.contrasts.Rd: Update Greg's email address 2008-04-10 warnes - * [r1255] Improve languages a bit + * [r1255] man/ci.Rd: Improve languages a bit 2008-01-02 warnes - * [r1236] Update Marc's email address + * [r1236] man/CrossTable.Rd: Update Marc's email address 2007-12-12 warnes - * [r1233] Move copyright notice for Randall's contributions from - License section to Author section of the DESCRIPTION file. + * [r1233] DESCRIPTION: Move copyright notice for Randall's + contributions from License section to Author section of the + DESCRIPTION file. 2007-12-07 warnes - * [r1232] Update DESCRIPTION and NEWS for release 2.14.1 - * [r1231] Correct minor typos in man page for estimable() - * [r1230] Add support for lme models to estimable() - * [r1229] Replace non-ascii characters in Soren's name with - (equivalent?) ascii character to avoid character encoding issues. + * [r1232] DESCRIPTION, NEWS: Update DESCRIPTION and NEWS for + release 2.14.1 + * [r1231] man/estimable.Rd: Correct minor typos in man page for + estimable() + * [r1230] R/estimable.R: Add support for lme models to estimable() + * [r1229] man/estimable.Rd: Replace non-ascii characters in Soren's + name with (equivalent?) ascii character to avoid character + encoding issues. 2007-10-22 warnes - * [r1196] Clarify GPL version + * [r1196] DESCRIPTION: Clarify GPL version 2007-07-26 warnes - * [r1105] Add support for mlm to estimable(). - * [r1104] Add estimable method for mlm objects + * [r1105] DESCRIPTION, NAMESPACE, NEWS, R/estimable.mlm.R, + man/estimable.Rd: Add support for mlm to estimable(). + * [r1104] R/estimable.R, R/estimable.mlm.R: Add estimable method + for mlm objects 2007-03-09 warnes - * [r1079] Remove stray character - * [r1078] Update NEWS file. - * [r1077] Update version number - * [r1076] Minor code formatting changes - * [r1075] Flip lower and upper interval in ci.lmer(). Add example - to man page. - * [r1074] Fix some old email addressses that got missed + * [r1079] R/ci.R: Remove stray character + * [r1078] NEWS: Update NEWS file. + * [r1077] DESCRIPTION: Update version number + * [r1076] R/ci.R: Minor code formatting changes + * [r1075] R/est.lmer.R, man/ci.Rd: Flip lower and upper interval in + ci.lmer(). Add example to man page. + * [r1074] man/ci.Rd, man/estimable.Rd: Fix some old email + addressses that got missed 2006-11-29 warnes - * [r1029] Update for 2.13.1 - * [r1028] Correct declartion of S3 methods for estimable() - * [r1027] Add additional suggested packages - * [r1026] - Add generic + * [r1029] NEWS: Update for 2.13.1 + * [r1028] NAMESPACE: Correct declartion of S3 methods for + estimable() + * [r1027] DESCRIPTION: Add additional suggested packages + * [r1026] R/estimable.R, man/estimable.Rd: - Add generic - Fix code vs. doc inconsistiencies 2006-11-28 warnes - * [r1025] Remove extraneous comma that causes errors in R 2.5.0 + * [r1025] R/ci.R, R/estimable.R, R/fast.prcomp.R: Remove extraneous + comma that causes errors in R 2.5.0 2006-11-27 warnes - * [r1016] Update for 2.13.1 - * [r1015] Add missing export of methods for estimable() + * [r1016] DESCRIPTION, NEWS: Update for 2.13.1 + * [r1015] DESCRIPTION, NAMESPACE: Add missing export of methods for + estimable() 2006-11-14 ggorjan - * [r1012] Removed executable property + * [r1012] R/ci.R, R/fast.prcomp.R, man/ci.Rd: Removed executable + property 2006-08-02 warnes - * [r977] Update my email address + * [r977] man/fast.prcomp.Rd, man/fit.contrast.Rd, man/glh.test.Rd, + man/make.contrasts.Rd: Update my email address 2006-06-06 nj7w - * [r966] Updated ci, estimable and fit.contrast as per Randall - Johnson + * [r966] man/ci.Rd, man/estimable.Rd, man/fit.contrast.Rd: Updated + ci, estimable and fit.contrast as per Randall Johnson 2006-06-05 nj7w - * [r965] Additions as per Randall C Johnson - * [r964] Additions as per Randall C Johnson - * [r963] - New function to estimate CI's and p-values using - mcmcsamp() from the + * [r965] DESCRIPTION: Additions as per Randall C Johnson + * [r964] R/ci.R, R/estimable.R, R/fit.contrast.R, R/to.est.R: + Additions as per Randall C Johnson + * [r963] R/est.lmer.R: - New function to estimate CI's and p-values + using mcmcsamp() from the Matrix package 2006-05-05 nj7w - * [r959] Fixed an error: According to Marc Schwartz - there was an - error when a matrix without dimnames(or names(dimnames)) was - passed as x argument + * [r959] R/CrossTable.R, man/CrossTable.Rd: Fixed an error: + According to Marc Schwartz - there was an error when a matrix + without dimnames(or names(dimnames)) was passed as x argument 2005-12-13 nj7w - * [r808] Removed ChangeLog - * [r807] Updated NEWS + * [r808] ChangeLog: Removed ChangeLog + * [r807] NEWS: Updated NEWS 2005-12-12 nj7w - * [r796] Updated version number for CRAN + * [r796] DESCRIPTION: Updated version number for CRAN 2005-12-04 warnes - * [r781] Update for 2.11.0 - * [r780] Integration of code changes suggested by Randall C Johnson - to add + * [r781] NEWS: Update for 2.11.0 + * [r780] DESCRIPTION, NAMESPACE, R/ci.R, R/estimable.R, + R/fit.contrast.R, R/to.est.R, man/ci.Rd, man/estimable.Rd: + Integration of code changes suggested by Randall C Johnson to add support for lmer (lme version 4) objects to ci(), estimable(), and fit.contrast(). @@ -191,48 +203,52 @@ 2005-12-01 nj7w - * [r776] Updated Greg's email address + * [r776] man/ci.Rd, man/coefFrame.Rd, man/estimable.Rd, + man/fit.contrast.Rd, man/make.contrasts.Rd: Updated Greg's email + address 2005-10-27 warnes - * [r709] Update version number. Bump minor version since we added - functionality. - * [r708] Add ci.binom() to NAMESPACE, bump version + * [r709] DESCRIPTION: Update version number. Bump minor version + since we added functionality. + * [r708] DESCRIPTION, NAMESPACE: Add ci.binom() to NAMESPACE, bump + version 2005-10-26 warnes - * [r707] Add ci.binom + * [r707] R/ci.R, man/ci.Rd: Add ci.binom 2005-10-25 warnes - * [r706] Add gdata::nobs to import list. Needed by ci() + * [r706] NAMESPACE: Add gdata::nobs to import list. Needed by ci() 2005-09-12 nj7w - * [r671] Updated Greg's email + * [r671] man/fast.prcomp.Rd, man/glh.test.Rd: Updated Greg's email 2005-09-07 nj7w - * [r667] Fixed man page + * [r667] man/CrossTable.Rd: Fixed man page 2005-09-06 nj7w - * [r664] Updated DESCRIPTION - * [r663] Added NEWS - * [r662] Fixed the Package name + * [r664] DESCRIPTION: Updated DESCRIPTION + * [r663] NEWS: Added NEWS + * [r662] DESCRIPTION: Fixed the Package name 2005-09-02 nj7w - * [r655] Added ChangeLog + * [r655] ChangeLog: Added ChangeLog 2005-08-31 nj7w - * [r644] Added DESCRIPTION file - * [r643] removed DESCRIPTION.in + * [r644] DESCRIPTION: Added DESCRIPTION file + * [r643] DESCRIPTION.in: removed DESCRIPTION.in 2005-07-11 nj7w - * [r627] Revision based on Marc Schwartz's suggestions: + * [r627] R/CrossTable.R, man/CrossTable.Rd: Revision based on Marc + Schwartz's suggestions: 1) Added 'dnn' argument to enable specification of dimnames as per table() 2) Corrected bug in SPSS output for 1d table, where proportions @@ -240,10 +256,14 @@ 2005-06-09 nj7w - * [r625] Updating the version number, and various help files to - synchronize splitting of gregmisc bundle in 4 individual - components. - * [r623] Updates by Marc Schwartz: + * [r625] R/ci.R, R/coefFrame.R, R/estimable.R, R/fast.prcomp.R, + R/fit.contrast.R, R/glh.test.R, R/make.contrasts.R, + man/CrossTable.Rd, man/ci.Rd, man/coefFrame.Rd, man/estimable.Rd, + man/fast.prcomp.Rd, man/fit.contrast.Rd, man/glh.test.Rd, + man/make.contrasts.Rd: Updating the version number, and various + help files to synchronize splitting of gregmisc bundle in 4 + individual components. + * [r623] R/CrossTable.R: Updates by Marc Schwartz: CrossTable: # Revision 2.0 2005/04/27 @@ -253,95 +273,108 @@ 2005-05-13 nj7w - * [r621] 1) Using dQuote.ascii function in read.xls as the new - version of dQuote doesn't work proprly with UTF-8 locale. + * [r621] man/CrossTable.Rd: 1) Using dQuote.ascii function in + read.xls as the new version of dQuote doesn't work proprly with + UTF-8 locale. 2) Modified CrossTable.Rd usage in gmodels 3) Modified heatmap.2 usage in gplots. 2005-05-11 warnes - * [r620] Add dependency on gdata::frameApply. + * [r620] DESCRIPTION.in, NAMESPACE: Add dependency on + gdata::frameApply. 2005-03-31 warnes - * [r593] Add ceofFrame function to NAMESPACE - * [r592] coefFrame example needs to properly load ELISA data from - gtools package - * [r588] Ensure that each file has $Id$ header, and no $Log$ - * [r587] Add coefFrame() function contributed by Jim Rogers + * [r593] NAMESPACE: Add ceofFrame function to NAMESPACE + * [r592] man/coefFrame.Rd: coefFrame example needs to properly load + ELISA data from gtools package + * [r588] R/CrossTable.R, man/CrossTable.Rd, man/ci.Rd, + man/estimable.Rd, man/fast.prcomp.Rd, man/fit.contrast.Rd, + man/glh.test.Rd, man/make.contrasts.Rd: Ensure that each file has + $Id$ header, and no $Log$ + * [r587] R/coefFrame.R, man/coefFrame.Rd: Add coefFrame() function + contributed by Jim Rogers 2005-01-18 warnes - * [r521] Removed Windows Line Endings + * [r521] R/CrossTable.R: Removed Windows Line Endings 2005-01-14 nj7w - * [r518] Updated the manual to reflect prop.chisq change in its R - file. + * [r518] man/CrossTable.Rd: Updated the manual to reflect + prop.chisq change in its R file. 2005-01-14 warnes - * [r517] Nitin added display of the Chisquare contribution of each - cell, as suggested + * [r517] R/CrossTable.R: Nitin added display of the Chisquare + contribution of each cell, as suggested by Greg Snow. 2005-01-12 warnes - * [r515] Add dependency on R 1.9.0+ to prevent poeple from - installing on old + * [r515] DESCRIPTION.in: Add dependency on R 1.9.0+ to prevent + poeple from installing on old versions of R which don't support namespaces. 2004-12-23 nj7w - * [r507] Split the function print.CrossTable.vector in two parts - - for SAS behaiour and SPSS behaviour. Also put the code of - printing statistics in a function 'print.statistics' + * [r507] R/CrossTable.R, man/CrossTable.Rd: Split the function + print.CrossTable.vector in two parts - for SAS behaiour and SPSS + behaviour. Also put the code of printing statistics in a function + 'print.statistics' 2004-12-21 warnes - * [r502] Added & extended changes made by Nitin to implement 'SPSS' - format, as suggested by + * [r502] R/CrossTable.R: Added & extended changes made by Nitin to + implement 'SPSS' format, as suggested by Dirk Enzmann . 2004-09-30 warneg - * [r464] Fix typos. + * [r464] man/glh.test.Rd: Fix typos. 2004-09-27 warneg - * [r461] Updated to pass R CMD check. + * [r461] DESCRIPTION, DESCRIPTION.in: Updated to pass R CMD check. 2004-09-03 warneg - * [r450] Add explicit package to call to quantcut in example. - * [r446] initial bundle checkin + * [r450] man/fit.contrast.Rd: Add explicit package to call to + quantcut in example. + * [r446] DESCRIPTION, NAMESPACE, R/CrossTable.R, R/ci.R, + R/estimable.R, R/fast.prcomp.R, R/fit.contrast.R, R/glh.test.R, + R/make.contrasts.R, man/estimable.Rd, man/fit.contrast.Rd, + man/glh.test.Rd, man/make.contrasts.Rd: initial bundle checkin 2004-09-02 warneg - * [r442] Initial revision + * [r442] DESCRIPTION, DESCRIPTION.in, NAMESPACE: Initial revision 2004-05-25 warnes - * [r327] Updates from Mark Schwartz. + * [r327] R/CrossTable.R, man/CrossTable.Rd: Updates from Mark + Schwartz. 2004-04-13 warnes - * [r314] Fix latex warning: it doesn't like double subscripts. + * [r314] man/estimable.Rd: Fix latex warning: it doesn't like + double subscripts. 2004-03-26 warnes - * [r306] Reflect movement of code from 'mva' package to 'stats' in - R 1.9.0. + * [r306] man/fast.prcomp.Rd: Reflect movement of code from 'mva' + package to 'stats' in R 1.9.0. 2004-03-25 warnes - * [r296] - Estimable was reporting sqrt(X^2) rather than X^2 in the - output. + * [r296] R/estimable.R, man/estimable.Rd: - Estimable was reporting + sqrt(X^2) rather than X^2 in the output. - Provide latex math markup for linear algebra expressions in help text. - Other clarifications in help text - * [r295] Add enhancements to estimable() provided by S?ren - H?jsgaard + * [r295] R/estimable.R, man/estimable.Rd: Add enhancements to + estimable() provided by S?ren H?jsgaard \email{sorenh at agrsci.dk}: I have made a modified version of the function [..] which @@ -351,38 +384,38 @@ 2003-11-17 warnes - * [r221] - Fix incorrect handling of glm objects by fit.contrast, - as reported + * [r221] R/fit.contrast.R: - Fix incorrect handling of glm objects + by fit.contrast, as reported by Ulrich Halekoh, Phd . - Add regression test code to for this bug. 2003-08-07 warnes - * [r217] - Fixed incorrect denominator in standard error for mean - in ci.default. + * [r217] R/ci.R: - Fixed incorrect denominator in standard error + for mean in ci.default. 2003-04-22 warnes - * [r190] - the variable 'df' was used within the lme code section - overwriting + * [r190] R/fit.contrast.R: - the variable 'df' was used within the + lme code section overwriting the argument 'df'. 2003-03-12 warnes - * [r173] - Fixed a typo in the example + * [r173] man/fit.contrast.Rd: - Fixed a typo in the example - Added to lme example 2003-03-07 warnes - * [r168] - Minor changes to code to allow the package to be - provided as an + * [r168] R/fast.prcomp.R: - Minor changes to code to allow the + package to be provided as an S-Plus chapter. 2003-01-30 warnes - * [r160] - Renamed 'contrast.lm' to 'fit.contrast'. This new name - is more + * [r160] R/fit.contrast.R, man/fit.contrast.Rd: - Renamed + 'contrast.lm' to 'fit.contrast'. This new name is more descriptive and makes it easier to create and use methods for other classes, eg lme. @@ -396,8 +429,8 @@ calls fit.contrast - Updated help text to match changes. - * [r158] - Removed argument 'correct' and now print separate - corrected values + * [r158] R/CrossTable.R, man/CrossTable.Rd: - Removed argument + 'correct' and now print separate corrected values for 2 x 2 tables. - Added arguments 'prop.r', 'prop.c' and 'prop.t' to toggle printing @@ -411,8 +444,8 @@ table counts, proportions and the results of the appropriate statistical tests. - * [r157] - Added explicit check to ensure that the number of - specified + * [r157] R/make.contrasts.R: - Added explicit check to ensure that + the number of specified contrasts is less than or equal to the ncol - 1. Previously, this failed with an obtuse error message when the contrast matrix had row @@ -420,50 +453,56 @@ 2002-11-04 warnes - * [r142] - Moved fisher.test() to after table is printed, so that - table is + * [r142] R/CrossTable.R: - Moved fisher.test() to after table is + printed, so that table is still printed in the event that fisher.test() results in errors. 2002-10-29 warnes - * [r138] - Fixes to fast.svd to make it actually work. + * [r138] R/fast.prcomp.R, man/fast.prcomp.Rd: - Fixes to fast.svd + to make it actually work. - Updates to man page to fix mistmatches between code and docs and to fix warnings. - * [r137] - Moved make.contrasts to a separate file. + * [r137] R/make.contrasts.R, man/make.contrasts.Rd: - Moved + make.contrasts to a separate file. - Enhanced make contrasts to better label contrast matrix, to give how.many a default value, and to coerce vectors into row matrixes. - Added help page for make.contrasts. - Added link from contrasts.lm seealso to make.contrasts. - * [r136] Initial checkin for fast.prcomp() and fast.svd(). + * [r136] R/fast.prcomp.R, man/fast.prcomp.Rd: Initial checkin for + fast.prcomp() and fast.svd(). 2002-09-26 warnes - * [r127] - Added note and example code to illustrate how to - properly compute + * [r127] man/glh.test.Rd: - Added note and example code to + illustrate how to properly compute contrasts for the first factor in the model. 2002-09-24 warnes - * [r124] - Fixed a typo. + * [r124] R/glh.test.R: - Fixed a typo. 2002-09-23 warnes - * [r119] - Fixed syntax errors in barplot2.Rd and CrossTable.Rd + * [r119] man/CrossTable.Rd, man/glh.test.Rd: - Fixed syntax errors + in barplot2.Rd and CrossTable.Rd - Fixed incorrect translation of 'F' (distribution) to 'FALSE' in glh.test.Rd - * [r117] - Modified all files to include CVS Id and Log tags. - * [r116] - Added CrossTable() and barplot2() code and docs - contributed by Marc Schwartz. + * [r117] R/ci.R, man/estimable.Rd, man/glh.test.Rd: - Modified all + files to include CVS Id and Log tags. + * [r116] R/CrossTable.R, man/CrossTable.Rd: - Added CrossTable() + and barplot2() code and docs contributed by Marc Schwartz. - Permit combinations() to be used when r>n provided repeat.allowed=TRUE - Bumped up version number 2002-08-01 warnes - * [r114] - Corrected documentation mismatch for ci, ci.default. + * [r114] R/ci.R, man/ci.Rd, man/estimable.Rd, man/glh.test.Rd: - + Corrected documentation mismatch for ci, ci.default. - Replaced all occurences of '_' for assignment with '<-'. @@ -475,95 +514,101 @@ 2002-04-09 warneg - * [r109] Checkin for version 0.5.3 + * [r109] R/ci.R, R/estimable.R, R/glh.test.R, man/glh.test.Rd: + Checkin for version 0.5.3 2002-03-26 warneg - * [r104] - Changed methods to include '...' to match the generic. + * [r104] R/ci.R, R/glh.test.R, man/ci.Rd, man/glh.test.Rd: - + Changed methods to include '...' to match the generic. - Updated for version 0.5.1 - * [r99] Removed incorrect link to 'contrast' from seealso. + * [r99] man/glh.test.Rd: Removed incorrect link to 'contrast' from + seealso. 2002-02-20 warneg - * [r81] Minor changes, typo and formatting fixes. + * [r81] man/ci.Rd, man/estimable.Rd, man/glh.test.Rd: Minor + changes, typo and formatting fixes. 2002-01-17 warneg - * [r70] - Fixed errror in last example by adding 'conf.int' - parameter to + * [r70] man/estimable.Rd: - Fixed errror in last example by adding + 'conf.int' parameter to 'estimable' call. - * [r69] - Fixed typo in code that resulted in an syntax error. + * [r69] R/glh.test.R: - Fixed typo in code that resulted in an + syntax error. 2002-01-10 warneg - * [r68] - print.glh.test() was using cat() to printing the call. - This didn't work and + * [r68] R/glh.test.R: - print.glh.test() was using cat() to + printing the call. This didn't work and generated an error. 2001-12-19 warneg - * [r66] - Fixed display of formulae. + * [r66] man/glh.test.Rd: - Fixed display of formulae. - Added description of return value - * [r65] - Removed extra element of return object. + * [r65] R/glh.test.R: - Removed extra element of return object. 2001-12-18 warneg - * [r64] - Updated documentation to reflect change of parameters - from 'alpha' + * [r64] man/estimable.Rd: - Updated documentation to reflect change + of parameters from 'alpha' to 'conf.int', including the new optional status of the confidence intervals. - * [r63] - Modified to make confidence intervals optional. Changed - 'alpha' + * [r63] R/estimable.R: - Modified to make confidence intervals + optional. Changed 'alpha' parameter giving significance level to 'conf.int' giving confidence level. - * [r62] - Added summary.glh.test to alias, usage, and example - sections. - * [r61] - Modified to work correctly when obj is of class 'aov' by - specifying + * [r62] man/glh.test.Rd: - Added summary.glh.test to alias, usage, + and example sections. + * [r61] R/glh.test.R: - Modified to work correctly when obj is of + class 'aov' by specifying summary.lm instead of summary. This ensures that the summary object has the fields we need. - Moved detailed reporting of results from 'print' to 'summary' function and added a simpler report to 'print' - * [r60] - Modified to work correctly when obj is of class 'aov' by - specifying + * [r60] R/estimable.R: - Modified to work correctly when obj is of + class 'aov' by specifying summary.lm instead of summary. This ensures that the summary object has the fields we need. - * [r59] Initial checkin. + * [r59] R/glh.test.R, man/glh.test.Rd: Initial checkin. 2001-12-17 warneg - * [r56] - Fixed spelling errors. - * [r55] - Fixed the link to contrasts.lm. + * [r56] man/estimable.Rd: - Fixed spelling errors. + * [r55] man/estimable.Rd: - Fixed the link to contrasts.lm. - Rephrased title/description to be more clear. 2001-12-10 warneg - * [r49] Renamed 'contrsts.coeff.Rd' to 'estimable.Rd' corresponding - to function rename. - * [r48] renamed from contrast.coeff.R to estimable.R (incorrectly - via contrast.lm.R) + * [r49] man/estimable.Rd: Renamed 'contrsts.coeff.Rd' to + 'estimable.Rd' corresponding to function rename. + * [r48] R/estimable.R: renamed from contrast.coeff.R to estimable.R + (incorrectly via contrast.lm.R) 2001-12-07 warneg - * [r37] - Added text noting that lme is now supported. - * [r36] - Fixed typo: DF column was being filled in with p-value. - * [r35] - Added ci.lme method to handle lme objects. + * [r37] man/ci.Rd: - Added text noting that lme is now supported. + * [r36] R/ci.R: - Fixed typo: DF column was being filled in with + p-value. + * [r35] R/ci.R: - Added ci.lme method to handle lme objects. 2001-10-16 warneg - * [r27] Fixed unbalanced brace. + * [r27] man/ci.Rd: Fixed unbalanced brace. 2001-08-25 warneg - * [r12] - Added CVS header. + * [r12] man/ci.Rd: - Added CVS header. - Added my email address. 2001-05-30 warneg - * [r2] Initial revision + * [r2] ., R, R/ci.R, man, man/ci.Rd: Initial revision Modified: pkg/gmodels/inst/NEWS =================================================================== --- pkg/gmodels/inst/NEWS 2016-08-12 17:11:58 UTC (rev 2130) +++ pkg/gmodels/inst/NEWS 2016-08-12 17:15:39 UTC (rev 2131) @@ -1,18 +1,3 @@ -Version 2.16.1 - 2015-07-18 ---------------------------- - -Bug fixes: - -- ci.binom() was using an incorrect method for calcuating binomial - conficence intervals. It now calculates the Clopper-Pearson 'exect' - interval, which is *conservative* due to the discrete nature of the - binomial distribution. - -Other Changes: - -- Support for lme4 objects has been removed due to incompatible - changes to the lme4 package. - Version 2.16.0 - 2014-07-24 --------------------------- @@ -56,7 +41,7 @@ Bug fixes: - Update est.mer() to work with recent versions of lme4 which changed - 'mer' objects from S3 to S4 class + 'mer' objects from S3 to S4 class - Changes to pass new R CMD check tests @@ -128,7 +113,7 @@ - fix various code/doc inconsistencies - Problem: estimable() was failing for lmer objects. - Solution: + Solution: - Create a generic estimable() - Move old function to estimable.default() - Add estimable.lmer() to the exported methods list in NAMESPACE @@ -150,8 +135,8 @@ function provided by Randall C Johnson. It is now possible to do things like: estimable(reg, c("xB"=1,"xD"=-1)) - instead of: - estimable(reg, c( 0, 1, 0, -1)) + instead of: + estimable(reg, c( 0, 1, 0, -1)) which should make estimable() much easier to use for large models. Version 2.1.0 Modified: pkg/gmodels/man/ci.Rd =================================================================== --- pkg/gmodels/man/ci.Rd 2016-08-12 17:11:58 UTC (rev 2130) [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/r-gregmisc -r 2131 From noreply at r-forge.r-project.org Fri Aug 12 19:17:24 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 12 Aug 2016 19:17:24 +0200 (CEST) Subject: [R-gregmisc-commits] r2132 - in pkg/gplots: . R man Message-ID: <20160812171725.0087D1868F7@r-forge.r-project.org> Author: warnes Date: 2016-08-12 19:17:24 +0200 (Fri, 12 Aug 2016) New Revision: 2132 Modified: pkg/gplots/DESCRIPTION pkg/gplots/R/heatmap.2.R pkg/gplots/man/heatmap.2.Rd Log: Add parameter specifying the number of bins used to plot the color key Modified: pkg/gplots/DESCRIPTION =================================================================== --- pkg/gplots/DESCRIPTION 2016-08-12 17:15:39 UTC (rev 2131) +++ pkg/gplots/DESCRIPTION 2016-08-12 17:17:24 UTC (rev 2132) @@ -23,8 +23,8 @@ Depends: R (>= 3.0) Imports: gtools, gdata, stats, caTools, KernSmooth Suggests: grid, MASS -Version: 3.0.1 -Date: 2016-03-30 +Version: 3.0.3 +Date: 2016-08-01 Author: Gregory R. Warnes, Ben Bolker, Lodewijk Bonebakker, Robert Gentleman, Wolfgang Huber Andy Liaw, Thomas Lumley, Martin Maechler, Arni Magnusson, Steffen Moeller, Marc Schwartz, Bill Modified: pkg/gplots/R/heatmap.2.R =================================================================== --- pkg/gplots/R/heatmap.2.R 2016-08-12 17:15:39 UTC (rev 2131) +++ pkg/gplots/R/heatmap.2.R 2016-08-12 17:17:24 UTC (rev 2132) @@ -65,6 +65,7 @@ ## color key + density info key = TRUE, keysize = 1.5, + keygrid=255, density.info=c("histogram","density","none"), denscol=tracecol, symkey = any(x < 0, na.rm=TRUE) || symbreaks, @@ -670,19 +671,27 @@ max.raw <- max.breaks } - z <- seq(min.raw, max.raw, by=min(diff(breaks)/100)) + z <- seq(min.raw, max.raw, length.out=keygrid) image(z=matrix(z, ncol=1), - col=col, breaks=tmpbreaks, - xaxt="n", yaxt="n") + #x=matrix(z), + #y=0, + col=col, + breaks=tmpbreaks, + xlab="", + xaxt="n", + yaxt="n") - par(usr=c(0,1,0,1)) if (is.null(key.xtickfun)) { - lv <- pretty(breaks) - xv <- scale01(as.numeric(lv), min.raw, max.raw) - xargs <- list(at=xv, labels=lv) + usr <- par("usr") + par(usr=c(usr[1], usr[2], 0, 1)) + lv <- pretty(breaks) + xv <- scale01(as.numeric(lv), min.raw, max.raw) + xargs <- list(at=xv, labels=lv) } else { - xargs <- key.xtickfun() + xargs <- key.xtickfun() } + + xargs$side <- 1 do.call(axis, xargs) if (is.null(key.xlab)) { Modified: pkg/gplots/man/heatmap.2.Rd =================================================================== --- pkg/gplots/man/heatmap.2.Rd 2016-08-12 17:15:39 UTC (rev 2131) +++ pkg/gplots/man/heatmap.2.Rd 2016-08-12 17:17:24 UTC (rev 2132) @@ -77,6 +77,7 @@ # color key + density info key = TRUE, keysize = 1.5, + keygrid = 255, density.info=c("histogram","density","none"), denscol=tracecol, symkey = any(x < 0, na.rm=TRUE) || symbreaks, @@ -215,6 +216,7 @@ % Color key and density info \item{key}{logical indicating whether a color-key should be shown.} \item{keysize}{numeric value indicating the size of the key} + \item{keygrid}{number of bins used to plot the color-key} \item{density.info}{character string indicating whether to superimpose a 'histogram', a 'density' plot, or no plot ('none') on the color-key.} @@ -437,7 +439,18 @@ return(list(labels=FALSE, tick=FALSE)) }) + heatmap.2(x, + breaks=256, + keygrid=10 + ) + + heatmap.2(x, + breaks=256, + keygrid=1001 + ) + + ## ## Show effect of z-score scaling within columns, blue-red color scale ## From noreply at r-forge.r-project.org Fri Aug 12 19:18:33 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 12 Aug 2016 19:18:33 +0200 (CEST) Subject: [R-gregmisc-commits] r2133 - in pkg/gplots: R man Message-ID: <20160812171833.33EF6186880@r-forge.r-project.org> Author: warnes Date: 2016-08-12 19:18:32 +0200 (Fri, 12 Aug 2016) New Revision: 2133 Modified: pkg/gplots/R/plotmeans.R pkg/gplots/man/plotmeans.Rd Log: New parameter 'add' for plotmeans to allow *adding* means+confidence intervals to an existing plot. Modified: pkg/gplots/R/plotmeans.R =================================================================== --- pkg/gplots/R/plotmeans.R 2016-08-12 17:17:24 UTC (rev 2132) +++ pkg/gplots/R/plotmeans.R 2016-08-12 17:18:32 UTC (rev 2133) @@ -17,6 +17,7 @@ xaxt, use.t = TRUE, lwd=par("lwd"), + add = FALSE, ...) { if (invalid(formula) || (length(formula) != 3)) @@ -51,6 +52,7 @@ if(!bars) { + if(add) par(new=TRUE) plot( means, ..., col=col, xlim=xlim) } else @@ -77,7 +79,8 @@ plotCI(x=1:length(means), y=means, uiw=ci.width, xaxt="n", xlab=xlab, ylab=ylab, labels=mean.labels, col=col, xlim=xlim, - lwd=barwidth, barcol=barcol, minbar=minbar, maxbar=maxbar, ... ) + lwd=barwidth, barcol=barcol, minbar=minbar, maxbar=maxbar, + add=add, ... ) if(invalid(xaxt) || xaxt!="n") axis(1, at = 1:length(means), labels = legends, ...) Modified: pkg/gplots/man/plotmeans.Rd =================================================================== --- pkg/gplots/man/plotmeans.Rd 2016-08-12 17:17:24 UTC (rev 2132) +++ pkg/gplots/man/plotmeans.Rd 2016-08-12 17:18:32 UTC (rev 2133) @@ -10,7 +10,7 @@ digits=getOption("digits"), col="black", barwidth=1, barcol="blue", connect=TRUE, ccol= col, legends=names(means), xaxt, use.t=TRUE, - lwd=par("lwd"), ...) + lwd=par("lwd"), add = FALSE, ...) } \arguments{ \item{formula}{symbolic expression specifying the outcome (continuous) @@ -91,6 +91,9 @@ \item{lwd}{Width of connecting lines } + \item{add}{Logical specifying whether to add to an existing plot + (\code{add=TRUE}) or to generate a new plot (\code{add=FALSE}).} + \item{\dots}{ optional plotting parameters. } } @@ -133,7 +136,29 @@ "Ile-et-Vilaine Esophageal Cancer Study") ) abline(v=c(6.5, 12.5, 18.5), lty=2) + grid() + # add to a boxplot + boxplot(ncases/ncontrols ~ interaction(agegp , alcgp, sep =" "), + data=esoph, + xlab="Age Group and Alcohol Consumption", + ylab="# Cases / # Controls", + main=c("Fraction of Cases for by Age and Alcohol Consumption", + "Ile-et-Vilaine Esophageal Cancer Study"), + ylim=c(-0.75, 1.5), + col="green" + ) + plotmeans(ncases/ncontrols ~ interaction(agegp , alcgp, sep =" "), + data=esoph, + connect=list(1:6,7:12,13:18,19:24), + barwidth=2, + barcol="dark blue", + col="dark blue", + add=TRUE) + grid() + abline(v=c(6.5, 12.5, 18.5), lty=2) + + } \author{Gregory R. Warnes \email{greg at warnes.net}} From noreply at r-forge.r-project.org Fri Aug 12 19:34:11 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 12 Aug 2016 19:34:11 +0200 (CEST) Subject: [R-gregmisc-commits] r2134 - in pkg/gplots: . R Message-ID: <20160812173412.0AA3D18814C@r-forge.r-project.org> Author: warnes Date: 2016-08-12 19:34:11 +0200 (Fri, 12 Aug 2016) New Revision: 2134 Added: pkg/gplots/.Rbuildignore Modified: pkg/gplots/R/space.R Log: Improve method of spacing points in the same bin. Added: pkg/gplots/.Rbuildignore =================================================================== --- pkg/gplots/.Rbuildignore (rev 0) +++ pkg/gplots/.Rbuildignore 2016-08-12 17:34:11 UTC (rev 2134) @@ -0,0 +1,3 @@ +^.*\.Rproj$ +^\.Rproj\.user$ +^\.RData Modified: pkg/gplots/R/space.R =================================================================== --- pkg/gplots/R/space.R 2016-08-12 17:18:32 UTC (rev 2133) +++ pkg/gplots/R/space.R 2016-08-12 17:34:11 UTC (rev 2134) @@ -7,6 +7,7 @@ space <- function(x,y,s=1/50, na.rm=TRUE, direction="x") { + # to avoid duplicating code for direction="y", swap x and y temporarily... if(direction!='x') { tmp <- y @@ -35,29 +36,45 @@ x <- x[ord] y <- y[ord] - startsame <- 1 - same.x <- x[1] - same.y <- y[1] + # split into groups within the same interval + sames.x <- c(FALSE, within(x[1:(length(x)-1)], + x[-1], + delta=spacing.x) + ) + sames.y <- c(FALSE, within(y[1:(length(y)-1)], + y[-1], + delta=spacing.y) + ) + sames <- sames.x & sames.y + groups <- cumsum(!sames) + xList <- split(x, groups) + yList <- split(y, groups) - for( i in 1:length(x) ) + + for( i in 1:max(groups) ) { - if(i>1 && - within(x[i],same.x,spacing.x) && - within(y[i],same.y,spacing.y) ) - { - if(x[startsame] == same.x ) - x[startsame] <- x[startsame] + len <- length(xList[[i]]) + if(len==1) + next - cumrun <- i - startsame + m <- mean(xList[[i]]) + s <- len/2 * spacing.x + deltas <- seq(from=-s, to=+s, length.out=len) + order <- "permute" + if (order=="permute") + deltas <- sample(deltas) + else if (order=="A") + deltas <- deltas[order(abs(deltas), decreasing=TRUE)] + else if (order=="V") + deltas <- deltas[order(abs(deltas), decreasing=FALSE)] - x[i] <- x[i] + (-1)^(cumrun+1) * floor((cumrun+1) /2) * spacing.x - } else { - startsame <- i - same.x <- x[i] - same.y <- y[i] - } - } + xList[[i]] <- xList[[i]] + deltas + } + x <- unlist(xList)[undo] + y <- unlist(yList)[undo] + + # undo swap of x and y. if(direction!='x') { tmp <- y @@ -65,6 +82,6 @@ x <- tmp } - return( list(x=x[undo], y=y[undo]) ) + return( list(x=x, y=y) ) } From noreply at r-forge.r-project.org Fri Aug 12 19:38:14 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 12 Aug 2016 19:38:14 +0200 (CEST) Subject: [R-gregmisc-commits] r2135 - in pkg: SASxport SASxport/.Rproj.user SASxport/.Rproj.user/632EB997 SASxport/.Rproj.user/632EB997/pcs SASxport/.Rproj.user/632EB997/sdb SASxport/.Rproj.user/632EB997/sdb/mt SASxport/.Rproj.user/632EB997/sdb/per SASxport/.Rproj.user/632EB997/sdb/per/t SASxport/.Rproj.user/632EB997/sdb/per/t/42c64b18 SASxport/.Rproj.user/632EB997/sdb/per/u SASxport/.Rproj.user/632EB997/sdb/prop SASxport/.Rproj.user/shared fork fork/.Rproj.user fork/.Rproj.user/632EB997 fork/.Rproj.user/632EB997/pcs fork/.Rproj.user/632EB997/sdb fork/.Rproj.user/632EB997/sdb/per fork/.Rproj.user/632EB997/sdb/per/t fork/.Rproj.user/632EB997/sdb/per/u fork/.Rproj.user/shared gplots gplots/.Rproj.user gplots/.Rproj.user/632EB997 gplots/.Rproj.user/632EB997/pcs gplots/.Rproj.user/632EB997/sdb gplots/.Rproj.user/632EB997/sdb/mt gplots/.Rproj.user/632EB997/sdb/per gplots/.Rproj.user/632EB997/sdb/per/t gplots/.Rproj.user/632EB997/sdb/per/t/a31943ab gplots/.Rproj.user/632EB997/sdb/per/t/d9524f0f gplots/.Rproj.user/632EB997/sdb/per/t/edc438ca gplots/.Rproj.user/632EB997/sdb/per/u gplots/.Rproj.user/632EB997/sdb/prop gplots/.Rproj.user/shared Message-ID: <20160812173814.254CD18814C@r-forge.r-project.org> Author: warnes Date: 2016-08-12 19:38:13 +0200 (Fri, 12 Aug 2016) New Revision: 2135 Added: pkg/SASxport/.Rproj.user/ pkg/SASxport/.Rproj.user/632EB997/ pkg/SASxport/.Rproj.user/632EB997/build_options pkg/SASxport/.Rproj.user/632EB997/ctx/ pkg/SASxport/.Rproj.user/632EB997/pcs/ pkg/SASxport/.Rproj.user/632EB997/pcs/debug-breakpoints.pper pkg/SASxport/.Rproj.user/632EB997/pcs/files-pane.pper pkg/SASxport/.Rproj.user/632EB997/pcs/find-in-files.pper pkg/SASxport/.Rproj.user/632EB997/pcs/source-pane.pper pkg/SASxport/.Rproj.user/632EB997/pcs/windowlayoutstate.pper pkg/SASxport/.Rproj.user/632EB997/pcs/workbench-pane.pper pkg/SASxport/.Rproj.user/632EB997/persistent-state pkg/SASxport/.Rproj.user/632EB997/presentation/ pkg/SASxport/.Rproj.user/632EB997/saved_source_markers pkg/SASxport/.Rproj.user/632EB997/sdb/ pkg/SASxport/.Rproj.user/632EB997/sdb/mt/ pkg/SASxport/.Rproj.user/632EB997/sdb/mt/3B443731 pkg/SASxport/.Rproj.user/632EB997/sdb/mt/4ED4AE88 pkg/SASxport/.Rproj.user/632EB997/sdb/mt/91BF8EB8 pkg/SASxport/.Rproj.user/632EB997/sdb/mt/B97C53CF pkg/SASxport/.Rproj.user/632EB997/sdb/mt/EB1F71A0 pkg/SASxport/.Rproj.user/632EB997/sdb/mu/ pkg/SASxport/.Rproj.user/632EB997/sdb/per/ pkg/SASxport/.Rproj.user/632EB997/sdb/per/t/ pkg/SASxport/.Rproj.user/632EB997/sdb/per/t/42c64b18/ pkg/SASxport/.Rproj.user/632EB997/sdb/per/t/42c64b18/3B443731 pkg/SASxport/.Rproj.user/632EB997/sdb/per/t/42c64b18/4ED4AE88 pkg/SASxport/.Rproj.user/632EB997/sdb/per/t/42c64b18/91BF8EB8 pkg/SASxport/.Rproj.user/632EB997/sdb/per/t/42c64b18/B97C53CF pkg/SASxport/.Rproj.user/632EB997/sdb/per/t/42c64b18/EB1F71A0 pkg/SASxport/.Rproj.user/632EB997/sdb/per/u/ pkg/SASxport/.Rproj.user/632EB997/sdb/per/u/42c64b18/ pkg/SASxport/.Rproj.user/632EB997/sdb/prop/ pkg/SASxport/.Rproj.user/632EB997/sdb/prop/210DDAC6 pkg/SASxport/.Rproj.user/632EB997/sdb/prop/26571A1D pkg/SASxport/.Rproj.user/632EB997/sdb/prop/4B00C2BF pkg/SASxport/.Rproj.user/632EB997/sdb/prop/4F2B468A pkg/SASxport/.Rproj.user/632EB997/sdb/prop/62B93444 pkg/SASxport/.Rproj.user/632EB997/sdb/prop/67F255E0 pkg/SASxport/.Rproj.user/632EB997/sdb/prop/6B869B56 pkg/SASxport/.Rproj.user/632EB997/sdb/prop/8546615E pkg/SASxport/.Rproj.user/632EB997/sdb/prop/8724CF5D pkg/SASxport/.Rproj.user/632EB997/sdb/prop/A17C35A1 pkg/SASxport/.Rproj.user/632EB997/sdb/prop/B7AE8750 pkg/SASxport/.Rproj.user/632EB997/sdb/prop/B900A9AD pkg/SASxport/.Rproj.user/632EB997/sdb/prop/C90C699B pkg/SASxport/.Rproj.user/632EB997/sdb/prop/CF52798E pkg/SASxport/.Rproj.user/632EB997/sdb/prop/D2C5E77F pkg/SASxport/.Rproj.user/632EB997/sdb/prop/D57FBD7D pkg/SASxport/.Rproj.user/632EB997/sdb/prop/DC24A07E pkg/SASxport/.Rproj.user/632EB997/sdb/prop/E4825697 pkg/SASxport/.Rproj.user/632EB997/sdb/prop/E9666CAC pkg/SASxport/.Rproj.user/632EB997/sdb/prop/FCB3A014 pkg/SASxport/.Rproj.user/632EB997/sdb/prop/INDEX pkg/SASxport/.Rproj.user/632EB997/viewer-cache/ pkg/SASxport/.Rproj.user/shared/ pkg/SASxport/.Rproj.user/shared/users/ pkg/fork/.Rbuildignore pkg/fork/.Rproj.user/ pkg/fork/.Rproj.user/632EB997/ pkg/fork/.Rproj.user/632EB997/ctx/ pkg/fork/.Rproj.user/632EB997/pcs/ pkg/fork/.Rproj.user/632EB997/pcs/files-pane.pper pkg/fork/.Rproj.user/632EB997/pcs/source-pane.pper pkg/fork/.Rproj.user/632EB997/pcs/windowlayoutstate.pper pkg/fork/.Rproj.user/632EB997/pcs/workbench-pane.pper pkg/fork/.Rproj.user/632EB997/presentation/ pkg/fork/.Rproj.user/632EB997/saved_source_markers pkg/fork/.Rproj.user/632EB997/sdb/ pkg/fork/.Rproj.user/632EB997/sdb/mt/ pkg/fork/.Rproj.user/632EB997/sdb/mu/ pkg/fork/.Rproj.user/632EB997/sdb/per/ pkg/fork/.Rproj.user/632EB997/sdb/per/t/ pkg/fork/.Rproj.user/632EB997/sdb/per/t/d9524f0f/ pkg/fork/.Rproj.user/632EB997/sdb/per/u/ pkg/fork/.Rproj.user/632EB997/sdb/per/u/d9524f0f/ pkg/fork/.Rproj.user/632EB997/viewer-cache/ pkg/fork/.Rproj.user/shared/ pkg/fork/.Rproj.user/shared/users/ pkg/gplots/.Rproj.user/ pkg/gplots/.Rproj.user/632EB997/ pkg/gplots/.Rproj.user/632EB997/ctx/ pkg/gplots/.Rproj.user/632EB997/pcs/ pkg/gplots/.Rproj.user/632EB997/pcs/files-pane.pper pkg/gplots/.Rproj.user/632EB997/pcs/source-pane.pper pkg/gplots/.Rproj.user/632EB997/pcs/svn.pper pkg/gplots/.Rproj.user/632EB997/pcs/windowlayoutstate.pper pkg/gplots/.Rproj.user/632EB997/pcs/workbench-pane.pper pkg/gplots/.Rproj.user/632EB997/persistent-state pkg/gplots/.Rproj.user/632EB997/presentation/ pkg/gplots/.Rproj.user/632EB997/saved_source_markers pkg/gplots/.Rproj.user/632EB997/sdb/ pkg/gplots/.Rproj.user/632EB997/sdb/mt/ pkg/gplots/.Rproj.user/632EB997/sdb/mt/341AED89 pkg/gplots/.Rproj.user/632EB997/sdb/mt/456A8AE1 pkg/gplots/.Rproj.user/632EB997/sdb/mt/6C32B82 pkg/gplots/.Rproj.user/632EB997/sdb/mt/820656DD pkg/gplots/.Rproj.user/632EB997/sdb/mt/BD1D11CF pkg/gplots/.Rproj.user/632EB997/sdb/mt/C1AD43D1 pkg/gplots/.Rproj.user/632EB997/sdb/mt/DE2C36AE pkg/gplots/.Rproj.user/632EB997/sdb/mu/ pkg/gplots/.Rproj.user/632EB997/sdb/per/ pkg/gplots/.Rproj.user/632EB997/sdb/per/t/ pkg/gplots/.Rproj.user/632EB997/sdb/per/t/a31943ab/ pkg/gplots/.Rproj.user/632EB997/sdb/per/t/a31943ab/341AED89 pkg/gplots/.Rproj.user/632EB997/sdb/per/t/a31943ab/456A8AE1 pkg/gplots/.Rproj.user/632EB997/sdb/per/t/a31943ab/6C32B82 pkg/gplots/.Rproj.user/632EB997/sdb/per/t/a31943ab/820656DD pkg/gplots/.Rproj.user/632EB997/sdb/per/t/a31943ab/BD1D11CF pkg/gplots/.Rproj.user/632EB997/sdb/per/t/a31943ab/C1AD43D1 pkg/gplots/.Rproj.user/632EB997/sdb/per/t/a31943ab/DE2C36AE pkg/gplots/.Rproj.user/632EB997/sdb/per/t/d9524f0f/ pkg/gplots/.Rproj.user/632EB997/sdb/per/t/d9524f0f/341AED89 pkg/gplots/.Rproj.user/632EB997/sdb/per/t/d9524f0f/456A8AE1 pkg/gplots/.Rproj.user/632EB997/sdb/per/t/d9524f0f/6C32B82 pkg/gplots/.Rproj.user/632EB997/sdb/per/t/d9524f0f/820656DD pkg/gplots/.Rproj.user/632EB997/sdb/per/t/d9524f0f/BD1D11CF pkg/gplots/.Rproj.user/632EB997/sdb/per/t/d9524f0f/C1AD43D1 pkg/gplots/.Rproj.user/632EB997/sdb/per/t/d9524f0f/DE2C36AE pkg/gplots/.Rproj.user/632EB997/sdb/per/t/edc438ca/ pkg/gplots/.Rproj.user/632EB997/sdb/per/t/edc438ca/341AED89 pkg/gplots/.Rproj.user/632EB997/sdb/per/t/edc438ca/456A8AE1 pkg/gplots/.Rproj.user/632EB997/sdb/per/t/edc438ca/820656DD pkg/gplots/.Rproj.user/632EB997/sdb/per/t/edc438ca/BD1D11CF pkg/gplots/.Rproj.user/632EB997/sdb/per/u/ pkg/gplots/.Rproj.user/632EB997/sdb/per/u/a31943ab/ pkg/gplots/.Rproj.user/632EB997/sdb/per/u/d9524f0f/ pkg/gplots/.Rproj.user/632EB997/sdb/per/u/edc438ca/ pkg/gplots/.Rproj.user/632EB997/sdb/prop/ pkg/gplots/.Rproj.user/632EB997/sdb/prop/1CDF36D8 pkg/gplots/.Rproj.user/632EB997/sdb/prop/276B72FF pkg/gplots/.Rproj.user/632EB997/sdb/prop/621FB34C pkg/gplots/.Rproj.user/632EB997/sdb/prop/77FB12A5 pkg/gplots/.Rproj.user/632EB997/sdb/prop/88E2DA8E pkg/gplots/.Rproj.user/632EB997/sdb/prop/910AF072 pkg/gplots/.Rproj.user/632EB997/sdb/prop/D1DFF321 pkg/gplots/.Rproj.user/632EB997/sdb/prop/F0AD830A pkg/gplots/.Rproj.user/632EB997/sdb/prop/F401A7EA pkg/gplots/.Rproj.user/632EB997/sdb/prop/INDEX pkg/gplots/.Rproj.user/632EB997/viewer-cache/ pkg/gplots/.Rproj.user/shared/ pkg/gplots/.Rproj.user/shared/users/ Log: Add RStudio files Added: pkg/SASxport/.Rproj.user/632EB997/build_options =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/build_options (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/build_options 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,4 @@ +auto_roxygenize_for_build_and_reload="0" +auto_roxygenize_for_build_package="1" +auto_roxygenize_for_check="1" +makefile_args="" Added: pkg/SASxport/.Rproj.user/632EB997/pcs/debug-breakpoints.pper =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/pcs/debug-breakpoints.pper (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/pcs/debug-breakpoints.pper 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,6 @@ +{ + "debugBreakpointsState" : { + "breakpoints" : [ + ] + } +} \ No newline at end of file Added: pkg/SASxport/.Rproj.user/632EB997/pcs/files-pane.pper =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/pcs/files-pane.pper (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/pcs/files-pane.pper 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,13 @@ +{ + "path" : "~/src/r-gregmisc/SASxport", + "sortOrder" : [ + { + "ascending" : true, + "columnIndex" : 2 + }, + { + "ascending" : false, + "columnIndex" : 4 + } + ] +} \ No newline at end of file Added: pkg/SASxport/.Rproj.user/632EB997/pcs/find-in-files.pper =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/pcs/find-in-files.pper (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/pcs/find-in-files.pper 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,10 @@ +{ + "dialog-state" : { + "caseSensitive" : false, + "filePatterns" : [ + ], + "path" : "~/src/r-gregmisc/SASxport", + "query" : "http:.*sas", + "regex" : true + } +} \ No newline at end of file Added: pkg/SASxport/.Rproj.user/632EB997/pcs/source-pane.pper =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/pcs/source-pane.pper (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/pcs/source-pane.pper 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,3 @@ +{ + "activeTab" : 2 +} \ No newline at end of file Added: pkg/SASxport/.Rproj.user/632EB997/pcs/windowlayoutstate.pper =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/pcs/windowlayoutstate.pper (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/pcs/windowlayoutstate.pper 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,14 @@ +{ + "left" : { + "panelheight" : 789, + "splitterpos" : 339, + "topwindowstate" : "NORMAL", + "windowheight" : 860 + }, + "right" : { + "panelheight" : 789, + "splitterpos" : 508, + "topwindowstate" : "NORMAL", + "windowheight" : 860 + } +} \ No newline at end of file Added: pkg/SASxport/.Rproj.user/632EB997/pcs/workbench-pane.pper =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/pcs/workbench-pane.pper (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/pcs/workbench-pane.pper 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,6 @@ +{ + "TabSet1" : 2, + "TabSet2" : 3, + "TabZoom" : { + } +} \ No newline at end of file Added: pkg/SASxport/.Rproj.user/632EB997/persistent-state =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/persistent-state (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/persistent-state 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,9 @@ +build-last-errors="[]" +build-last-errors-base-dir="~/src/r-gregmisc/SASxport/" +build-last-outputs="[{\"output\":\"==> R CMD INSTALL --no-multiarch --with-keep.source SASxport\\n\\n\",\"type\":0},{\"output\":\"\\n\",\"type\":1},{\"output\":\" Welcome to BI enhanced R!\\n\",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"* installing to library '/home/gwarnes1/Rlib'\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"* installing *source* package 'SASxport' ...\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** libs\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"make: Nothing to be done for `all'.\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"installing to /home/gwarnes1/Rlib/SASxport/libs\\n\",\"type\":1},{\"output\":\"** R\\n\",\"type\":1},{\"output\":\"** data\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** inst\\n\",\"type\":1},{\"output\":\"** preparing package for lazy loading\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** help\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"*** installing help indices\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\" converting help for package 'SASxport'\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\" finding HTML links ...\",\"type\":1},{\"output\":\" Alfalfa html \",\"type\":1},{\"output\":\" done\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\" SASformat html \\n\",\"type\":1},{\"output\":\" SASxport-package html \\n\",\"type\":1},{\"output\":\" lookup.xport html \",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\" makeSASNames html \\n\",\"type\":1},{\"output\":\" read.xport html \",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\" finding level-2 HTML links ...\",\"type\":1},{\"output\":\" done\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\" toSAS html \\n\",\"type\":1},{\"output\":\" write.xport html \",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** building package indices\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"** testing if installed package can be loaded\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\" Welcome to BI enhanced R!\\n\",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\"Loaded SASxport version 1.5.4 (2016-03-25).\\n\",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\" Type `?SASxport' for usage information.\\n\",\"type\":1},{\"output\":\"\\n\",\"type\":1},{\"output\":\"\",\"type\":1},{\"output\":\"* DONE (SASxport)\\n\",\"type\":1},{\"output\":\"\",\"type\":1}]" +compile_pdf_state="{\"errors\":[],\"output\":\"\",\"running\":false,\"tab_visible\":false,\"target_file\":\"\"}" +console_procs="[]" +files.monitored-path="" +find-in-files-state="{\"handle\":\"e4a838ad23774b908d2ef1438703d7ef\",\"input\":\"describe\",\"path\":\"~/src/r-gregmisc/SASxport\",\"regex\":false,\"results\":{\"file\":[\"~/src/r-gregmisc/SASxport/R/testDateTime.R\",\"~/src/r-gregmisc/SASxport/tests/testUnnamedComponents.Rout.save\",\"~/src/r-gregmisc/SASxport/tests/testUnnamedComponents.Rout.save\",\"~/src/r-gregmisc/SASxport/tests/testExamples.Rout.save\",\"~/src/r-gregmisc/SASxport/tests/testExamples.Rout.save\",\"~/src/r-gregmisc/SASxport/man/lookup.xport.Rd\",\"~/src/r-gregmisc/SASxport/man/lookup.xport.Rd\",\"~/src/r-gregmisc/SASxport/man/Alfalfa.Rd\",\"~/src/r-gregmisc/SASxport/man/read.xport.Rd\",\"~/src/r-gregmisc/SASxport/man/read.xport.Rd\",\"~/src/r-gregmisc/SASxport/man/read.xport.Rd\"],\"line\":[8,177,214,470,507,6,8,12,123,202,203],\"lineValue\":[\"## or S-Plus. The following 2 functions are used by describe.vector\",\"rd.xpr> describe(w$TEST) # see labels, format names for dataset test\",\"rd.xpr> lapply(w, describe)# see descriptive stats in more detail for each variable\",\"rd.xpr> describe(w$TEST) # see labels, format names for dataset test\",\"rd.xpr> lapply(w, describe)# see descriptive stats in more detail for each variable\",\"\\\\title{Describe the Contents of an SAS XPORT File}\",\"Describe the contents of an SAS XPORT file.\",\"\\\\describe{\",\"\\\\code{\\\\link[Hmisc]{describe}},\",\"describe(w$TEST) # see labels, format names for dataset test\",\"lapply(w, describe)# see descriptive stats in more detail for each variable\"],\"matchOff\":[[61],[16],[26],[16],[26],[15],[8],[9],[27],[8],[18]],\"matchOn\":[[53],[8],[18],[8],[18],[7],[0],[1],[19],[0],[10]]},\"running\":false}" +imageDirtyState="1" +saveActionState="-1" Added: pkg/SASxport/.Rproj.user/632EB997/saved_source_markers =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/saved_source_markers (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/saved_source_markers 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1 @@ +{"active_set":"","sets":[]} \ No newline at end of file Added: pkg/SASxport/.Rproj.user/632EB997/sdb/mt/3B443731 =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/sdb/mt/3B443731 (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/sdb/mt/3B443731 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,20 @@ +{ + "collab_server" : "", + "contents" : "Package: SASxport\nType: Package\nTitle: Read and Write SAS XPORT Files\nVersion: 1.5.4\nDate: 2016-03-25\nDescription: Functions for reading, listing\n the contents of, and writing SAS xport format files.\n The functions support reading and writing of either\n individual data frames or sets of data frames. Further,\n a mechanism has been provided for customizing how\n variables of different data types are stored.\nAuthor:\n Unless otherwise noted, the contents of this package were written by\n Gregory R. Warnes and are provided under the\n terms of the GNU General Public License, version 2.0 or later.\n --\n The files 'src/ieee2ibm.c' and 'src/ibm2ieee.c' were extracted from\n BRL-CAD file /brlcad/src/libbu/htond.c written by Michael John\n Muuss, Copyright (c) 2004-2007 United States Government as\n represented by the U.S. Army Research Laboratory, and is utilized\n and redistributed under the terms of the GNU Lesser General Public\n License, version 2.1.\n --\n The files 'R/AFirst.lib.s', 'R/all.is.numeric.R',\n 'R/importConvertDateTime.R', 'R/in.opererator.R', 'R/makeNames.R',\n 'R/read.xport.R', and 'R/testDateTime.R' are copied or adapted from the\n 'Hmisc' package created by Frank E. Harrell, Jr.\n , and are utilized and redistributed under\n the terms of the GNU General Public License, version 2.0 or later.\n --\n The files 'R/xport.R', 'src/SASxport.c', 'src/SASxport.h', and\n 'src/foreign.h' are copied or adapted from the R 'foreign' package\n created by Douglas M. Bates and Saikat DebRoy\n , and are utilized and redistributed under the\n terms of the GNU General Public License, version 2.0 or later.\n --\n The creation of this package was partially funded by Metrum Institute\n .\nMaintainer: Gregory R. Warnes \nLicense: GPL-2\nDepends: R (>= 2.4.0), chron, Hmisc\nURL: http://www.warnes.net, http://metruminstitute.org\n", + "created" : 1458935959194.000, + "dirty" : false, + "encoding" : "UTF-8", + "folds" : "", + "hash" : "1001061882", + "id" : "3B443731", + "lastKnownWriteTime" : 1459443295, + "last_content_update" : 1459443295456, + "path" : "~/src/r-gregmisc/SASxport/DESCRIPTION", + "project_path" : "DESCRIPTION", + "properties" : { + }, + "relative_order" : 10, + "source_on_save" : false, + "source_window" : "", + "type" : "dcf" +} \ No newline at end of file Added: pkg/SASxport/.Rproj.user/632EB997/sdb/mt/4ED4AE88 =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/sdb/mt/4ED4AE88 (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/sdb/mt/4ED4AE88 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,20 @@ +{ + "collab_server" : "", + "contents" : "\\name{read.xport}\n\\alias{read.xport}\n\\title{Import a SAS XPORT File}\n\\description{\n Read a SAS XPORT format file and return the contained dataset(s).\n}\n\\usage{\nread.xport(file,\n force.integer=TRUE,\n formats=NULL,\n name.chars=NULL,\n names.tolower=FALSE,\n keep=NULL,\n drop=NULL,\n as.is=0.95,\n verbose=FALSE,\n as.list=FALSE,\n include.formats=FALSE\n )\n}\n\\arguments{\n \\item{file}{Character string specifying the name or URL of a SAS XPORT\n file.\n }\n \\item{force.integer}{Logical flag indicating whether integer-valued\n variables should be returned as integers (\\code{TRUE}) or doubles\n (\\code{FALSE}). Variables outside the supported integer range\n (\\code{.Machine$integer.max}) will always be converted to\n doubles.\n }\n \\item{formats}{a data frame or list (like that created by\n \\code{foreign:::read.xport}) containing \\code{PROC FORMAT}\n output, if such output is not stored in the main transport\n file.\n }\n \\item{name.chars}{Vector of additional characters permissible in\n variable names. By default, only the alpha and numeric\n characters ([A-Za-z0-9]) and periods ('.') are permitted. All\n other characters are converted into periods ('.').\n }\n \\item{names.tolower}{Logical indicating whether variable and dataset\n names should be converted to lowercase (\\code{TRUE}) or left\n uppercase (\\code{FALSE})\n }\n \\item{keep}{a vector of names of SAS datasets to process. This list\n must include \\code{PROC FORMAT} dataset if it is present for\n datasets to use use any of its value label formats.\n }\n \\item{drop}{a vector of names of SAS datasets to ignore (original SAS\n upper case names)\n }\n \\item{as.is}{\n Either a logical flag indicating whether SAS character variables should\n be preserved as character objects (\\code{TRUE}) or factor\n objects (\\code{FALSE}), or a fractional cutoff between 0 and 1.\n\n When a fractional cutoff is provided, character variables\n containing a more than this fraction of unique values will be\n stored as a character variables. This is done in order to\n preserve space, since factors must store both the integer factor\n codes and the character factor labels.\n }\n \\item{verbose}{Logical indicating whether progress should be printed\n during the data loading and conversion process.}\n \\item{as.list}{Logical indicating whether to return a list even if\n the SAS xport file contains only only one dataset.}\n \\item{include.formats}{Logical indicating whether to include SAS\n format information (if present) in the returned list}\n}\n\\value{\n If only a single dataset is present (after removing \\code{PROC FORMAT}\n data when \\code{include.formats=FALSE}), the return value is a single\n dataframe object. Otherwise the return is a list of dataframe objects.\n\n Note that if \\code{include.formats=TRUE}, the returned list will\n contain a dataframe named \"FORMATS\" containing any available 'PROC FORMAT'\n information.\n}\n\\details{\n\n \\itemize{\n \\item SAS date, time, and date/time variables are converted respectively to \\code{Date},\n POSIX, or \\code{chron} objects\n\n \\item SAS labels are stored in \"label\" attributes on each variable,\n and are accessible using the \\code{\\link{label}} function.\n\n \\item SAS formats are stored in \"SASformat\" attributes on each\n variable, and are accessable using \\code{\\link{SASformat}}\n\n \\item SAS iformats are stored in \"SASiformat\" attributes on each\n variable, and are accessable using \\code{\\link{SASiformat}}\n\n \\item SAS integer variables are stored as integers unless\n \\code{force.integer} is \\code{FALSE}\n }\n\n If the file includes the output of \\code{PROC FORMAT CNTLOUT=},\n variables having customized label formats will be converted to \\code{factor}\n objects with appropriate labels.\n\n If a datasets in the original file has a label or type, these will be\n stored in the corresponding 'lable' and 'SAStype' attributes, which\n can be accessed by the \\code{\\link{label}} and \\code{\\link{SAStype}}\n functions.\n}\n\\author{ Gregory R. Warnes \\email{greg at warnes.net}\n based on \\code{Hmisc:::sasxport.get} by Frank E. Harrell, Jr.}\n\\section{Note}{\n This code provides a subset of the functionality of the\n \\code{sasxport.get} function in the Hmisc library.\n}\n\\seealso{\n \\code{\\link[foreign]{read.xport}},\n \\code{\\link{label}},\n \\code{\\link[Hmisc]{sas.get}},\n \\code{\\link[Hmisc]{sasxport.get}},\n \\code{\\link{Dates}},\n \\code{\\link{DateTimeClasses}},\n \\code{\\link[chron]{chron}},\n \\code{\\link[foreign]{lookup.xport}},\n \\code{\\link[Hmisc]{contents}},\n \\code{\\link[Hmisc]{describe}},\n \\code{\\link{label}},\n \\code{\\link{SASformat}},\n \\code{\\link{SASiformat}}, and\n \\code{\\link{SAStype}}\n}\n\\examples{\n\n## -------\n## SAS code to generate test dataset:\n## -------\n## libname y SASV5XPT \"test2.xpt\";\n##\n## PROC FORMAT; VALUE race 1=green 2=blue 3=purple; RUN;\n## PROC FORMAT CNTLOUT=format;RUN; * Name, e.g. 'format', unimportant;\n## data test;\n## LENGTH race 3 age 4;\n## age=30; label age=\"Age at Beginning of Study\";\n## race=2;\n## d1='3mar2002'd ;\n## dt1='3mar2002 9:31:02'dt;\n## t1='11:13:45't;\n## output;\n##\n## age=31;\n## race=4;\n## d1='3jun2002'd ;\n## dt1='3jun2002 9:42:07'dt;\n## t1='11:14:13't;\n## output;\n## format d1 mmddyy10. dt1 datetime. t1 time. race race.;\n## run;\n## data z; LENGTH x3 3 x4 4 x5 5 x6 6 x7 7 x8 8;\n## DO i=1 TO 100;\n## x3=ranuni(3);\n## x4=ranuni(5);\n## x5=ranuni(7);\n## x6=ranuni(9);\n## x7=ranuni(11);\n## x8=ranuni(13);\n## output;\n## END;\n## DROP i;\n## RUN;\n## PROC MEANS; RUN;\n## PROC COPY IN=work OUT=y;SELECT test format z;RUN; *Creates test2.xpt;\n## ------\n\n## Read this dataset from a local file:\ntestFile <- system.file('extdata', 'test2.xpt', package=\"SASxport\")\nw <- read.xport(testFile)\nclass(w)\nsapply(w, head)\n\n\\dontrun{\n## Or read a copy of test2.xpt available on the web:\nurl <- 'http://biostat.mc.vanderbilt.edu/wiki/pub/Main/Hmisc/test2.xpt'\nw <- read.xport(url)\n}\n\n## We can also get the dataset wrapped in a list\nw <- read.xport(testFile, as.list=TRUE)\nclass(w)\nsapply(w, head)\n\n## And we can ask for the format information to be included as well.\nw <- read.xport(testFile, as.list=TRUE, include.formats=TRUE)\nclass(w)\nsapply(w, head)\n\n\\dontshow{\nstopifnot( is.data.frame(w)==FALSE && is.list(w)==TRUE )\n}\n\n\n#### The Hmisc library provides many useful functions for interacting with\n#### data imported from SAS via read.xport()\nlibrary(Hmisc)\n\ndescribe(w$TEST) # see labels, format names for dataset test\nlapply(w, describe, \"\")# see descriptive stats in more detail for each variable\n\ncontents(w$TEST) # another way to see variable attributes\nlapply(w, contents)# show contents of individual items in more detail\n\noptions(digits=7) # compare the following matrix with PROC MEANS output\nt(sapply(w$Z, function(x)\n c(Mean=mean(x),SD=sqrt(var(x)),Min=min(x),Max=max(x))))\n\n}\n\\keyword{interface}\n\\keyword{manip}\n", + "created" : 1458943228870.000, + "dirty" : false, + "encoding" : "UTF-8", + "folds" : "", + "hash" : "683503986", + "id" : "4ED4AE88", + "lastKnownWriteTime" : 1458943411, + "last_content_update" : 1458943411733, + "path" : "~/src/r-gregmisc/SASxport/man/read.xport.Rd", + "project_path" : "man/read.xport.Rd", + "properties" : { + }, + "relative_order" : 3, + "source_on_save" : false, + "source_window" : "", + "type" : "r_doc" +} \ No newline at end of file Added: pkg/SASxport/.Rproj.user/632EB997/sdb/mt/91BF8EB8 =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/sdb/mt/91BF8EB8 (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/sdb/mt/91BF8EB8 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,20 @@ +{ + "collab_server" : "", + "contents" : "\\name{write.xport}\n\\alias{write.xport}\n\\title{Write Data to a SAS XPORT File}\n\\description{\n This function writes one or more data frames into a SAS XPORT format\n library file.\n}\n\\usage{\nwrite.xport(...,\n list=base::list(),\n file = stop(\"'file' must be specified\"),\n verbose=FALSE,\n sasVer=\"7.00\",\n osType,\n cDate=Sys.time(),\n formats=NULL,\n autogen.formats=TRUE\n )\n}\n\\arguments{\n \\item{\\dots}{One or more data frames to be stored}\n \\item{list}{A list containing data frames to be stored.}\n \\item{file}{File name or connection object. Use \"\" to view the raw data}\n \\item{verbose}{Logical flag controlling whether status is reported\n during processing}\n \\item{sasVer}{SAS version string}\n \\item{osType}{Opererating system, defaults to \"R X.Y.Z\" for\n appropriate values of X, Y, and Z}\n \\item{cDate}{Date object specifying dataset creation date}\n \\item{formats}{Optional data frame containing SAS format information.}\n \\item{autogen.formats}{Logical indiciating whether SAS formats should be\n auto-generated for factor variables.}\n}\n\\details{\n The function creates a SAS XPORT data file (see reference) from one or\n more data frames. This file format imposes a number of constraints:\n \\itemize{\n \\item Data set and variable names are truncated to 8 characters and\n converted to upper case. All characters outside of the set A-Z,\n 0-9, and '\\_' are converted to '\\_'.\n \\item Character variables are stored as characters.\n \\item If \\code{autogen.formats=TRUE} (the default), factor variables\n are stored as numeric with an appropriate SAS format\n specification. If \\code{autogen.formats=FALSE}, factor variables\n are stored as characters.\n \\item All numeric variables are stored as double-precision floating\n point values utilizing the IBM mainframe double precision floating\n point format (see the reference).\n \\item Date and time variables are either converted to number of days since\n 1960-01-01 (date only), or number of seconds since\n 1960-01-01:00:00:00 GMT (date-time variables).\n \\item Missing values are converted to the standard SAS missing value\n '.'\n }\n\n The SAS XPORT format allows each dataset to have a label and a type\n (set via the \\code{\\link{label}} and \\code{\\link{SAStype}} functions).\n In addition, each variable may have a corresponding label, display\n format, and input format. To set these values, add the attribute\n 'label', 'SASformat', or 'SASiformat' to individual data frame. These\n attributes may be set using the \\code{\\link{label}},\n \\code{\\link{SASformat}}, and \\code{\\link{SASiformat}} functions. (See\n examples provided below.)\n\n The actual translation of R objects to objects appropriate for SAS is\n handled by the \\code{\\link{toSAS}} generic and associated methods,\n which can be (re)defined by the user to provide fine-grained control.\n}\n\\value{\n No return value\n}\n\\references{\n SAS Technical Support document TS-140: ``The Record Layout of a\n Data Set in SAS Transport (XPORT) Format'' available at\n \\url{https://support.sas.com/techsup/technote/ts140.pdf}.\n}\n\\author{Gregory R. Warnes \\email{greg at warnes.net}}\n\\note{\n This package was created with partial funding by Metrum Institute\n \\url{http://metruminstitute.org}.\n}\n\\seealso{\n \\code{\\link{toSAS}},\n \\code{\\link{lookup.xport}},\n \\code{\\link{read.xport}},\n \\code{\\link{label}},\n \\code{\\link{SAStype}},\n \\code{\\link{SASformat}},\n and \\code{\\link{SASiformat}}\n}\n\\examples{\n\n#####\n## R version of the example given in TS-140\n#####\n\n## manually create a data set\nabc <- data.frame( x=c(1, 2, NA, NA ), y=c('a', 'B', NA, '*' ) )\n\n## look at it\nabc\n\n## add a format specifier (not used by R)\nSASformat(abc$x) <- 'date7.'\n\n## add a variable label (not used by R)\nlabel(abc$y) <- 'character variable'\n\n## add a dataset label and type\nlabel(abc) <- 'Simple example'\nSAStype(abc) <- 'MYTYPE'\n\n## verify the additions\nstr(abc)\n\n# create a SAS XPORT file\nwrite.xport( abc, file=\"xxx.dat\" )\n\n# list the contents of the file\nlookup.xport(\"xxx.dat\")\n\n## reload the data\nxxx.abc <- read.xport(\"xxx.dat\")\n\n## and look at it\nxxx.abc\n\n## Check the label and type\nlabel(xxx.abc)\nSAStype(xxx.abc)\n\n## Note that the variable names and SAS dataset type have been converted\n## to uppercase\n\n}\n\\keyword{file}\n", + "created" : 1458944642352.000, + "dirty" : false, + "encoding" : "UTF-8", + "folds" : "", + "hash" : "4280707758", + "id" : "91BF8EB8", + "lastKnownWriteTime" : 1458944650, + "last_content_update" : 1458944650962, + "path" : "~/src/r-gregmisc/SASxport/man/write.xport.Rd", + "project_path" : "man/write.xport.Rd", + "properties" : { + }, + "relative_order" : 4, + "source_on_save" : false, + "source_window" : "", + "type" : "r_doc" +} \ No newline at end of file Added: pkg/SASxport/.Rproj.user/632EB997/sdb/mt/B97C53CF =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/sdb/mt/B97C53CF (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/sdb/mt/B97C53CF 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,20 @@ +{ + "collab_server" : "", + "contents" : "useDynLib(SASxport, .registration=TRUE)\n\nimportFrom(chron, chron, times)\nimportFrom(utils, packageDescription)\nimportFrom(Hmisc, label, label.default, \"label<-\", \"label<-.default\")\nimportFrom(utils, download.file)\n\nexport(\n toSAS,\n lookup.xport,\n read.xport,\n write.xport,\n ## \"label\",\n ## \"label<-\",\n\n makeSASNames,\n\n \"SASformat\",\n \"SASformat<-\",\n\n \"SASiformat\",\n \"SASiformat<-\",\n\n \"SAStype\",\n \"SAStype<-\"\n)\n\nS3method(toSAS, numeric)\nS3method(toSAS, logical)\nS3method(toSAS, character)\nS3method(toSAS, factor)\nS3method(toSAS, chron)\nS3method(toSAS, POSIXt)\nS3method(toSAS, Date)\nS3method(toSAS, default)\n\n## S3method(label, default)\nS3method(SASformat, default)\nS3method(SASiformat, default)\nS3method(SAStype, default)\n\n## S3method(label, data.frame)\nS3method(SASformat, data.frame)\nS3method(SASiformat, data.frame)\n##S3method(SAStype, data.frame)\n\n## S3method(\"label<-\", default)\nS3method(\"SASformat<-\", default)\nS3method(\"SASiformat<-\", default)\nS3method(\"SAStype<-\", default)\n\n## S3method(\"label<-\", data.frame)\nS3method(\"SASformat<-\", data.frame)\nS3method(\"SASiformat<-\", data.frame)\n##S3method(\"SAStype<-\", data.frame)\n\nS3method(print, lookup.xport)\nS3method(summary, lookup.xport)\nS3method(print, summary.lookup.xport)\n\n", + "created" : 1458944711911.000, + "dirty" : false, + "encoding" : "UTF-8", + "folds" : "", + "hash" : "1759035676", + "id" : "B97C53CF", + "lastKnownWriteTime" : 1458944725, + "last_content_update" : 1458944725295, + "path" : "~/src/r-gregmisc/SASxport/NAMESPACE", + "project_path" : "NAMESPACE", + "properties" : { + }, + "relative_order" : 5, + "source_on_save" : false, + "source_window" : "", + "type" : "r_namespace" +} \ No newline at end of file Added: pkg/SASxport/.Rproj.user/632EB997/sdb/mt/EB1F71A0 =================================================================== --- pkg/SASxport/.Rproj.user/632EB997/sdb/mt/EB1F71A0 (rev 0) +++ pkg/SASxport/.Rproj.user/632EB997/sdb/mt/EB1F71A0 2016-08-12 17:38:13 UTC (rev 2135) @@ -0,0 +1,20 @@ +{ + "collab_server" : "", [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/r-gregmisc -r 2135 From noreply at r-forge.r-project.org Mon Aug 15 21:02:47 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 15 Aug 2016 21:02:47 +0200 (CEST) Subject: [R-gregmisc-commits] r2136 - pkg/SASxport/man Message-ID: <20160815190247.3EF2C18444D@r-forge.r-project.org> Author: warnes Date: 2016-08-15 21:02:45 +0200 (Mon, 15 Aug 2016) New Revision: 2136 Modified: pkg/SASxport/man/write.xport.Rd Log: Update URL to SAS Tech Report Modified: pkg/SASxport/man/write.xport.Rd =================================================================== --- pkg/SASxport/man/write.xport.Rd 2016-08-12 17:38:13 UTC (rev 2135) +++ pkg/SASxport/man/write.xport.Rd 2016-08-15 19:02:45 UTC (rev 2136) @@ -18,7 +18,7 @@ ) } \arguments{ - \item{\dots}{One or more data frames to be stored} + \item{\dots}{One or more data frames to be stored} \item{list}{A list containing data frames to be stored.} \item{file}{File name or connection object. Use "" to view the raw data} \item{verbose}{Logical flag controlling whether status is reported @@ -48,7 +48,7 @@ point format (see the reference). \item Date and time variables are either converted to number of days since 1960-01-01 (date only), or number of seconds since - 1960-01-01:00:00:00 GMT (date-time variables). + 1960-01-01:00:00:00 GMT (date-time variables). \item Missing values are converted to the standard SAS missing value '.' } @@ -72,12 +72,12 @@ \references{ SAS Technical Support document TS-140: ``The Record Layout of a Data Set in SAS Transport (XPORT) Format'' available at - \url{http://ftp.sas.com/techsup/download/technote/ts140.html}. + \url{https://support.sas.com/techsup/technote/ts140.pdf}. } \author{Gregory R. Warnes \email{greg at warnes.net}} \note{ This package was created with partial funding by Metrum Institute - \url{http://metruminstitute.org}. + \url{http://metruminstitute.org}. } \seealso{ \code{\link{toSAS}}, @@ -86,7 +86,7 @@ \code{\link{label}}, \code{\link{SAStype}}, \code{\link{SASformat}}, - and \code{\link{SASiformat}} + and \code{\link{SASiformat}} } \examples{ @@ -113,7 +113,7 @@ ## verify the additions str(abc) -# create a SAS XPORT file +# create a SAS XPORT file write.xport( abc, file="xxx.dat" ) # list the contents of the file From noreply at r-forge.r-project.org Mon Aug 15 21:05:25 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 15 Aug 2016 21:05:25 +0200 (CEST) Subject: [R-gregmisc-commits] r2137 - pkg/gmodels/R Message-ID: <20160815190526.000F3188084@r-forge.r-project.org> Author: warnes Date: 2016-08-15 21:05:23 +0200 (Mon, 15 Aug 2016) New Revision: 2137 Added: pkg/gmodels/R/est_p_ci.R Log: Add est_p_ci generic and lm method Added: pkg/gmodels/R/est_p_ci.R =================================================================== --- pkg/gmodels/R/est_p_ci.R (rev 0) +++ pkg/gmodels/R/est_p_ci.R 2016-08-15 19:05:23 UTC (rev 2137) @@ -0,0 +1,47 @@ +est_p_ci <- function(model, term, mult=1, digits=2, ...) + UseMethod("est_p_ci") + +est_p_ci.lm <- function(model, term, mult=1, digits=2, ...) +{ + info <- ci(model) + if(is.character(term) && !(term %in% rownames(info))) + stop(term, " is not a coefficient in model.") + info <- info[term,] + info.ci <- trim(format( round(mult * info[1:3], digits=digits) )) + if(mult < 0) + names(info.ci) <- rev(names(info.ci)) + paste("Est=", info.ci[1], + " ", + "p=",format.pval(info['p-value'], digits=digits), + " ", + "95% CI: ", + info.ci['CI lower'], + " to ", + info.ci['CI upper'], + sep="" + ) +} + +est_p_ci.fit_contrast <- function(model, term, mult=1, digits=2, ...) +{ + if( !all(c("lower CI", "upper CI") %in% colnames(model) ) ) + stop("object does not contain confidence interval information.") + + if(is.character(term) && !(term %in% rownames(info))) + stop(term, " is not a coefficient in model.") + + info.ci <- trim(format( round(mult * model[term, c("lower CI", "upper CI")], + digits=digits) ) ) + if(mult < 0) + names(info.ci) <- rev(names(info.ci)) + paste("Est=", info.ci[1], + " ", + "p=",format.pval(model[term, 'Pr(>|t|)'], digits=digits), + " ", + "95% CI: ", + info.ci["lower CI"], + " to ", + info.ci["upper CI"], + sep="" + ) +} From noreply at r-forge.r-project.org Mon Aug 15 21:11:04 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 15 Aug 2016 21:11:04 +0200 (CEST) Subject: [R-gregmisc-commits] r2138 - in pkg/gmodels: . test Message-ID: <20160815191104.D9E1A188077@r-forge.r-project.org> Author: warnes Date: 2016-08-15 21:11:04 +0200 (Mon, 15 Aug 2016) New Revision: 2138 Added: pkg/gmodels/test/ pkg/gmodels/test/lme-test.R pkg/gmodels/test/test_estimable_mlm.R Log: Add tests for mlm and (obsolete) lme Added: pkg/gmodels/test/lme-test.R =================================================================== --- pkg/gmodels/test/lme-test.R (rev 0) +++ pkg/gmodels/test/lme-test.R 2016-08-15 19:11:04 UTC (rev 2138) @@ -0,0 +1,77 @@ +library(gmodels) +library(lme4) +set.seed(314159) + +sleepstudy$dayGroup <- cut(sleepstudy$Days, seq(-1,9,by=2), include=T) + +fm2 <- lmer(Reaction ~ dayGroup + (1|Subject) + (0+Days|Subject), sleepstudy) + +# ci example +#!!# 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... + + +# 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)) + +fit1 <- lmer(area ~ sex*season + (1|animal), data=homerange) +summary(fit1) +anova(fit1) + + +#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) Added: pkg/gmodels/test/test_estimable_mlm.R =================================================================== --- pkg/gmodels/test/test_estimable_mlm.R (rev 0) +++ pkg/gmodels/test/test_estimable_mlm.R 2016-08-15 19:11:04 UTC (rev 2138) @@ -0,0 +1,15 @@ +library(gmodels) + +y <- cbind(rnorm(100), rnorm(100)) + +x1 <- rnorm(100) +x2 <- rnorm(100) + +cm <- t(matrix(c(0, 1,-1))) +lm.1 <- lm(y ~ x1 + x2) + +estimable(lm.1, cm) + +## >> Error in coef(object) : object 'object' not found + +gmodels:::estimable.mlm(lm.1, cm) From noreply at r-forge.r-project.org Mon Aug 15 21:13:14 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 15 Aug 2016 21:13:14 +0200 (CEST) Subject: [R-gregmisc-commits] r2139 - pkg/gtools/src Message-ID: <20160815191314.EF97118808E@r-forge.r-project.org> Author: warnes Date: 2016-08-15 21:13:14 +0200 (Mon, 15 Aug 2016) New Revision: 2139 Modified: pkg/gtools/src/setTCPNoDelay.c Log: checkStatus() was not correctly getting the error message. Modified: pkg/gtools/src/setTCPNoDelay.c =================================================================== --- pkg/gtools/src/setTCPNoDelay.c 2016-08-15 19:11:04 UTC (rev 2138) +++ pkg/gtools/src/setTCPNoDelay.c 2016-08-15 19:13:14 UTC (rev 2139) @@ -98,7 +98,7 @@ ); - checkStatus(*status, status_str[0], *status_len); + checkStatus(errno, status_str[0], *status_len); return; } From noreply at r-forge.r-project.org Mon Aug 15 21:14:10 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 15 Aug 2016 21:14:10 +0200 (CEST) Subject: [R-gregmisc-commits] r2140 - pkg/gtools/R Message-ID: <20160815191410.A7ADE18808E@r-forge.r-project.org> Author: warnes Date: 2016-08-15 21:14:10 +0200 (Mon, 15 Aug 2016) New Revision: 2140 Modified: pkg/gtools/R/setTCPNoDelay.R Log: Modify setTCPNoDelay to work with current socket objects Modified: pkg/gtools/R/setTCPNoDelay.R =================================================================== --- pkg/gtools/R/setTCPNoDelay.R 2016-08-15 19:13:14 UTC (rev 2139) +++ pkg/gtools/R/setTCPNoDelay.R 2016-08-15 19:14:10 UTC (rev 2140) @@ -5,7 +5,11 @@ buffer <- paste(rep(" ", 1000), sep='', collapse='') - conn <- getConnection(socket[1]) + if("sockconn" %in% class(socket)) + conn <- getConnection(socket[1]) + else + conn <- socket + retval <- .C("R_setTCPNoDelay", socket=as.integer(socket[1]), From noreply at r-forge.r-project.org Mon Aug 15 21:14:50 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 15 Aug 2016 21:14:50 +0200 (CEST) Subject: [R-gregmisc-commits] r2141 - pkg/gtools/tests Message-ID: <20160815191450.4770018808E@r-forge.r-project.org> Author: warnes Date: 2016-08-15 21:14:49 +0200 (Mon, 15 Aug 2016) New Revision: 2141 Added: pkg/gtools/tests/test_setTCPNoDelay.R Log: Add test code for setTCPNoDelay Added: pkg/gtools/tests/test_setTCPNoDelay.R =================================================================== --- pkg/gtools/tests/test_setTCPNoDelay.R (rev 0) +++ pkg/gtools/tests/test_setTCPNoDelay.R 2016-08-15 19:14:49 UTC (rev 2141) @@ -0,0 +1,44 @@ +library('gtools') + +setTCPNoDelay <- function( socket, value=TRUE ) +{ + if(!any(c("socket","sockconn") %in% class(socket))) + stop("socket must be a socket object") + + buffer <- paste(rep(" ", 1000), sep='', collapse='') + + if("sockconn" %in% class(socket)) + conn <- getConnection(socket[1]) + else + conn <- socket + + + retval <- .C("R_setTCPNoDelay", + socket=as.integer(socket[1]), + flag=as.integer(value), + status=integer(1), + status.str=as.character(buffer), + status.len=as.integer(nchar(buffer)), + package="gtools" + ) + + if(retval$status != 0) + stop( retval$status.str ) + else + invisible(retval$status.str) +} + + + +host <- "rdgas05026.am.boehringer.com" +#host <- "www.r-project.org" +socket <- make.socket(host, 80) +print(socket) +setTCPNoDelay(socket, TRUE) + +write.socket(socket, "GET /\n\n") +while( (str <- read.socket(socket)) > "") + cat(str) +close.socket(socket) + +read.socket(socket) \ No newline at end of file From noreply at r-forge.r-project.org Mon Aug 15 21:16:11 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 15 Aug 2016 21:16:11 +0200 (CEST) Subject: [R-gregmisc-commits] r2142 - pkg/gtools Message-ID: <20160815191612.0EF5818804E@r-forge.r-project.org> Author: warnes Date: 2016-08-15 21:16:11 +0200 (Mon, 15 Aug 2016) New Revision: 2142 Modified: pkg/gtools/DESCRIPTION Log: Update version number and date Modified: pkg/gtools/DESCRIPTION =================================================================== --- pkg/gtools/DESCRIPTION 2016-08-15 19:14:49 UTC (rev 2141) +++ pkg/gtools/DESCRIPTION 2016-08-15 19:16:11 UTC (rev 2142) @@ -22,8 +22,8 @@ - efficient 'rbind' of data frames, even if the column names don't match ('smartbind'), - generate significance stars from p-values ('stars.pval'), - convert characters to/from ASCII codes. -Version: 3.6.0 -Date: 2015-08-07 +Version: 3.6.2 +Date: 2016-08-15 Author: Gregory R. Warnes, Ben Bolker, and Thomas Lumley Maintainer: Gregory R. Warnes License: GPL-2 From noreply at r-forge.r-project.org Mon Aug 15 21:17:44 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 15 Aug 2016 21:17:44 +0200 (CEST) Subject: [R-gregmisc-commits] r2143 - pkg/gtools/inst Message-ID: <20160815191744.9771918804E@r-forge.r-project.org> Author: warnes Date: 2016-08-15 21:17:44 +0200 (Mon, 15 Aug 2016) New Revision: 2143 Modified: pkg/gtools/inst/ChangeLog Log: Update ChangeLog Modified: pkg/gtools/inst/ChangeLog =================================================================== --- pkg/gtools/inst/ChangeLog 2016-08-15 19:16:11 UTC (rev 2142) +++ pkg/gtools/inst/ChangeLog 2016-08-15 19:17:44 UTC (rev 2143) @@ -1,5 +1,82 @@ +2016-08-15 warnes + + * [r2142] DESCRIPTION: Update version number and date + * [r2141] tests/test_setTCPNoDelay.R: Add test code for + setTCPNoDelay + * [r2140] R/setTCPNoDelay.R: Modify setTCPNoDelay to work with + current socket objects + * [r2139] src/setTCPNoDelay.c: checkStatus() was not correctly + getting the error message. + +2016-04-22 warnes + + * [r2127] NAMESPACE, R/capwords.R, man/capwords.Rd: Add capwords() + function to properly capatilize strings for use in titles + * [r2126] R/na.replace.R, man/na.replace.Rd: na.replace() now + accepts a function providing the replcement value. + +2015-11-24 warnes + + * [r2071] R/smartbind.R: Correct error when column types don't + match (reported by + +2015-10-15 warnes + + * [r2069] R/smartbind.R: smartbind() was not properly handling + columsn that were numeric on one df and character in the other + and other similar ctype conflicts. Fixed. + +2015-08-08 warnes + + * [r2067] tests/smartbind_emptynames.R: Add half-hearted test file + * [r2066] R/smartbind.R: - Improve assignment of default names in + smartbind. + - Disambiguate 'list' into an object named 'list' and the + function + base::list() in smartbind(). + * [r2065] DESCRIPTION, man/smartbind.Rd: Add example of using + 'list' argument to smartbind() man page. + * [r2064] R/smartbind.R, man/smartbind.Rd: - smartbind() gets a new + argument 'list' to pass a list of data + frames, instead of/in addition to data frames as arguments. + - Fix bug in smartbind's handling of factor levels. + + +2015-07-14 warnes + + * [r2057] R/loadedPackages.R, man/loadedPackages.Rd: Modify + loadedPackages() to return data silently so that the results + don't get printed twice. + 2015-05-27 warnes + * [r2049] data/badDend.rda, man/badDend.Rd, man/unByteCode.Rd: + Create local dataset to use in the example code for unByteCode + instead of relying on web access. + * [r2048] R/trimws.R: Fix missing closing paren. + * [r2047] R/keywords.R, R/roman2int.R, R/trim.R, R/trimws.R: Two + functions in gtools need to use either gdata::trim() or + base::trimws() (added in R 3.2.0). The previous solution was to + include gdata/R/gdata/R/trim.R in gtools using a symbolic link. + + Unfortunately, Rforge doesn't seem to like the symbolic link when + building packages, and generates an error. + + So, instead, create the file trimws.R, which creates trimws() if + it + isn't already available (e.g. via base::trimws), and modify + keywords() + and roman2int() to use trimws() instead of gdata::trim(). + * [r2046] man/roman2int.Rd: Add man page for roman2int(). + * [r2045] man/mixedsort.Rd: Remove extraneous closing paren. + * [r2044] NAMESPACE: Add roman2int() to exported function list. + * [r2043] R/asc.R: Looks like we also lost the change of argument + name to chr(). Fixed. + * [r2042] R/asc.R: Somehow lost 'simplify=TRUE' argument to asc. + Fixed. + * [r2041] DESCRIPTION: Update gtools version number to 3.5.0 + * [r2040] DESCRIPTION, inst/ChangeLog, inst/NEWS: Update + DESCRIPTION, ChangeLog, NEWS * [r2039] R/mixedsort.R, man/mixedsort.Rd: Add roman numeral support to mixedorder() and mixedsort(). * [r2037] man/asc.Rd: Add asc() and chr() functions for converting From noreply at r-forge.r-project.org Wed Aug 24 21:48:15 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 24 Aug 2016 21:48:15 +0200 (CEST) Subject: [R-gregmisc-commits] r2144 - pkg/gtools/tests Message-ID: <20160824194815.1FC4D187E0D@r-forge.r-project.org> Author: warnes Date: 2016-08-24 21:48:14 +0200 (Wed, 24 Aug 2016) New Revision: 2144 Modified: pkg/gtools/tests/test_setTCPNoDelay.R Log: Add more testing code. Modified: pkg/gtools/tests/test_setTCPNoDelay.R =================================================================== --- pkg/gtools/tests/test_setTCPNoDelay.R 2016-08-15 19:17:44 UTC (rev 2143) +++ pkg/gtools/tests/test_setTCPNoDelay.R 2016-08-24 19:48:14 UTC (rev 2144) @@ -37,8 +37,7 @@ setTCPNoDelay(socket, TRUE) write.socket(socket, "GET /\n\n") +write.socket(socket, "A\0B\n") while( (str <- read.socket(socket)) > "") cat(str) close.socket(socket) - -read.socket(socket) \ No newline at end of file