From noreply at r-forge.r-project.org Sat May 2 19:41:05 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sat, 2 May 2015 19:41:05 +0200 (CEST) Subject: [R-gregmisc-commits] r1626 - / Message-ID: <20150502174105.97411186DC1@r-forge.r-project.org> Author: warnes Date: 2015-05-02 19:41:05 +0200 (Sat, 02 May 2015) New Revision: 1626 Removed: pkg/ Log: Remove pkg directory from R-forge repository--mirror it from sourceforge instead. From noreply at r-forge.r-project.org Sat May 2 19:55:03 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sat, 2 May 2015 19:55:03 +0200 (CEST) Subject: [R-gregmisc-commits] r1627 - / branches Message-ID: <20150502175503.D8658187904@r-forge.r-project.org> Author: warnes Date: 2015-05-02 19:55:03 +0200 (Sat, 02 May 2015) New Revision: 1627 Added: branches/gplots-release_2_3_0/ Removed: gplots-release_2_3_0/ Log: move branch into the correct directory From noreply at r-forge.r-project.org Tue May 26 18:22:51 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 26 May 2015 18:22:51 +0200 (CEST) Subject: [R-gregmisc-commits] r2030 - pkg/gtools/inst Message-ID: <20150526162252.11FEB18796C@r-forge.r-project.org> Author: warnes Date: 2015-05-26 18:22:51 +0200 (Tue, 26 May 2015) New Revision: 2030 Added: pkg/gtools/inst/ChangeLog Log: Add changelog to svn repository Added: pkg/gtools/inst/ChangeLog =================================================================== --- pkg/gtools/inst/ChangeLog (rev 0) +++ pkg/gtools/inst/ChangeLog 2015-05-26 16:22:51 UTC (rev 2030) @@ -0,0 +1,811 @@ +2015-05-25 warnes + + * [r2029] tests/test_ddirichlet.R: Add library call. + * [r2028] man/unByteCode.Rd: Fix typo and add documentation for + argument 'name'. + * [r2027] man/mixedsort.Rd: Fix typo. + * [r2026] man/mixedsort.Rd: Add description of blanklast argument, + fix typo. + * [r2025] man/quantcut.Rd: Change usage to match actual definition. + * [r2024] man/mixedsort.Rd: Note characters sorting ignores case. + * [r2023] man/mixedsort.Rd: Remove '...' from arglist to match + source code. + * [r2022] man/mixedsort.Rd: Replace unicode quotes with \code{..}. + +2015-05-23 warnes + + * [r2021] tests/test_ddirichlet.R: Add regression test ddirichlet() + bug for x[i]=0, alpha[i]=1: + ddirichlet(x, alpha) was returning NA rather than 0. + * [r2020] R/dirichlet.R: ddirichlet() was incorrectly returning NA + when x[i]=0 and + alpha[i]=1. In this case, the one calculation became (-Inf * 0), + which R evaluates to NaN. The correction is to detect this case + and + substitute -Inf instead of NaN. + +2015-05-08 warnes + + * [r2019] R/mixedsort.R: Summary: Speed up mixedorder by moving + suppressWarnings outside of + lapply loops. (Suggestion by Henrik Bengtsson.) + +2015-05-02 warnes + + * [r2018] Rename 'trunk' to 'pkg' for compatibility with R-forge + * [r2017] Minor layout change. + * [r2016] Remove stray 'svn' that was inserted into the code. + * [r2015] Add man page for unByteCode(), assignEdgeWise(), and + unByteCodeAssign() + +2015-04-28 warnes + + * [r1976] Changes to mixedsort(): + - Hands off objects that are not character vectors to the default + sort. + - Add 'decreasing', 'na.last', and 'blank.last' arguments. + * [r1975] Add private function 'checkReverseDependencies'. + +2015-04-23 warnes + + * [r1950] Update NEWS and ChangeLog + * [r1949] - The 'q' argument to quantcut()'s 'q' now accept an + integer + indicating the number of equally spaced quantile groups to + create. (Suggestion and patch submitted by Ryan C. Thompson.) + * [r1946] Revers accidental text deletion: + * [r1945] Update for gtools 3.4.3 + * [r1944] Remove debugging code and stray browser() call + +2015-04-14 warnes + + * [r1923] Fix typo + +2015-04-09 warnes + + * [r1921] Update gtools ChangeLog + * [r1920] Move first()/last()/left()/right() to gdata. + Add new functions na.replace() and loadedPackages(). + Add more text to package description. + +2015-04-08 warnes + + * [r1919] Move first/last/left/right to from gtools to gdata + +2015-04-06 warnes + + * [r1918] Correct URL + * [r1917] Update NEWS and ChangeLog for gtools 3.5.0 + * [r1916] Add ChangeLog files to repository + * [r1915] Implement fix to keywords() needed for R-3.4.1, as + suggested by Kurt + Hornik. + * [r1914] - Export S3 methods for first(), last(), left() and + right(). + - Ensure code matches man page for first(), last(), left(), and + right(). + +2014-10-09 warnes + + * [r1897] Update for 3.5.0 release of gtools + * [r1896] Make right() and left() S3 methods for classes data.frame + and matrix + +2014-08-27 warnes + + * [r1872] Fix man page + * [r1871] Finish adding first(), last(), left(), and right(). + * [r1870] Add functions first(), last(), left(), and right(). + +2014-05-28 warnes + + * [r1816] Update for gtools 3.4.1 + * [r1815] Add test to ensure smartbind() properly handles Date + columns. + * [r1814] smartbind: Convert non-native type columns (except + factor) to character. + +2014-04-18 arnima + + * [r1813] Main arg is 'x' like showNonASCII(x), preformatted notes + instead of verb + +2014-04-17 warnes + + * [r1810] Update ASCIIfy man page to match source code and add + keywords + * [r1809] Update NEWS for gtools 3.4.0 + * [r1808] Add ASCIIfy function posted to RDevel by Arni Magnusson + +2014-03-01 warnes + + * [r1776] Fix cut-and-paste error. + * [r1775] Update files for gtools 3.3.1 release + * [r1774] Fix bug in gtools::mixedorder regular expression for + regognizing numbers. (Periods weren't escaped). + +2014-02-11 warnes + + * [r1773] Create and use locate copy of tools:::.split_op_version. + * [r1772] Update for gtools 3.3.0. + * [r1771] Fix arguments + * [r1770] Update arguments to match code. + * [r1769] Add getDependencies() function to return a list of + package dependencies. + +2014-01-14 warnes + + * [r1768] Update for bug-fix release + * [r1767] Add test file for binsearch() function. + * [r1766] Fixed bug where binsearch() returned the wrong endpoint & + value when the found value was at the upper endpoint. + +2014-01-13 warnes + + * [r1765] Fix typo + +2014-01-11 warnes + + * [r1764] Update for gtools release 3.2.0 + * [r1763] fixes for R CMD check + * [r1762] Fixes for gtools release 3.2.0 + +2013-12-23 warnes + + * [r1761] Extend the keywords() function to return keywords + associated with a specified topic via 'keywords(topic)'. + * [r1760] Add keyword. + * [r1759] Add stars.pval() function to convert p-values into + significance symbols. + +2013-11-26 warnes + + * [r1748] mixedorder() was failing to correctly handle numbers + including + decimals due to a faulty regular expression. Prior to the fix: + + > drr + [1] "Dose 0.3 mg" "Dose 0.04 mg" "Dose 0.5 mg" + > gtools::mixedsort(drr) + [1] "Dose 0.3 mg" "Dose 0.04 mg" "Dose 0.5 mg" + + After the fix: + + > drr + [1] "Dose 0.3 mg" "Dose 0.04 mg" "Dose 0.5 mg" + > mixedsort(drr) + [1] "Dose 0.04 mg" "Dose 0.3 mg" "Dose 0.5 mg" + + In addition, an optimization was added that checked if the input + vector + was numeric. If so, simply use the existing base::order function. + +2013-11-18 warnes + + * [r1747] Use ".Deprecated" instead of warning. + +2013-11-06 warnes + + * [r1746] Update files for gtools 3.1.1 + * [r1745] Fix problem with mixedorder/mixedsort when there is only + zero or one elements in the vector. + +2013-09-23 warnes + + * [r1716] Comment out empty sections in gtools-deprecated.Rd + * [r1715] Update files for gtools 3.1.0 release + * [r1714] Make 'addLast()' defunct. + * [r1713] Mark 'addLast()' as defunct and move 'lastAdd()' function + to a separate file. + * [r1712] Update for gtools 3.0.1 release + * [r1711] Use 'suppressWarnings() instead of 'options(warn=-1)' in + 'mixedorder()'. + +2013-07-07 warnes + + * [r1705] Fix typo. + +2013-07-06 warnes + + * [r1704] Fix Rd warning. + * [r1703] Include lastAdd in NAMESPACE + * [r1702] Change assert from deprecated to defunct. + * [r1701] Improve deprecation message + * [r1700] Update for gtools 3.0.0 + * [r1699] Create new function lastAdd to replace addLast and mark + addLast as deprecated. + +2013-07-05 warnes + + * [r1698] Point out that addLast() modifies the value of .Last in + the global environment. + * [r1697] Point out that addLast() modifies the value of .Last in + the global environment. + * [r1696] Update for gtools 2.7.2 mark 2 + * [r1695] Remove cross-reference to (obsolete?) moc package + * [r1694] Update for gtools 2.7.2 + * [r1693] Update for R version 3.0.0 and later + +2013-03-17 warnes + + * [r1640] Fix error in smartbind: factor levels were not being + handled if the factor column was not present in the first data + frame. + +2012-06-19 warnes + + * [r1570] Update for gtools 2.7.0. + * [r1569] Document new 'verbose' argument to smartbind(). + * [r1568] Clean up R CMD check warnings. + +2012-05-04 warnes + + * [r1529] smartbind(): Improve handling of factors and ordered + factors. + +2011-10-05 warnes + + * [r1518] Update version number for release + * [r1517] Add 'sep' argument to smartbind() to allow specification + of character used to separate components of constructed names + +2011-09-28 warnes + + * [r1513] smartbind(): Prevent coersion to data frame from mangling + column names. + * [r1512] Add 'fill' argument to smartbind() to specify a value to + use for + missing entries. + * [r1511] Add 'fill' argument to smartbind() to specify a value to + use for + missing entries. + +2010-08-14 warnes + + * [r1451] Modify mixedorder()/mixedsort() to better handle strings + containing multiple periods, like version numbers (e.g 1.1.2, + 1.2.1. 1.1.1.1). + +2010-05-01 warnes + + * [r1434] Update version number for new release + * [r1433] Change Greg's email address to greg at warnes.net + * [r1432] Fix error in checkRVersion() + +2010-04-28 ggrothendieck2 + + * [r1431] fixed problems with R CMD CHECK + +2009-05-09 warnes + + * [r1328] Escape $ in .Rd file to avoid latex issues + * [r1327] Update NEWS and create softlinks for NEWS and ChangeLog + in top level directory + * [r1326] Move actual NEWS file into inst. + * [r1325] Update Greg's email address and fix Rd syntax errors + +2009-02-16 warnes + + * [r1313] Correct windows make flags as suggested by Brian Ripley. + +2008-08-15 warnes + + * [r1303] Add keywords() function to show /doc/KEYWORDS file + +2008-05-29 warnes + + * [r1285] Add newVersionAvailable() function to compare running and + latest available R versions + +2008-05-26 warnes + + * [r1284] Update license specification + * [r1283] Remove 'assert' man page + +2008-05-22 warnes + + * [r1282] Finish rename of assert.R to assert-depricated.Rd + * [r1281] Add checkRVersion.R file + * [r1280] Rename again to get correct extension! + * [r1279] Update NEWS for 2.5.0 + * [r1278] Add man page for checkRVersion + * [r1277] Rename assert-deprecated.R to assert.R to meet R file + name requirements. + * [r1276] Add checkRVersion to NAMESPACE, and increment version in + DESCRIPTION. + * [r1275] Remove broken SEE LSO reference + +2008-04-12 warnes + + * [r1259] Improve text explanation of how defmacro() and strmacro() + differ from + function(). + * [r1258] assert() is now deprecated in favor of base::stopifnot() + * [r1257] Rename 'assert.R' to 'deprecated.R'. + * [r1256] Assert is now deprecated in favor of base::stopifnot(), + so add call to + .Deprecated() to inform the user. + +2007-11-30 warnes + + * [r1228] Update defnitions of odd() and even() to use modulus + operator instead of division. Prettier, I think, :-D + +2007-08-08 warnes + + * [r1121] Fix bug identified by R-2.6's check routings in + binsearch() + * [r1120] Add the binsearch(), previously in the genetics package. + +2007-07-18 ggorjan + + * [r1100] typo fixed + +2007-04-12 warnes + + * [r1088] Add ask() function to prompt the user and collect a + single response. + +2007-04-07 warnes + + * [r1087] Fix improper escapes in regexp detected by R 2.5.0 + package check. + +2007-03-23 warnes + + * [r1083] Allow permutations for r>n provided repeats.allowed=TRUE + +2006-11-28 warnes + + * [r1023] Replace F with FALSE in smartbind example. + +2006-11-27 warnes + + * [r1022] Replace T with TRUE in smartbind example + * [r1021] Temprary remove to reset binary flag + * [r1020] Temprary remove to reset binary flag + * [r1019] Add smartbind() to list of exported functions, and add + corresponding + documentation file. + * [r1018] Update my email address + +2006-11-14 ggorjan + + * [r1012] Removed executable property + +2006-08-02 warnes + + * [r977] Update my email address + +2006-05-05 nj7w + + * [r958] Fixed minor typo - in {value} - n was replaced by r + * [r957] Fixed minor typos + +2006-03-01 warnes + + * [r903] Add smartbind function + +2006-01-18 warnes + + * [r845] Add concept tags to make mixedsort easier to locate. + +2005-12-21 warnes + + * [r837] Update version number and date + * [r836] Note changes for 2.2.3 + * [r835] Should now work on Windows + +2005-12-20 warnes + + * [r834] Temporary fix to allow setTCPNoDelay.c to compile on + Windows. If compiled on windows calling setTCPNoDelay will just + raise an error. + +2005-12-14 warnes + + * [r813] Change C++ comment to standard comment + +2005-12-13 nj7w + + * [r810] *** empty log message *** + * [r809] Updated NEWS and removed ChangeLog + +2005-12-12 nj7w + + * [r800] Updated version for CRAN release + +2005-12-08 warnes + + * [r790] Add C source code for setTCPNoDelay. + +2005-12-01 nj7w + + * [r776] Updated Greg's email address + +2005-11-29 warnes + + * [r769] Add UseDynLib to NAMESPACE so the shared library gets + properly loaded. + * [r768] - Remove debugging comments + - Change return value on success to "Success". + +2005-11-22 warnes + + * [r758] NAMESPACE + * [r757] Update news for 2.2.1 release. + * [r756] Fixes for R CMD check + * [r755] Add setTCPNoDelay() function and documentation + * [r745] New function 'addLast' that adds functions to R's .Last() + so that + they will be executed when R is terminating. + +2005-09-22 warnes + + * [r678] More changes for strmacro(), also changes for 2.1.1 + release + * [r677] Add strmaco() which defines functions that use strings for + macro definition + +2005-09-21 warnes + + * [r676] Add support for DOTS/... arguments to defmacro + +2005-09-12 nj7w + + * [r671] Updated Greg's email + +2005-09-02 nj7w + + * [r653] Exported assert + * [r652] Updated the version number + * [r651] Added NEWS + * [r650] Added ChangeLog + * [r649] Fixed syntax errors + +2005-09-02 warnes + + * [r648] Add assert() and documentation + * [r647] Fix problem in defmacro.Rd file: don't use \code{} in the + example section. + +2005-08-31 warnes + + * [r645] Adding the defmacro() function, extracted from + + Lumley T. "Programmer's Niche: Macros in {R}", R News, 2001, Vol + 1, + No. 3, pp 11--13, \url{http://CRAN.R-project.org/doc/Rnews/} + * [r642] Add stand-alone DESCRIPTION file and remove old + DESCRIPTION.in file. + +2005-06-13 nj7w + + * [r626] Fixed a bug in mixedsort - check if "which.na" and + "which.blank" is numeric(0) before subsetting the datasets. + +2005-06-09 nj7w + + * [r625] Updating the version number, and various help files to + synchronize splitting of gregmisc bundle in 4 individual + components. + +2005-05-10 warnes + + * [r619] Fix handling of NA's in mixedorder. We were using a high + UTF character to try + to put NA's at the end of the sort order, but R 2.1.0 checks if + characters + are in the correct range. Instead, we explicitly force NA's to + the end. + +2005-04-07 warnes + + * [r606] - Add scat() function which writes its arguments to stderr + and + flushes so that output is immediately displayed, but only if + 'getOption("DEBUG")' is true. + +2005-04-02 warnes + + * [r600] Move drop.levels() from gtools to gdata. + * [r599] Minor reordering of functions in file + * [r598] Move frameApply() to gdata package. + * [r597] Fix error if only one value passed to mixedorder. + * [r596] Add proper handling where more than one quantile obtains + the same value + +2005-04-01 warnes + + * [r595] Add CVS ID tag to file headers. + * [r594] Fixes from Jim Rogers for R CMD check problems in + frameApply + +2005-03-31 warnes + + * [r591] Updates to drop.levels() and frameApply() from Jim Rogers + * [r590] Add ELISA data set used by frameApply and drop.levels + examples + +2005-02-25 warnes + + * [r562] Replace 'T' with TRUE. + * [r561] Remove dependency on ELISA data set for the example. + * [r558] Add drop.levels, frameApply to namespace export. + +2005-02-15 warnes + + * [r542] Add frameApply and drop.levels contributed by Jim Rogers. + +2005-01-12 warnes + + * [r515] Add dependency on R 1.9.0+ to prevent poeple from + installing on old + versions of R which don't support namespaces. + +2004-09-27 warneg + + * [r461] Updated to pass R CMD check. + +2004-09-03 warneg + + * [r446] initial bundle checkin + +2004-09-02 warneg + + * [r442] Initial revision + +2004-08-27 warnes + + * [r441] Fixed bug in mixedsort, and modified reorder.factor to use + mixedsort. + +2004-08-26 warnes + + * [r440] - Fix bug pointed out by Jim Rogers. + - Use a more distictive internal separator: $@$ instead of just $ + - Capitalization is now irrelevent for search order (unlike + ASCII). + +2004-06-08 warnes + + * [r372] Nitin Jain added by= parameter to allow specifying + separation between groups. + +2004-05-26 warnes + + * [r345] Escape underscores in email addresses so Latex is happy. + * [r343] Replace 'T' with 'TRUE' to pass R CMD check. + +2004-05-25 warnes + + * [r334] Remove extraneous comments. + * [r333] Fix an error in the code when using repeats.allow=T and + r>2. Bug + report and fix both due to Elizabeth Purdom + . + +2004-05-24 warnes + + * [r323] Check if argument is a vector before doing is.na to avoid + generating a warning. + * [r322] Add invalid() function for testing if a parameter value is + non-missing, non-NA, + non-NULL. + +2004-04-27 warnes + + * [r321] Replaced argument `as.list' with `simplify'. Updated + documentation, + and updated examples appropriately. + +2004-04-26 warnes + + * [r320] Added as.list argument to return one list element per + evaluation. + +2004-03-26 warnes + + * [r303] Uncomment and fix large 'n' example. + * [r301] - Update to match changes in running() + - Add examples to illustrate new arguments. + - Modify running correlation plot example to be more clear. + * [r299] More of the same. + * [r297] Fix bug discovered by Sean Davis . + The running + function took an improper shortcut. When allow.fewer=FALSE it was + still passing shorter lists of elements to the called function, + and + then overwriting the results for the shorter lists with NAs. The + code + now skips evaluation of the function on lists shorter than the + specified length when allow.fewer=FALSE. + +2004-01-21 warnes + + * [r277] - Mark sprint() as depreciated. + - Replace references to sprint with capture.output() + - Use match.arg for halign and valign arguments to + textplot.default. + - Fix textplot.character so that a vector of characters is + properly + displayed. Previouslt, character vectors were plotted on top of + each + other. + +2003-12-03 warnes + + * [r253] - match function argument defaults with 'usage' + +2003-11-21 warnes + + * [r237] Removed 'deqn' call that was confusing things. + * [r234] Add email address to author field + * [r233] - new files + * [r232] - Change 'T' to 'TRUE' in mixedsort.R + - Add missing brace in mixedsort.Rd + +2003-11-20 warnes + + * [r230] - Move 'odd' and 'even' functions to a separate file & + provide documentation + +2003-11-18 warnes + + * [r227] - Renamed smartsort to mixedsort and added documentation. + +2003-11-10 warnes + + * [r220] - Add files contributed by Arni Magnusson + . As well as some of my own. + +2003-05-23 warnes + + * [r196] - library() backported from 1.7-devel. This version of the + function + adds the "pos=" argument to specify where in the search path the + library should be placed. + + - updated .First.lib to use library(...pos=3) for MASS to avoid + the + 'genotype' data set in MASS from masking the genotype funciton in + genetics when it loads gregmisc + + - Added logit() inv.logit() matchcols() function and + corresponding docs + +2003-04-22 warnes + + * [r189] - Fixed tpyo in example that allowed combinations(500,2) + to run when + it should have been ignred for testing.. + +2003-04-10 warnes + + * [r186] - Added note about the need to increase + options("expressions") to use + large values for 'n'. Prompted by bug report from Huan Huang + n provided + repeat.allowed=TRUE + - Bumped up version number + +2002-08-01 warnes + + * [r114] - Corrected documentation mismatch for ci, ci.default. + + - Replaced all occurences of '_' for assignment with '<-'. + + - Replaced all occurences of 'T' or 'F' for 'TRUE' and 'FALSE' + with + the spelled out version. + + - Updaded version number and date. + +2002-04-09 warneg + + * [r109] Checkin for version 0.5.3 + +2002-03-26 warneg + + * [r97] Initial Checkin + * [r96] Initial checkin. + +2002-03-20 warneg + + * [r91] - Added definition of is.R function. + + - Added boxplot.formula + +2002-03-07 warneg + + * [r90] - Added documentation and example for running2 + * [r89] - Added "running2", which handles both univariate and + bivariate cases + - Modified "running" to call "running2" + +2002-02-05 warneg + + * [r75] - Fix typo that caused code meant to run only under S-Plus + to run + under R, causing problems. + +2001-12-19 warneg + + * [r67] - Added code for %in%. + +2001-09-18 warneg + + * [r18] Release 0.3.2 + +2001-09-01 warneg + + * [r17] Initial checkin. + * [r16] Release 0.3.0 + +2001-08-25 warneg + + * [r13] Initial CVS checkin. + * [r11] Fixed a typo and a syntax error. + * [r7] Initial Checkin + +2001-06-29 warneg + + * [r6] Initial revision. + From noreply at r-forge.r-project.org Tue May 26 18:23:13 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 26 May 2015 18:23:13 +0200 (CEST) Subject: [R-gregmisc-commits] r2031 - pkg/fork/inst Message-ID: <20150526162313.30BB818796C@r-forge.r-project.org> Author: warnes Date: 2015-05-26 18:23:12 +0200 (Tue, 26 May 2015) New Revision: 2031 Added: pkg/fork/inst/ChangeLog Log: Add changelog to svn repository Added: pkg/fork/inst/ChangeLog =================================================================== --- pkg/fork/inst/ChangeLog (rev 0) +++ pkg/fork/inst/ChangeLog 2015-05-26 16:23:12 UTC (rev 2031) @@ -0,0 +1,168 @@ +2015-05-02 warnes + + * [r2018] Rename 'trunk' to 'pkg' for compatibility with R-forge + +2014-07-22 warnes + + * [r1867] Update saved test output to match current version of R + * [r1866] Modify C function Rfork_signal to avoid issue with + declared type of argument to signal function between Linux and + Solaris. + +2011-09-01 warnes + + * [r1496] Update NEWS for new release. + * [r1495] Put '.pidlist' variable into the global environment + rather than the package environment. + * [r1494] Change .First to .onLoad for proper loading of fork + dynamic library. + +2011-08-26 warnes + + * [r1484] Update Greg's email address. + * [r1482] Update Greg's email address + +2009-07-17 warnes + + * [r1351] Add NAMESPACE file, update version number to 1.2.3 + +2009-05-09 warnes + + * [r1341] Update for 1.2.1 + * [r1340] Add convenience links to NEWS and ChangeLog at top level + * [r1339] Move NEWS to inst subdir. + * [r1338] Fix .Rd syntax error and update mailing address + +2007-10-22 warnes + + * [r1196] Clarify GPL version + +2007-03-24 warnes + + * [r1086] Update version number and date + * [r1085] Update my email address + * [r1084] Add note of financial support from Metrum + +2007-03-22 warnes + + * [r1082] Add NEWS file + * [r1081] Add date to DESCRIPTION file + +2007-03-06 warnes + + * [r1072] Update version number and description + * [r1071] Fix syntax error in example due to incomplete code + deletion. + * [r1070] Add 'PACKAGE=' argument to '.C' calls to make 'R CMD + check' happy + * [r1069] Improve regression tests, add saved .Rout files for doing + regression testing. + * [r1068] Add a helpful comment + * [r1067] Create manual pages for handleSIGCLD() and + restoreSIGCLD(), as well as appropriately modifying the pages for + fork() and signal() + * [r1066] Create SysV and BSD tests for code to prevent zombie + process creation, update code that intentionally creates zombies. + Move sub-process creation and zombie test code to a function for + use by all three test files + * [r1065] Create SysV and BSD tests for code to prevent zombie + process creation, update code that intentionally creates zombies. + Move sub-process creation and zombie test code to a function for + use by all three test files + * [r1064] Add wrappers for C functions to control setting/restoring + child + process signal handler. + * [r1063] Modify script to check for the presence of zombie + processes + * [r1062] This is a test commit. + +2007-02-15 warnes + + * [r1055] Improve test code + * [r1054] Fix typo. + +2007-02-14 warnes + + * [r1053] Add code to install SIGCHLD handler to avoid forked + children from becoming zombies + +2007-02-05 warnes + + * [r1047] Add documentation for signal() + * [r1046] Add signal() to example for fork() + * [r1045] Bump version number + * [r1044] Handle arguments better + * [r1043] Add signal() command to allow ignoring signals + +2006-08-02 warnes + + * [r977] Update my email address + +2005-03-31 warnes + + * [r584] Update version number + * [r583] Remove extraneous character ('.'). + +2004-05-25 warnes + + * [r341] Update version number for release. + * [r340] Add PACKAGE= argument to all .C and .Call invocations. + +2003-12-20 warnes + + * [r273] Revised description a little bit. + +2003-12-19 warnes + + * [r272] - Work around bug in Rd2dvi with /preformatted + + - Convert C++ style comments (//...) to ordinary C comments + (/*...*/) + to avoid warning message from some compilers. + +2003-12-09 warnes + + * [r259] Change version number to 1.0.0. + * [r258] - remove non-portable signals + * [r257] - Changes to pass R CMD check + - Remove non-portable signal references + +2003-07-18 warnes + + * [r216] - Fix various problems identified by R CMD check. + * [r215] - Added Rfork_siglist() C function to list all signal + information + - Added siglist() R function to call Rfork_siglist() + - Added documentation for signame(), sigval(), and siglist(). + - Removed some debugging code from fork.c. + - Standardized order of parameters for Rfork_sigvar(), + Rfork_signame(). + * [r214] - Removed so that it will be auto-generated at packaging + time. + +2003-07-17 warnes + + * [r213] - Added Rfork_signame and Rfork_sigval C functions to look + up signal + information given a symbolic name or a signal value. + - Added corresponding R signame() and sigval() functions. + * [r212] - Improved the help text for fork by making it more + explicit what problems occur with code parsing after a fork. + - Added a default signal to killall. + * [r211] - Added default signal number for killall. + * [r210] - Fixed email address in help pages. + * [r209] - Added CVS Id header tag + * [r208] - Clarified description text. + * [r207] - Fixed typos, added header with CVS Id tag + * [r206] - Added help pages for all functions. + + - .pidlist is now stored in the package's environment. This + forces it + to be local to the current R session, and prevents it from being + saved/restored by accident using load/save/quit. + * [r205] - Split fork.R into fork.R, exit.R, wait.R, getpid.R. + +2003-07-16 warnes + + * [r202] Initial revision + From noreply at r-forge.r-project.org Tue May 26 18:24:09 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 26 May 2015 18:24:09 +0200 (CEST) Subject: [R-gregmisc-commits] r2032 - pkg/SII/inst Message-ID: <20150526162409.D62E718796C@r-forge.r-project.org> Author: warnes Date: 2015-05-26 18:24:09 +0200 (Tue, 26 May 2015) New Revision: 2032 Added: pkg/SII/inst/ChangeLog Log: Add changelog to svn repository Added: pkg/SII/inst/ChangeLog =================================================================== --- pkg/SII/inst/ChangeLog (rev 0) +++ pkg/SII/inst/ChangeLog 2015-05-26 16:24:09 UTC (rev 2032) @@ -0,0 +1,72 @@ +2015-05-02 warnes + + * [r2018] Rename 'trunk' to 'pkg' for compatibility with R-forge + +2013-12-07 warnes + + * [r1756] Remove spurious '<' character + * [r1755] Move sii.constants out of data/ and into R/sysdata.Rda so + it becomes part of the package namespace. Remove the now unneeded + 'undocumented' man page that listed it. + +2013-12-06 warnes + + * [r1754] Update pdf file + * [r1753] rename package directories to match current CRAN + standards + * [r1752] Add comment + * [r1751] Update NEWS for SII 1.0.3 + * [r1750] Update affiliation to "Gregory R. Warnes Consulting" + * [r1749] Remove obsolete .First.lib() function and instead call + data() within sii.excel(). + +2011-09-01 warnes + + * [r1497] Belated commit. + * [r1493] - Update Greg's email address + - Update to meet current R package reqiurements. + +2011-08-26 warnes + + * [r1481] Update Greg's email address + * [r1480] Update Greg's email address + +2010-07-23 warnes + + * [r1450] Add ChangeLog link and NEWS file and link + * [r1449] Update for release 1.0.0 to CRAN + +2010-01-24 warnes + + * [r1410] Add code to apply the examples from the 'official' C + PROGRAM DEVELOPER'S KIT + * [r1409] Correct typo + +2008-06-23 warnes + + * [r1298] Update SII.pdf + * [r1297] Add SII vignette, and update DESCRIPTION file to include + vignette's dependencies as suggested packages + +2008-06-14 warnes + + * [r1295] Minor changes to improve R CMD CHECK results + * [r1294] Add funding to DESCRIPTION file + * [r1293] Update package DESCRIPTION file. + * [r1292] Implement 'interpolate' as a separate argument, and when + 'interpolate=TRUE' replace NA's in any provided measurement + vector. + * [r1291] Add SII to importance weight tables + * [r1290] Add SII to importance weight tables + +2008-06-12 warnes + + * [r1289] More documentation, and some code cleanup + * [r1288] Update source code, improve documentation + * [r1287] Add namespace file to hide private functions + +2008-06-09 warnes + + * [r1286] Add SII package implementing ANSI S3.5-1997 Speech + Intelligibility Index (SII) calculations + From noreply at r-forge.r-project.org Tue May 26 18:26:06 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 26 May 2015 18:26:06 +0200 (CEST) Subject: [R-gregmisc-commits] r2033 - pkg/SASxport/inst Message-ID: <20150526162607.02E5D187973@r-forge.r-project.org> Author: warnes Date: 2015-05-26 18:26:06 +0200 (Tue, 26 May 2015) New Revision: 2033 Added: pkg/SASxport/inst/ChangeLog Log: Add changelog to svn repository Added: pkg/SASxport/inst/ChangeLog =================================================================== --- pkg/SASxport/inst/ChangeLog (rev 0) +++ pkg/SASxport/inst/ChangeLog 2015-05-26 16:26:06 UTC (rev 2033) @@ -0,0 +1,463 @@ +2015-05-02 warnes + + * [r2018] Rename 'trunk' to 'pkg' for compatibility with R-forge + +2014-09-13 warnes + + * [r1886] Update for changes in latest version of Hmisc (3.14-5). + +2014-07-21 warnes + + * [r1865] Add missing comment terminators. + * [r1864] Use conditional compilation to map-out byte-swapping code + on bigendian systems, where it is not needed. + * [r1863] Remove never-used conditional code and un-needed #include + statements + * [r1862] Update version number in test script output comparison + files. + * [r1861] Change version number to 1.5.0 and update NEWS file. + * [r1860] Test commit from ppc-vm + * [r1859] Add .Rout.save file matching changes to Alfalfa_Test.R + * [r1858] add display output of read.xport in Alafalfa_Test.R test + script + * [r1857] Minor code reformatting. + * [r1856] Mark constants as long ints. + * [r1855] Avoid infinte loop in case of IBM exponent overflow. If + this occurs, + and can't be fixed in a single pass, generate a warning message + and + return NA. + * [r1854] Move comments about system functions to implement + TO_BIGEND{SHORT,INT} + to to_bigend.h. + * [r1853] Add comments about system functions to do same task. + * [r1852] Call TO_BIGEND_DOUBLE on the pointed to value, not the + pointed. + * [r1851] - Return to using get_IBM_double, but add reverse_double + before the + call if running on BIGENDIAN machine. + +2014-07-20 warnes + + * [r1850] Finish rename of 'HTOBE' to 'TO_BIGEND' + * [r1849] Add dummy code to avoid compile warnings about unneeded + variables + * [r1848] Rename 'host_to_be' to 'to_bigend' to be more transparent + about purpose + * [r1847] Rename 'host_to_be' to 'to_bigend' to be more transparent + about purpose + +2014-07-19 warnes + + * [r1846] Minor change in spacing + * [r1845] Change byte-order detection code + * [r1844] Fix copy-paste error + +2014-07-18 warnes + + * [r1843] Update NEWS for SASxport 1.4.2 + * [r1842] - Rename function and file 'reverse' to 'host_to_be' + (short for + host-endian to big-endian') to clarify purpose of the function. + - Remove pre-processeor definition of REVERSE, and add + definitions of + HTOBE_SHORT, HTOBE_INT, and HTOBE_DOUBLE. + * [r1841] Make sure all left shifts are explicitly typed as + unsigned in to avoid + undefined behavior. + * [r1840] Update test output + * [r1839] minor code formatting changes + * [r1838] Re-ename optimization on BIG_ENDIAN systems + * [r1837] Update .save files + * [r1836] Write file data as hex bytes so R CMD check's diff can + display up differences. + * [r1835] Remove SASxport:::assert() and replace all uses with + stopifnot() + * [r1834] Remove SASxport:::assert() and replace all uses with + stopifnot() + * [r1833] Explicitly cast left shifts in ibm2ieee.c to avoid + undefined behavior. (Reported by Brian Ripley) + * [r1832] Add default label method to Hmisc import to resolve + problem if SASxport::read.xport is called without loading + SASxport + +2014-07-17 warnes + + * [r1831] Updated read.xport man page exampls to match new behavior + of names.toupper + * [r1830] Modfy tests to directly call 'read.xport' instead of + relying on 'examples(read.xport)'. Add test files to run + 'examples(read.xport)' separately. + * [r1829] Enable examples that use Hmisc, since it is now a + dependency. + * [r1828] Update DESCRIPTION and NEWS for SASxport 1.4.1. + * [r1827] Minor code reformatting. + * [r1826] Rename former 'label.Rd' file to 'SASformatRd' and remove + references + to label() and "label<-"() (checkin missed from previous + release). + * [r1825] read.xport: Preserve '$' at the beginning of SAS + character format strings. + * [r1824] read.xport() argument names.tolower was not being honored + for dataset + names. + +2014-04-10 warnes + + * [r1807] Oops. Correct over-zealous paste. + * [r1806] Update test to use new 'self' argument for label + data.frame method. + * [r1805] Update for SASxport 1.4.0. + * [r1804] Remove definitions of labels in favor of those coming + from Hmisc. Modify read.xport and write.xport to use appropriate + arguments for label method for data.frames. + * [r1803] Remove definitions of labels in favor of those coming + from Hmisc. Modify read.xport and write.xport to use appropriate + arguments for label method for data.frames. + +2013-10-09 warnes + + * [r1722] Remove duplicate Imports field + * [r1721] Update examples + * [r1720] Change to camelcase + * [r1719] Update for SASxport 1.3.6 release + * [r1718] Issue: URL test2.xpt file has moved. Solution: (1) Use + local copy of file for executed examples, (2) update URL for + displayed examples. + * [r1717] Add local copy of test2.xpt SAS file + +2013-06-14 warnes + + * [r1672] Update .save files for 1.3.5 + * [r1671] Updates for SASxport 1.3.5 + * [r1670] Complete changes to handle empty datasets in xport files. + * [r1669] Properly handle empty datasets + * [r1668] Fix bug when xpt file contains an empty data set + +2013-05-31 warnes + + * [r1667] Update test Rout.save files to match new version + * [r1666] Update for SASxport 1.3.4 + * [r1665] Explicitly specify timezone in tests/*.R to avoid + extraneous warnings + * [r1664] Update build date. + * [r1663] Update for SASxport 1.3.3 + * [r1662] Update for SASxport 1.3.3 + * [r1661] Correct error in write.xport when a factor contains only + NA entries. + +2013-05-12 warnes + + * [r1660] Update NEWS for release + * [r1659] Complete work to handle dataframe label and type + +2013-05-11 warnes + + * [r1658] Add support for dataset labels and types + * [r1657] Fix spelling error + * [r1656] Update for version 1.3.2 + * [r1655] Update for release 1.3.2 + * [r1654] Fix spelling error. + * [r1653] Carry bug fix forward to handle loading xport data when a + dataset ends on exactly 80 byte block boundry. + * [r1652] Replace file.path(path.package(...)) with + system.file(...) + * [r1651] Carry bug fix forward to handle loading xport data when a + dataset ends on exactly 80 byte block boundry. + * [r1650] Remove obsolete .First.lib() + +2013-03-24 warnes + + * [r1649] Update for release 1.3.1 + * [r1648] Replace obsolete use of .path.package() with + path.package() + +2012-06-29 warnes + + * [r1593] Create inst/extdata directory to hold example file + Alfalfa.xpt. + * [r1592] Update SASxport version number + * [r1591] Fix capitalization of extension from .Rda to .rda + * [r1590] Convert Alfalfa data set to an R data file instead of R + code + xpt file + * [r1589] Add makeSASNames() to the package manual page. + * [r1588] Update DESCRIPTION and NEWS for SASxport 1.3.0 + * [r1587] Add makeSASNames() to exported functions. + * [r1586] Add documentation for the 'quiet' argument of + makeSASNames(). + +2012-06-28 warnes + + * [r1585] Changelong shouldn't be stored in svn + * [r1584] Fix see also reference for make.names(). + * [r1583] Remove references to Random Technologies. + * [r1582] Add man page for makeSASNames() function. + * [r1581] Fixed bug when only some names are duplicated. + * [r1580] New makeSASNames() function creates valid SAS names from + a list of R + object or column names, properly handling case conversion (all + converted to upper-case), length restructions (8 characters), and + making duplicate names unique. This is not as obvious as it + appears, + since the process of shortening names can render cause name to + become + duplicates, and adding digits to the end of names to make them + unique + can make them too long, so a few iterations may be requireed to + ensure + valid and unique names. + * [r1579] Update saved test output files. + * [r1578] Remove references to Random Technologies LLC and update + email address. + +2012-06-21 warnes + + * [r1572] Standardize file capitalization + * [r1571] Standardize file capitalization + +2010-11-12 warnes + + * [r1458] Update reference test output for TestUnnamedComponents.R + * [r1457] Update for SASxport release 1.2.4 + * [r1456] Update Greg's email address + * [r1455] Fix bug: 'as.is=TRUE' argument to read.xport was being + ignored. + * [r1454] Add test for proper function of as.is flag to read.xport + +2008-02-29 warnes + + * [r1245] Update for release 1.2.3 + * [r1244] Correct typo in write.xport man page + +2007-11-09 warnes + + * [r1227] Update NEWS and ChangeLog for 1.2.2 + * [r1226] Apply patches to fix problems on 64 bit platforms, as + sumitted by Brian Ripley. + +2007-11-07 warnes + + * [r1225] Update version number + * [r1224] Bump version number + * [r1223] Apply patches to fix problems on 64 bit platforms, as + sumitted by Brian Ripley, and to replace assert() calls with + calls a macro that maps to error() unless standalone testing is + being done, in which case assert() is used. + +2007-11-05 warnes + + * [r1220] Remove extraneous ';' characters after function closing + brace + +2007-11-01 warnes + + * [r1211] Remove dependency on foreign, since the necessary + functionality is now provided internally. + * [r1210] Update TODO file + * [r1209] Update to match changes to functions + * [r1208] Update to match package changes + * [r1207] Update stored test output to match package changes + * [r1206] Update for new release + * [r1205] Remove dependency on foreign + * [r1204] Copy code from foreign for lookup.xport() and + read.xport(), extend lookup.xport() to show information about SAS + format and iformat + * [r1203] - Use of the attribute named 'format' caused problems + with chron + objects. Consequently, the format information is now stored in + the + 'SASformat' attribute. For consistency, the input format + information + is now stored in the 'SASiformat' attribute. + + - The functions for extracting and setting the format and iformat + information have been renamed to 'SASformat' and 'SASiformat', + etc. + + - In order to properly handle SAS format information, we now use + a + locally modified version of foreign::lookup.xport and + foreign::read.xport. + + - Various typo corrections + + - Creation of a new function fstr() to generate sas format name + strings + using name, length, and digits information. + + - Addion of a toSAS method for chron() objects + * [r1202] Copy code from foreign for lookup.xport() and + read.xport(), extend lookup.xport() to show information about SAS + format and iformat + * [r1201] Improve handling of SAS data and time formats, simplify + code + +2007-10-29 warnes + + * [r1200] Fixes to correct handling storage of negative numbers + * [r1199] Belatedly commit change to startup message to give path + to SASxport product page rather than contact page + * [r1198] Comment out debugging message in reverse() + * [r1197] Commit changes to stored output to match changed package + load message + +2007-10-22 warnes + + * [r1196] Clarify GPL version + +2007-10-02 warnes + + * [r1195] Add information on how to get help to the startup message + * [r1194] Add information on how to get help to the startup message + * [r1193] Add dependenct on utils::packageDescription + +2007-10-01 warnes + + * [r1192] Update saved R output to include startup message + +2007-09-25 warnes + + * [r1191] Update version number and date + * [r1190] Indicate that Metrum partially funded development + * [r1189] Display version and support information on package load + +2007-09-18 warnes + + * [r1188] Spent more time than Metrum paid for + +2007-09-15 warnes + + * [r1187] Improve formatting for pdf output + * [r1186] Update changelog + * [r1185] Changes so test TestUnnamedCompontents.R runs under R + 2.4.1 on Win32 + * [r1184] Add support for auto-generating SAS formats for factor + objects. Refactor argument name handling to improve code clarity. + +2007-09-14 warnes + + * [r1183] Add option to read.xport() that permits inclusion of PROC + CONTENTS format information in the returned list + +2007-09-13 warnes + + * [r1180] Ensure 'names.tolower' applies to dataset names + * [r1179] Update test output to match recent changes. + * [r1178] Add checking and handling for unnamed data frames or + variables + * [r1177] Update tests now that 'units' and 'units<-' functions no + longer are included + +2007-09-12 warnes + + * [r1176] Remove units() and units<-() functions since they arene't + ever used. + * [r1175] Remove units() and units<-() functions since they arene't + ever used. + * [r1174] Remove units from manual page + +2007-09-11 warnes + + * [r1173] Add assertion to test that read.xport(.., as.list=TRUE) + works properly + * [r1172] Forgot to save buffer before svn commit. + * [r1171] Correct error in handling 'verbose' argument, error when + more than one dataset has the same name, and add 'as.list' + argument to ensure return value is a list, even if there is only + one dataset in the file + * [r1170] Improve handling of list argument. Also check that names + are proper and unique. + +2007-09-07 warnes + + * [r1167] Add round-trip test for Theoph data set + * [r1166] Change argument name in write.xport from 'filename' to + 'file' to match read.xport + * [r1165] Change argument name in write.xport from 'filename' to + 'file' to match read.xport + * [r1164] Change argument name in write.xport from 'filename' to + 'file' to match read.xport + * [r1163] Fix typo + +2007-08-29 warnes + + * [r1161] Update Version to 1.0, depend on current version of + foreign + +2007-08-22 warnes + + * [r1160] Update ChangeLog and NEWS files + * [r1159] Modify read.xport to preserve case of SAS names by + default, as well as updating the example code. + * [r1158] sprintf() was being used where printf() was intended. + +2007-08-21 warnes + + * [r1157] Slight improvement to credits for BRL-CAD + * [r1156] Commit previous updates + * [r1155] Commit previous updates + +2007-08-15 warnes + + * [r1146] Remove dependency on SAS code + * [r1145] Fix reverse.c because we need to swap everything to match + Big-Endian, rather than Little-Endian. Also, dont' call the + macro. + * [r1144] Restore reverse.c + * [r1143] Minor reformatting + * [r1142] Make corrections for typos noted by Metrum folks + +2007-08-12 warnes + + * [r1138] More updates + * [r1137] Remove new stuff... use SAS's code instead + * [r1136] 1st attempt at rewriting cnxptiee.[ch] + +2007-08-11 warnes + + * [r1135] Explicitly check file header + * [r1134] Improve package description + +2007-08-09 warnes + + * [r1133] More changes, esp to lookup.xport() and friends + * [r1132] More changes, esp to lookup.xport() and friends + * [r1131] More changes, esp to lookup.xport() and friends + * [r1130] Remove unused swap_bytes.h + * [r1129] Add package description page + * [r1128] Add comment header indicating the source of code from + Hmisc + * [r1127] Update saved output of test scripts + +2007-08-08 warnes + + * [r1126] Updates + * [r1125] Updates + * [r1124] Updates + * [r1123] Updates + * [r1122] Updates. + +2007-08-03 warnes + + * [r1119] Add code from package foreign and gtools to make SASxport + stand alone + * [r1118] Remove stray .Rhistory file + * [r1117] Acknowledge MetrumI support + * [r1116] Add "assert" function + * [r1115] Add "assert" function to avoid dependenct on gtools. + * [r1114] Correct some typos. + * [r1113] Drop version number to 0.99 until testing integration and + is complete + * [r1112] Add R test file to run c-level tests + * [r1111] Remove .so from svn + * [r1110] More modifications. Should now work for most R data types + * [r1109] Add more tests + +2007-07-29 warnes + + * [r1107] Add SAS code to create xport data files for testing + +2007-07-28 warnes + + * [r1106] Add SVNxport package + From noreply at r-forge.r-project.org Wed May 27 02:17:31 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 02:17:31 +0200 (CEST) Subject: [R-gregmisc-commits] r2034 - pkg/gtools/R Message-ID: <20150527001731.8E934186BC9@r-forge.r-project.org> Author: warnes Date: 2015-05-27 02:17:31 +0200 (Wed, 27 May 2015) New Revision: 2034 Added: pkg/gtools/R/asc.R Log: Add asc() and chr() functions for converting between characters and ASCII codes Added: pkg/gtools/R/asc.R =================================================================== --- pkg/gtools/R/asc.R (rev 0) +++ pkg/gtools/R/asc.R 2015-05-27 00:17:31 UTC (rev 2034) @@ -0,0 +1,2 @@ +asc <- function(char) sapply(char, function(x) strtoi(charToRaw(x),16L) ) +chr <- function(n) sapply(n, function(x) rawToChar(as.raw(x)) ) From noreply at r-forge.r-project.org Wed May 27 02:19:41 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 02:19:41 +0200 (CEST) Subject: [R-gregmisc-commits] r2035 - pkg/gtools Message-ID: <20150527001941.8E7DB186BC9@r-forge.r-project.org> Author: warnes Date: 2015-05-27 02:19:41 +0200 (Wed, 27 May 2015) New Revision: 2035 Modified: pkg/gtools/NAMESPACE Log: Add asc(), chr(), assignEdgewise(), unByteCode(), and unByteCodeAssign() to package NAMESPACE. Modified: pkg/gtools/NAMESPACE =================================================================== --- pkg/gtools/NAMESPACE 2015-05-27 00:17:31 UTC (rev 2034) +++ pkg/gtools/NAMESPACE 2015-05-27 00:19:41 UTC (rev 2035) @@ -2,11 +2,14 @@ export( addLast, + asc, + ASCIIfy, ask, assert, - ASCIIfy, + assignEdgewise, binsearch, capture, + chr, checkRVersion, combinations, ddirichlet, @@ -36,5 +39,7 @@ smartbind, sprint, stars.pval, - strmacro + strmacro, + unByteCode, + unByteCodeAssign ) From noreply at r-forge.r-project.org Wed May 27 02:20:42 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 02:20:42 +0200 (CEST) Subject: [R-gregmisc-commits] r2036 - pkg/gtools/R Message-ID: <20150527002042.A278E186BC9@r-forge.r-project.org> Author: warnes Date: 2015-05-27 02:20:42 +0200 (Wed, 27 May 2015) New Revision: 2036 Modified: pkg/gtools/R/roman2int.R Log: roman2int() now returns NA for invalid roman numeral strings instead of generating an error. Modified: pkg/gtools/R/roman2int.R =================================================================== --- pkg/gtools/R/roman2int.R 2015-05-27 00:19:41 UTC (rev 2035) +++ pkg/gtools/R/roman2int.R 2015-05-27 00:20:42 UTC (rev 2036) @@ -31,7 +31,18 @@ roman2int <- function(roman) { roman <- trim(toupper(as.character(roman))) - retval <- sapply(roman, roman2int.inner) + + tryIt <- function(x) + { + retval <- try(roman2int.inner(x), silent=TRUE) + if(is.numeric(retval)) + retval + else + NA + } + + retval <- sapply(roman, tryIt) + retval } From noreply at r-forge.r-project.org Wed May 27 02:21:05 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 02:21:05 +0200 (CEST) Subject: [R-gregmisc-commits] r2037 - pkg/gtools/man Message-ID: <20150527002105.1722F186BC9@r-forge.r-project.org> Author: warnes Date: 2015-05-27 02:21:04 +0200 (Wed, 27 May 2015) New Revision: 2037 Added: pkg/gtools/man/asc.Rd Log: Add asc() and chr() functions for converting between characters and ASCII codes Added: pkg/gtools/man/asc.Rd =================================================================== --- pkg/gtools/man/asc.Rd (rev 0) +++ pkg/gtools/man/asc.Rd 2015-05-27 00:21:04 UTC (rev 2037) @@ -0,0 +1,67 @@ +\name{asc} +\alias{asc} +\alias{chr} +\title{Convert between characters and ASCII codes} +\description{ + \code{asc} returns the ASCII codes for the specified characters. + \code{chr} returns the characters corresponding to the specified ASCII codes. +} +\usage{ + asc(char, simplify=TRUE) + chr(ascii) +} +\arguments{ + \item{char}{vector of character strings} + + \item{simplify}{logical indicating whether to attempt to convert the + result into a vector or matrix object. See \code{\link[base]{sapply}} + for details. + } + \item{ascii}{vector or list of vectors containing integer ASCII codes} +} +\value{ + \code{asc} returns the integer ASCII values for each character + in the elements of \code{char}. If \code{simplify=FALSE} the result + will be a list contining one vector per element of \code{char}. If + \code{simplify=TRUE}, the code will attempt to convert the result into + a vector or matrix. + + \code{asc} returns the characters corresponding to the provided ASCII + values. +} +\author{ + Adapted by Gregory R. Warnes \email{greg at warnes.net} from code posted + on the 'Data Debrief' blog on 2011-03-09 at + \url{http://datadebrief.blogspot.com/2011/03/ascii-code-table-in-r.html}. +} +\seealso{ + \code{\link[base]{strtoi}}, + \code{\link[base]{charToRaw}}, + \code{\link[base]{rawToChar}}, + \code{\link[base]{as.raw}} +} +\examples{ + ## ascii codes for lowercase letters + asc(letters) + + ## uppercase letters from ascii codes + chr(65:90) + + ## works on muti-character strings + ( tmp <- asc('hello!') ) + chr(tmp) + + ## Use 'simplify=FALSE' to return the result as a list + ( tmp <- asc('hello!', simplify=FALSE) ) + chr(tmp) + + ## When simplify=FALSE the results can be... + asc( c('a', 'e', 'i', 'o', 'u', 'y' ) ) # a vector + asc( c('ae', 'io', 'uy' ) ) # or a matrix + + ## When simplify=TRUE the results are always a list... + asc( c('a', 'e', 'i', 'o', 'u', 'y' ), simplify=FALSE ) + asc( c('ae', 'io', 'uy' ), simplify=FALSE) +} +\keyword{character} +\keyword{programming} From noreply at r-forge.r-project.org Wed May 27 02:28:23 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 02:28:23 +0200 (CEST) Subject: [R-gregmisc-commits] r2038 - in branches: . gtools-generalize-mixedorder gtools-generalize-mixedorder/R gtools-generalize-mixedorder/inst gtools-generalize-mixedorder/man gtools-generalize-mixedorder/tests Message-ID: <20150527002823.94B90187948@r-forge.r-project.org> Author: warnes Date: 2015-05-27 02:28:22 +0200 (Wed, 27 May 2015) New Revision: 2038 Added: branches/gtools-generalize-mixedorder/ branches/gtools-generalize-mixedorder/NAMESPACE branches/gtools-generalize-mixedorder/R/asc.R branches/gtools-generalize-mixedorder/R/dirichlet.R branches/gtools-generalize-mixedorder/R/mixedsort.R branches/gtools-generalize-mixedorder/R/roman2int.R branches/gtools-generalize-mixedorder/man/asc.Rd branches/gtools-generalize-mixedorder/man/mixedsort.Rd branches/gtools-generalize-mixedorder/man/quantcut.Rd branches/gtools-generalize-mixedorder/man/unByteCode.Rd branches/gtools-generalize-mixedorder/tests/test_ddirichlet.R Removed: branches/gtools-generalize-mixedorder/NAMESPACE branches/gtools-generalize-mixedorder/R/dirichlet.R branches/gtools-generalize-mixedorder/R/mixedsort.R branches/gtools-generalize-mixedorder/R/roman2int.R branches/gtools-generalize-mixedorder/man/mixedsort.Rd branches/gtools-generalize-mixedorder/man/quantcut.Rd branches/gtools-generalize-mixedorder/man/unByteCode.Rd Modified: branches/gtools-generalize-mixedorder/DESCRIPTION branches/gtools-generalize-mixedorder/inst/NEWS Log: Branch for generalization of mixedorder() Modified: branches/gtools-generalize-mixedorder/DESCRIPTION =================================================================== --- pkg/gtools/DESCRIPTION 2015-05-02 17:38:35 UTC (rev 2018) +++ branches/gtools-generalize-mixedorder/DESCRIPTION 2015-05-27 00:28:22 UTC (rev 2038) @@ -21,7 +21,7 @@ - modify the TCP\_NODELAY ('de-Nagle') flag for socket objects, - efficient 'rbind' of data frames, even if the column names don't match ('smartbind'), - generate significance stars from p-values ('stars.pval'). -Version: 3.4.3 +Version: 3.4.3.0 Date: 2015-04-23 Author: Gregory R. Warnes, Ben Bolker, and Thomas Lumley Maintainer: Gregory R. Warnes Deleted: branches/gtools-generalize-mixedorder/NAMESPACE =================================================================== --- pkg/gtools/NAMESPACE 2015-05-02 17:38:35 UTC (rev 2018) +++ branches/gtools-generalize-mixedorder/NAMESPACE 2015-05-27 00:28:22 UTC (rev 2038) @@ -1,40 +0,0 @@ -useDynLib(gtools) - -export( - addLast, - ask, - assert, - ASCIIfy, - binsearch, - capture, - checkRVersion, - combinations, - ddirichlet, - defmacro, - even, - foldchange, - foldchange2logratio, - getDependencies, - inv.logit, - invalid, - keywords, - lastAdd, - loadedPackages, - logit, - logratio2foldchange, - mixedorder, - mixedsort, - na.replace, - odd, - permutations, - permute, - quantcut, - rdirichlet, - running, - scat, - setTCPNoDelay, - smartbind, - sprint, - stars.pval, - strmacro - ) Copied: branches/gtools-generalize-mixedorder/NAMESPACE (from rev 2035, pkg/gtools/NAMESPACE) =================================================================== --- branches/gtools-generalize-mixedorder/NAMESPACE (rev 0) +++ branches/gtools-generalize-mixedorder/NAMESPACE 2015-05-27 00:28:22 UTC (rev 2038) @@ -0,0 +1,45 @@ +useDynLib(gtools) + +export( + addLast, + asc, + ASCIIfy, + ask, + assert, + assignEdgewise, + binsearch, + capture, + chr, + checkRVersion, + combinations, + ddirichlet, + defmacro, + even, + foldchange, + foldchange2logratio, + getDependencies, + inv.logit, + invalid, + keywords, + lastAdd, + loadedPackages, + logit, + logratio2foldchange, + mixedorder, + mixedsort, + na.replace, + odd, + permutations, + permute, + quantcut, + rdirichlet, + running, + scat, + setTCPNoDelay, + smartbind, + sprint, + stars.pval, + strmacro, + unByteCode, + unByteCodeAssign + ) Copied: branches/gtools-generalize-mixedorder/R/asc.R (from rev 2034, pkg/gtools/R/asc.R) =================================================================== --- branches/gtools-generalize-mixedorder/R/asc.R (rev 0) +++ branches/gtools-generalize-mixedorder/R/asc.R 2015-05-27 00:28:22 UTC (rev 2038) @@ -0,0 +1,2 @@ +asc <- function(char) sapply(char, function(x) strtoi(charToRaw(x),16L) ) +chr <- function(n) sapply(n, function(x) rawToChar(as.raw(x)) ) Deleted: branches/gtools-generalize-mixedorder/R/dirichlet.R =================================================================== --- pkg/gtools/R/dirichlet.R 2015-05-02 17:38:35 UTC (rev 2018) +++ branches/gtools-generalize-mixedorder/R/dirichlet.R 2015-05-27 00:28:22 UTC (rev 2038) @@ -1,70 +0,0 @@ -# $Id$ - -# Posted by Ben Bolker to R-News on Fri Dec 15 2000 -# http://www.r-project.org/nocvs/mail/r-help/2000/3865.html -# -# Some code (originally contributed by Ian Wilson -# - - -# functions for the "Dirichlet function", the multidimensional -# generalization of the beta distribution: it's the Bayesian -# canonical # distribution for the parameter estimates of a -# multinomial distribution. - -# "pdirichlet" and "qdirichlet" (distribution function and quantiles) -# would be more difficult because you'd first have to decide how to -# define the distribution function for a multivariate distribution -# ... I'm sure this could be done but I don't know how - - - -ddirichlet<-function(x,alpha) -## probability density for the Dirichlet function, where x=vector of -## probabilities -## and (alpha-1)=vector of observed samples of each type -## ddirichlet(c(p,1-p),c(x1,x2)) == dbeta(p,x1,x2) -{ - - dirichlet1 <- function(x, alpha) - { - logD <- sum(lgamma(alpha)) - lgamma(sum(alpha)) - s<-sum((alpha-1)*log(x)) - exp(sum(s)-logD) - - } - - # make sure x is a matrix - if(!is.matrix(x)) - if(is.data.frame(x)) - x <- as.matrix(x) - else - x <- t(x) - - if(!is.matrix(alpha)) - alpha <- matrix( alpha, ncol=length(alpha), nrow=nrow(x), byrow=TRUE) - - if( any(dim(x) != dim(alpha)) ) - stop("Mismatch between dimensions of 'x' and 'alpha'.") - - pd <- vector(length=nrow(x)) - for(i in 1:nrow(x)) - pd[i] <- dirichlet1(x[i,],alpha[i,]) - - # Enforce 0 <= x[i,j] <= 1, sum(x[i,]) = 1 - pd[ apply( x, 1, function(z) any( z <0 | z > 1)) ] <- 0 - pd[ apply( x, 1, function(z) all.equal(sum( z ),1) !=TRUE) ] <- 0 - pd -} - - -rdirichlet<-function(n,alpha) -## generate n random deviates from the Dirichlet function with shape -## parameters alpha -{ - l<-length(alpha); - x<-matrix(rgamma(l*n,alpha),ncol=l,byrow=TRUE); - sm<-x%*%rep(1,l); - x/as.vector(sm); -} - Copied: branches/gtools-generalize-mixedorder/R/dirichlet.R (from rev 2020, pkg/gtools/R/dirichlet.R) =================================================================== --- branches/gtools-generalize-mixedorder/R/dirichlet.R (rev 0) +++ branches/gtools-generalize-mixedorder/R/dirichlet.R 2015-05-27 00:28:22 UTC (rev 2038) @@ -0,0 +1,70 @@ +# $Id$ + +# Posted by Ben Bolker to R-News on Fri Dec 15 2000 +# http://www.r-project.org/nocvs/mail/r-help/2000/3865.html +# +# Some code (originally contributed by Ian Wilson +# + + +# functions for the "Dirichlet function", the multidimensional +# generalization of the beta distribution: it's the Bayesian +# canonical # distribution for the parameter estimates of a +# multinomial distribution. + +# "pdirichlet" and "qdirichlet" (distribution function and quantiles) +# would be more difficult because you'd first have to decide how to +# define the distribution function for a multivariate distribution +# ... I'm sure this could be done but I don't know how + + + +ddirichlet<-function(x,alpha) +## probability density for the Dirichlet function, where x=vector of +## probabilities +## and (alpha-1)=vector of observed samples of each type +## ddirichlet(c(p,1-p),c(x1,x2)) == dbeta(p,x1,x2) +{ + + dirichlet1 <- function(x, alpha) + { + logD <- sum(lgamma(alpha)) - lgamma(sum(alpha)) + s <-(alpha-1)*log(x) + s <- ifelse(alpha==1 & x==0, -Inf, s) + exp(sum(s)-logD) + } + + # make sure x is a matrix + if(!is.matrix(x)) + if(is.data.frame(x)) + x <- as.matrix(x) + else + x <- t(x) + + if(!is.matrix(alpha)) + alpha <- matrix( alpha, ncol=length(alpha), nrow=nrow(x), byrow=TRUE) + + if( any(dim(x) != dim(alpha)) ) + stop("Mismatch between dimensions of 'x' and 'alpha'.") + + pd <- vector(length=nrow(x)) + for(i in 1:nrow(x)) + pd[i] <- dirichlet1(x[i,],alpha[i,]) + + # Enforce 0 <= x[i,j] <= 1, sum(x[i,]) = 1 + pd[ apply( x, 1, function(z) any( z <0 | z > 1)) ] <- 0 + pd[ apply( x, 1, function(z) all.equal(sum( z ),1) !=TRUE) ] <- 0 + pd +} + + +rdirichlet<-function(n,alpha) +## generate n random deviates from the Dirichlet function with shape +## parameters alpha +{ + l<-length(alpha); + x<-matrix(rgamma(l*n,alpha),ncol=l,byrow=TRUE); + sm<-x%*%rep(1,l); + x/as.vector(sm); +} + Deleted: branches/gtools-generalize-mixedorder/R/mixedsort.R =================================================================== --- pkg/gtools/R/mixedsort.R 2015-05-02 17:38:35 UTC (rev 2018) +++ branches/gtools-generalize-mixedorder/R/mixedsort.R 2015-05-27 00:28:22 UTC (rev 2038) @@ -1,116 +0,0 @@ -mixedsort <- function(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE) - { - ord <- mixedorder(x, decreasing=decreasing, na.last=na.last, - blank.last=blank.last) - x[ord] - } - -mixedorder <- function(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE) - { - # - Split each each character string into an vector of strings and - # numbers - # - Separately rank numbers and strings - # - Combine orders so that strings follow numbers - - if(length(x)<1) - return(NULL) - else if(length(x)==1) - return(1) - - if( !is.character(x) ) - return( order(x, decreasing=decreasing, na.last=na.last) ) - - delim="\\$\\@\\$" - - numeric <- function(x) - { - suppressWarnings( as.numeric(x) ) - } - - nonnumeric <- function(x) - { - suppressWarnings( ifelse(is.na(as.numeric(x)), toupper(x), NA) ) - } - - x <- as.character(x) - - which.nas <- which(is.na(x)) - which.blanks <- which(x=="") - - #### - # - Convert each character string into an vector containing single - # character and numeric values. - #### - - # find and mark numbers in the form of +1.23e+45.67 - delimited <- gsub("([+-]{0,1}[0-9]+\\.{0,1}[0-9]*([eE][\\+\\-]{0,1}[0-9]+\\.{0,1}[0-9]*){0,1})", - paste(delim,"\\1",delim,sep=""), x) - - # separate out numbers - step1 <- strsplit(delimited, delim) - - # remove empty elements - step1 <- lapply( step1, function(x) x[x>""] ) - - # create numeric version of data - step1.numeric <- lapply( step1, numeric ) - - # create non-numeric version of data - step1.character <- lapply( step1, nonnumeric ) - - # now transpose so that 1st vector contains 1st element from each - # original string - maxelem <- max(sapply(step1, length)) - - step1.numeric.t <- lapply(1:maxelem, - function(i) - sapply(step1.numeric, - function(x)x[i]) - ) - - step1.character.t <- lapply(1:maxelem, - function(i) - sapply(step1.character, - function(x)x[i]) - ) - - # now order them - rank.numeric <- sapply(step1.numeric.t, rank) - rank.character <- sapply(step1.character.t, - function(x) as.numeric(factor(x))) - - # and merge - rank.numeric[!is.na(rank.character)] <- 0 # mask off string values - - rank.character <- t( - t(rank.character) + - apply(matrix(rank.numeric),2,max,na.rm=TRUE) - ) - - rank.overall <- ifelse(is.na(rank.character),rank.numeric,rank.character) - - order.frame <- as.data.frame(rank.overall) - if(length(which.nas) > 0) - if(is.na(na.last)) - order.frame[which.nas,] <- NA - else if(na.last) - order.frame[which.nas,] <- Inf - else - order.frame[which.nas,] <- -Inf - - if(length(which.blanks) > 0) - if(is.na(blank.last)) - order.frame[which.blanks,] <- NA - else if(blank.last) - order.frame[which.blanks,] <- 1e99 - else - order.frame[which.blanks,] <- -1e99 - - order.frame <- as.list(order.frame) - order.frame$decreasing <- decreasing - order.frame$na.last <- NA - - retval <- do.call("order", order.frame) - - return(retval) - } Copied: branches/gtools-generalize-mixedorder/R/mixedsort.R (from rev 2019, pkg/gtools/R/mixedsort.R) =================================================================== --- branches/gtools-generalize-mixedorder/R/mixedsort.R (rev 0) +++ branches/gtools-generalize-mixedorder/R/mixedsort.R 2015-05-27 00:28:22 UTC (rev 2038) @@ -0,0 +1,191 @@ +mixedsort <- function(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE) + { + ord <- mixedorder(x, decreasing=decreasing, na.last=na.last, + blank.last=blank.last) + x[ord] + } + +mixedorder <- function(x, + decreasing=FALSE, + na.last=TRUE, + blank.last=FALSE, + type=c('inf', + 'decimal', + 'roman', + 'character'), + roman.case=c("both", "lower", "upper"), + hex.case=c("both", "lower", "upper") + ) + { + ## - Split each each character string into an vector of strings and + ## numbers + ## - Separately rank numbers and strings + ## - Combine orders so that strings follow numbers + + TOKEN.TYPES <- c('inf', 'decimal', 'roman', 'hexadecimal', 'octal', 'binary', 'character') + type <- match.arg(type, + choices=TOKEN.TYPES, + several.ok=TRUE) + + tokens <- rep('', length=length(TOKEN.TYPES)) + names(tokens) <- TOKEN.TYPES + tokens[which(TOKEN.TYPES %in% type)] <- chr(1:length(type)) + + + if(length(x)<1) + return(NULL) + else if(length(x)==1) + return(1) + + if( !is.character(x) ) + return( order(x, decreasing=decreasing, na.last=na.last) ) + + toDecimal <- function(x) + { + as.numeric(x) + } + + toRoman <- function(x) + { + roman2int(x) + } + + toString <- function(x) + { + ifelse( is.na(as.numeric(x)) || is.na(roman2int(x)), toupper(x), NA) + } + + x <- as.character(x) + + which.nas <- which(is.na(x)) + which.blanks <- which(x=="") + + #### + ## Insert delimters bracketing numeric and roman values + #### + + regex <- list() + + ## numbers in the form of +1.23e+45.67 + regex$decimal <- "(?:(?i)(?:[-+]?)(?:(?=[.]?[0123456789])(?:[0123456789]*)(?:(?:[.])(?:[0123456789]{0,}))?)(?:(?:[eE])(?:(?:[-+]?)(?:[0123456789]+))|))" + + ## +-Inf + regex$inf <- "\\b([+-]*Inf)\\b" + + ## Roman numerals + if(roman.case=="lower") + regex$roman <- "\\b([ivxcldm]+)\\b" + else if(roman.case=="upper") + regex$roman <- "\\b([IVXCLDM]+)\\b" + else if(roman.case=="both") + regex$roman <- "\\b([IVXCLDMivxcldm]+)\\b" + else stop("invalid value for roman.case: ", roman.case) + + ## Hexadecimal + if(hex.case=="lower") + regex$hex <- "\\b([0-9a-f]+)\\b" + else if(hex.case=="upper") + regex$hex <- "\\b([0-9A-F]+)\\b" + else if (hex.case=="both") + regex$hex <- "\\b([0-9A-Fa-f]+)\\b" + else stop("invalid value for hex.case: ", hex.case) + + ## Octal + regex$octal <- "([0-8]+)" + + ## Binary numbers + regex$binary <- "([01]+)" + + ## Character + regex$character <- "[A-Za-z]+" + + ## Delimiters + regex$delim <- "[\001-\007]" + regex$nondelim <- "[^\001-\007]+" + + matches <- list() + + ## tokenize... + delimited <- x + for( tt in TOKEN.TYPES ) + { + if(tt %in% type) + { + m <- gregexpr(regex[[tt]], delimited, perl=TRUE, ignore.case=FALSE) + matches[[tt]] <- regmatches(delimited, m) + regmatches(delimited, m) <- tokens[tt] + + + } + } + + ## Remove all non-token characters + delimited <- gsub( regex.nondelim, "", delimited) + + ntokens <- sapply(delimited, nchar) + + ## remove empty elements + step1 <- lapply( step1, function(x) x[x>""] ) + + ## create decimal version of data + suppressWarnings( step1.decimal <- lapply( step1, toDecimal ) ) + + ## create non-numeric version of data + suppressWarnings( step1.character <- lapply( step1, toString ) ) + + ## now transpose so that 1st vector contains 1st element from each + ## original string + maxelem <- max(sapply(step1, length)) + + step1.decimal.t <- lapply(1:maxelem, + function(i) + sapply(step1.decimal, + function(x)x[i]) + ) + + step1.character.t <- lapply(1:maxelem, + function(i) + sapply(step1.character, + function(x)x[i]) + ) + + ## now order them + rank.decimal <- sapply(step1.decimal.t, rank) + rank.character <- sapply(step1.character.t, + function(x) as.numeric(factor(x))) + + ## and merge + rank.decimal[!is.na(rank.character)] <- 0 # mask off string values + + rank.character <- t( + t(rank.character) + + apply(matrix(rank.decimal),2,max,na.rm=TRUE) + ) + + rank.overall <- ifelse(is.na(rank.character),rank.decimal,rank.character) + + order.frame <- as.data.frame(rank.overall) + if(length(which.nas) > 0) + if(is.na(na.last)) + order.frame[which.nas,] <- NA + else if(na.last) + order.frame[which.nas,] <- Inf + else + order.frame[which.nas,] <- -Inf + + if(length(which.blanks) > 0) + if(is.na(blank.last)) + order.frame[which.blanks,] <- NA + else if(blank.last) + order.frame[which.blanks,] <- 1e99 + else + order.frame[which.blanks,] <- -1e99 + + order.frame <- as.list(order.frame) + order.frame$decreasing <- decreasing + order.frame$na.last <- NA + + retval <- do.call("order", order.frame) + + return(retval) + } Deleted: branches/gtools-generalize-mixedorder/R/roman2int.R =================================================================== --- pkg/gtools/R/roman2int.R 2015-05-02 17:38:35 UTC (rev 2018) +++ branches/gtools-generalize-mixedorder/R/roman2int.R 2015-05-27 00:28:22 UTC (rev 2038) @@ -1,37 +0,0 @@ -testConvert <- function() - { - roman <- 'IVXLCDM' - retval <- romandigit.convert(roman) - stopifnot(retval==c(1,5,10,50,100,500,1000)) - return(TRUE) - } - -romandigit.convert <- function(roman) - { - retval <- .C('convert', - roman=as.character(roman), - nchar=as.integer(nchar(roman)), - values=integer(nchar(roman)) - ) - retval$values - } - -roman2int.inner <- function(roman) - { - results <- .C("roman2int", - roman = as.character(roman), - nchar = as.integer(nchar(roman)), - value = integer(1), - - PACKAGE="gtools") - - return(results$value) - } - -roman2int <- function(roman) - { - roman <- trim(toupper(as.character(roman))) - retval <- sapply(roman, roman2int.inner) - retval - } - Copied: branches/gtools-generalize-mixedorder/R/roman2int.R (from rev 2036, pkg/gtools/R/roman2int.R) =================================================================== --- branches/gtools-generalize-mixedorder/R/roman2int.R (rev 0) +++ branches/gtools-generalize-mixedorder/R/roman2int.R 2015-05-27 00:28:22 UTC (rev 2038) @@ -0,0 +1,48 @@ +testConvert <- function() + { + roman <- 'IVXLCDM' + retval <- romandigit.convert(roman) + stopifnot(retval==c(1,5,10,50,100,500,1000)) + return(TRUE) + } + +romandigit.convert <- function(roman) + { + retval <- .C('convert', + roman=as.character(roman), + nchar=as.integer(nchar(roman)), + values=integer(nchar(roman)) + ) + retval$values + } + +roman2int.inner <- function(roman) + { + results <- .C("roman2int", + roman = as.character(roman), + nchar = as.integer(nchar(roman)), + value = integer(1), + + PACKAGE="gtools") + + return(results$value) + } + +roman2int <- function(roman) + { + roman <- trim(toupper(as.character(roman))) + + tryIt <- function(x) + { + retval <- try(roman2int.inner(x), silent=TRUE) + if(is.numeric(retval)) + retval + else + NA + } + + retval <- sapply(roman, tryIt) + + retval + } + Modified: branches/gtools-generalize-mixedorder/inst/NEWS =================================================================== --- pkg/gtools/inst/NEWS 2015-05-02 17:38:35 UTC (rev 2018) +++ branches/gtools-generalize-mixedorder/inst/NEWS 2015-05-27 00:28:22 UTC (rev 2038) @@ -1,3 +1,23 @@ +gtools 3.5.0 - 2015-04-28 +------------------------- + +Enhacements: + +- mixedsort() and mixedorder() now have arguments 'decreasing', + 'na.last', and 'blank.last' arguments to control sort ordering. + +- speed up mixedorder() (and hence mixedsort()) by moving + suppressWarnings outside of lapply loops. (Suggestion by Henrik + Bengtsson.) + +- new function roman2int() to convert roman numerals to integers. + +Bug fixes: + + +Other changes: + + gtools 3.4.3 - 2015-04-06 ------------------------- Copied: branches/gtools-generalize-mixedorder/man/asc.Rd (from rev 2037, pkg/gtools/man/asc.Rd) =================================================================== --- branches/gtools-generalize-mixedorder/man/asc.Rd (rev 0) +++ branches/gtools-generalize-mixedorder/man/asc.Rd 2015-05-27 00:28:22 UTC (rev 2038) @@ -0,0 +1,67 @@ +\name{asc} +\alias{asc} +\alias{chr} +\title{Convert between characters and ASCII codes} +\description{ + \code{asc} returns the ASCII codes for the specified characters. + \code{chr} returns the characters corresponding to the specified ASCII codes. +} +\usage{ + asc(char, simplify=TRUE) + chr(ascii) +} +\arguments{ + \item{char}{vector of character strings} + + \item{simplify}{logical indicating whether to attempt to convert the + result into a vector or matrix object. See \code{\link[base]{sapply}} + for details. + } + \item{ascii}{vector or list of vectors containing integer ASCII codes} +} +\value{ + \code{asc} returns the integer ASCII values for each character + in the elements of \code{char}. If \code{simplify=FALSE} the result + will be a list contining one vector per element of \code{char}. If + \code{simplify=TRUE}, the code will attempt to convert the result into + a vector or matrix. + + \code{asc} returns the characters corresponding to the provided ASCII + values. +} +\author{ + Adapted by Gregory R. Warnes \email{greg at warnes.net} from code posted + on the 'Data Debrief' blog on 2011-03-09 at + \url{http://datadebrief.blogspot.com/2011/03/ascii-code-table-in-r.html}. +} +\seealso{ + \code{\link[base]{strtoi}}, + \code{\link[base]{charToRaw}}, + \code{\link[base]{rawToChar}}, + \code{\link[base]{as.raw}} +} +\examples{ + ## ascii codes for lowercase letters + asc(letters) + + ## uppercase letters from ascii codes + chr(65:90) + + ## works on muti-character strings + ( tmp <- asc('hello!') ) + chr(tmp) + + ## Use 'simplify=FALSE' to return the result as a list + ( tmp <- asc('hello!', simplify=FALSE) ) + chr(tmp) + + ## When simplify=FALSE the results can be... + asc( c('a', 'e', 'i', 'o', 'u', 'y' ) ) # a vector + asc( c('ae', 'io', 'uy' ) ) # or a matrix + + ## When simplify=TRUE the results are always a list... + asc( c('a', 'e', 'i', 'o', 'u', 'y' ), simplify=FALSE ) + asc( c('ae', 'io', 'uy' ), simplify=FALSE) +} +\keyword{character} +\keyword{programming} Deleted: branches/gtools-generalize-mixedorder/man/mixedsort.Rd =================================================================== --- pkg/gtools/man/mixedsort.Rd 2015-05-02 17:38:35 UTC (rev 2018) +++ branches/gtools-generalize-mixedorder/man/mixedsort.Rd 2015-05-27 00:28:22 UTC (rev 2038) @@ -1,88 +0,0 @@ -\name{mixedsort} -\alias{mixedsort} -\alias{mixedorder} -\title{Order or Sort strings with embedded numbers so that the numbers - are in the correct order} -\description{ - These functions sort or order character strings containing embedded - numbers so that the numbers are numerically sorted rather than sorted - by character value. I.e. "Asprin 50mg" will come before - "Asprin 100mg". In addition, case of character strings is ignored so - that "a", will come before "B" and "C". -} -\usage{ -mixedsort(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE, ...) -mixedorder(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE, ...) -} -\arguments{ - \item{x}{Vector to be sorted.} - \item{decreasing}{logical. Should the sort be increasing or - decreasing? Note that \code{descending=TRUE} reverses the meanings of - \code{na.lst} and \code{blanks.last}.} - \item{na.last}{for controlling the treatment of ?NA?s. If ?TRUE?, missing - values in the data are put last; if ?FALSE?, they are put - first; if ?NA?, they are removed.} -} -\details{ - I often have character vectors (e.g. factor labels), such as compound - and dose, that contain both text and numeric data. This function - is useful for sorting these character vectors into a logical order. - - It does so by splitting each character vector into a sequence of - character and numeric sections, and then sorting along these sections, - with numbers being sorted by numeric value (e.g. "50" comes before - "100"), followed by characters strings sorted by character - value (e.g. "A" comes before "B"). - - By default, sort order is ascending, empty strings are sorted to the front, - and \code{NA} values to the end. Setting \code{descending=TRUE} - changes the sort order to descending and reverses the meanings of - \code{na.last} and \code{blank.last}. -} -\value{ - \code{mixedorder} returns a vector giving the sort order of the input - elements. \code{mixedsort} returns the sorted vector. -} -\author{ Gregory R. Warnes \email{greg at warnes.net} } -\seealso{ \code{\link[base]{sort}}, \code{\link[base]{order}} } -\examples{ -## compound & dose labels -Treatment <- c("Control", "Asprin 10mg/day", "Asprin 50mg/day", - "Asprin 100mg/day", "Acetomycin 100mg/day", - "Acetomycin 1000mg/day") - -## ordinary sort puts the dosages in the wrong order -sort(Treatment) - -## but mixedsort does the 'right' thing -mixedsort(Treatment) - -## Here is a more complex example -x <- rev(c("AA 0.50 ml", "AA 1.5 ml", "AA 500 ml", "AA 1500 ml", - "EXP 1", "AA 1e3 ml", "A A A", "1 2 3 A", "NA", NA, "1e2", - "", "-", "1A", "1 A", "100", "100A", "Inf")) - -mixedorder(x) - -mixedsort(x) # Notice that plain numbers, including 'Inf' show up - # before strings, NAs at the end, and blanks at the - # beginning . - - -mixedsort(x, na.last=TRUE) # default -mixedsort(x, na.last=FALSE) # push NAs to the front - - -mixedsort(x, blank.last=FALSE) # default -mixedsort(x, blank.last=TRUE) # push blanks to the end - -mixedsort(x, decreasing=FALSE) # default -mixedsort(x, decreasing=TRUE) # reverse sort order -} -\keyword{univar} -\keyword{manip} - - -\concept{natural sort} -\concept{dictionary sort} - Copied: branches/gtools-generalize-mixedorder/man/mixedsort.Rd (from rev 2027, pkg/gtools/man/mixedsort.Rd) =================================================================== --- branches/gtools-generalize-mixedorder/man/mixedsort.Rd (rev 0) +++ branches/gtools-generalize-mixedorder/man/mixedsort.Rd 2015-05-27 00:28:22 UTC (rev 2038) @@ -0,0 +1,92 @@ +\name{mixedsort} +\alias{mixedsort} +\alias{mixedorder} +\title{Order or Sort strings with embedded numbers so that the numbers + are in the correct order} +\description{ + These functions sort or order character strings containing embedded + numbers so that the numbers are numerically sorted rather than sorted + by character value. I.e. "Asprin 50mg" will come before + "Asprin 100mg". In addition, case of character strings is ignored so + that "a", will come before "B" and "C". +} +\usage{ +mixedsort(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE) +mixedorder(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE) +} +\arguments{ + \item{x}{Vector to be sorted.} + \item{decreasing}{logical. Should the sort be increasing or + decreasing? Note that \code{descending=TRUE} reverses the meanings of + \code{na.last} and \code{blanks.last}.} + \item{na.last}{for controlling the treatment of \code{NA} values. If \code{TRUE}, missing + values in the data are put last; if \code{FALSE}, they are put + first; if \code{NA}, they are removed.} + \item{blank.last}{for controlling the treatment of blank values. If \code{TRUE}, blank + values in the data are put last; if \code{FALSE}, they are put + first; if \code{NA}, they are removed.} +} +\details{ + I often have character vectors (e.g. factor labels), such as compound + and dose, that contain both text and numeric data. This function + is useful for sorting these character vectors into a logical order. + + It does so by splitting each character vector into a sequence of + character and numeric sections, and then sorting along these sections, + with numbers being sorted by numeric value (e.g. "50" comes before + "100"), followed by characters strings sorted by character + value (e.g. "A" comes before "B") \emph{ignoring case} (e.g. 'A' has + the same sort order as 'a'). + + By default, sort order is ascending, empty strings are sorted to the front, + and \code{NA} values to the end. Setting \code{descending=TRUE} + changes the sort order to descending and reverses the meanings of + \code{na.last} and \code{blank.last}. +} +\value{ + \code{mixedorder} returns a vector giving the sort order of the input + elements. \code{mixedsort} returns the sorted vector. +} +\author{ Gregory R. Warnes \email{greg at warnes.net} } +\seealso{ \code{\link[base]{sort}}, \code{\link[base]{order}} } +\examples{ +## compound & dose labels +Treatment <- c("Control", "Asprin 10mg/day", "Asprin 50mg/day", + "Asprin 100mg/day", "Acetomycin 100mg/day", + "Acetomycin 1000mg/day") + +## ordinary sort puts the dosages in the wrong order +sort(Treatment) + +## but mixedsort does the 'right' thing +mixedsort(Treatment) + +## Here is a more complex example +x <- rev(c("AA 0.50 ml", "AA 1.5 ml", "AA 500 ml", "AA 1500 ml", + "EXP 1", "AA 1e3 ml", "A A A", "1 2 3 A", "NA", NA, "1e2", + "", "-", "1A", "1 A", "100", "100A", "Inf")) + +mixedorder(x) + +mixedsort(x) # Notice that plain numbers, including 'Inf' show up + # before strings, NAs at the end, and blanks at the + # beginning . + + +mixedsort(x, na.last=TRUE) # default +mixedsort(x, na.last=FALSE) # push NAs to the front + + +mixedsort(x, blank.last=FALSE) # default +mixedsort(x, blank.last=TRUE) # push blanks to the end + +mixedsort(x, decreasing=FALSE) # default +mixedsort(x, decreasing=TRUE) # reverse sort order +} +\keyword{univar} +\keyword{manip} + + +\concept{natural sort} +\concept{dictionary sort} + Deleted: branches/gtools-generalize-mixedorder/man/quantcut.Rd =================================================================== --- pkg/gtools/man/quantcut.Rd 2015-05-02 17:38:35 UTC (rev 2018) +++ branches/gtools-generalize-mixedorder/man/quantcut.Rd 2015-05-27 00:28:22 UTC (rev 2038) @@ -1,76 +0,0 @@ -% $Id$ -% -\name{quantcut} -\alias{quantcut} - -\title{ Create a Factor Variable Using the Quantiles of a Continuous Variable} -\description{ - Create a factor variable using the quantiles of a continous variable. -} -\usage{ -quantcut(x, q=seq(0,1,by=0.25), na.rm=TRUE, ...) -} -%- maybe also `usage' for other objects documented here. -\arguments{ - \item{x}{ Continous variable. } - \item{q}{ Either a integer number of equally spaced quantile groups to - create, or a vector of quantiles used for creating groups. Defaults to - \code{q=4} which is equivalent to \code{q=seq(0, 1, by=0.25)}. - See \code{\link{quantile}} for details. } - \item{na.rm}{ Boolean indicating whether missing values should be - removed when computing quantiles. Defaults to TRUE.} - \item{\dots}{ Optional arguments passed to \code{\link{cut}}. } -} -\details{ - - This function uses \code{\link{quantile}} to obtain the specified - quantiles of \code{x}, then calls \code{\link{cut}} to create a factor - variable using the intervals specified by these quantiles. - - It properly handles cases where more than one quantile obtains the - same value, as in the second example below. Note that in this case, - there will be fewer generated factor levels than the specified number - of quantile intervals. -} -\value{ - Factor variable with one level for each quantile interval. -} - -\author{Gregory R. Warnes \email{greg at warnes.net}} - -\seealso{ \code{\link{cut}}, \code{\link{quantile}} } - -\examples{ - - ## create example data - \testonly{ - set.seed(1234) - } - x <- rnorm(1000) - - ## cut into quartiles - quartiles <- quantcut( x ) - table(quartiles) - - ## cut into deciles - deciles.1 <- quantcut( x, 10 ) - table(deciles.1) - # or equivalently - deciles.2 <- quantcut( x, seq(0,1,by=0.1) ) - - \testonly{ [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/r-gregmisc -r 2038 From noreply at r-forge.r-project.org Wed May 27 03:37:41 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 03:37:41 +0200 (CEST) Subject: [R-gregmisc-commits] r2039 - in pkg/gtools: R man Message-ID: <20150527013741.18BAC1879E1@r-forge.r-project.org> Author: warnes Date: 2015-05-27 03:37:39 +0200 (Wed, 27 May 2015) New Revision: 2039 Modified: pkg/gtools/R/mixedsort.R pkg/gtools/man/mixedsort.Rd Log: Add roman numeral support to mixedorder() and mixedsort(). Modified: pkg/gtools/R/mixedsort.R =================================================================== --- pkg/gtools/R/mixedsort.R 2015-05-27 00:28:22 UTC (rev 2038) +++ pkg/gtools/R/mixedsort.R 2015-05-27 01:37:39 UTC (rev 2039) @@ -1,17 +1,37 @@ -mixedsort <- function(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE) +mixedsort <- function(x, + decreasing=FALSE, + na.last=TRUE, + blank.last=FALSE, + numeric.type=c("decimal", "roman"), + roman.case=c("upper","lower","both") + ) { - ord <- mixedorder(x, decreasing=decreasing, na.last=na.last, - blank.last=blank.last) + ord <- mixedorder(x, + decreasing=decreasing, + na.last=na.last, + blank.last=blank.last, + numeric.type=numeric.type, + roman.case=roman.case + ) x[ord] } -mixedorder <- function(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE) +mixedorder <- function(x, + decreasing=FALSE, + na.last=TRUE, + blank.last=FALSE, + numeric.type=c("decimal", "roman"), + roman.case=c("upper","lower","both") + ) { # - Split each each character string into an vector of strings and # numbers # - Separately rank numbers and strings # - Combine orders so that strings follow numbers + numeric.type <- match.arg(numeric.type) + roman.case <- match.arg(roman.case) + if(length(x)<1) return(NULL) else if(length(x)==1) @@ -22,14 +42,26 @@ delim="\\$\\@\\$" - numeric <- function(x) + if(numeric.type=="decimal") { - as.numeric(x) + regex <- "((?:(?i)(?:[-+]?)(?:(?=[.]?[0123456789])(?:[0123456789]*)(?:(?:[.])(?:[0123456789]{0,}))?)(?:(?:[eE])(?:(?:[-+]?)(?:[0123456789]+))|)))" # uses PERL syntax + numeric <- function(x) as.numeric(x) } + else if (numeric.type=="roman") + { + regex <- switch(roman.case, + "both" = "([IVXCLDMivxcldm]+)", + "upper" = "([IVXCLDM]+)", + "lower" = "([ivxcldm]+)" + ) + numeric <- function(x) roman2int(x) + } + else + stop("Unknown value for numeric.type: ", numeric.type) nonnumeric <- function(x) { - ifelse(is.na(as.numeric(x)), toupper(x), NA) + ifelse(is.na(numeric(x)), toupper(x), NA) } x <- as.character(x) @@ -43,8 +75,10 @@ #### # find and mark numbers in the form of +1.23e+45.67 - delimited <- gsub("([+-]{0,1}[0-9]+\\.{0,1}[0-9]*([eE][\\+\\-]{0,1}[0-9]+\\.{0,1}[0-9]*){0,1})", - paste(delim,"\\1",delim,sep=""), x) + delimited <- gsub(regex, + paste(delim,"\\1",delim,sep=""), + x, + perl=TRUE) # separate out numbers step1 <- strsplit(delimited, delim) Modified: pkg/gtools/man/mixedsort.Rd =================================================================== --- pkg/gtools/man/mixedsort.Rd 2015-05-27 00:28:22 UTC (rev 2038) +++ pkg/gtools/man/mixedsort.Rd 2015-05-27 01:37:39 UTC (rev 2039) @@ -11,8 +11,13 @@ that "a", will come before "B" and "C". } \usage{ -mixedsort(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE) -mixedorder(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE) +mixedsort(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE, + numeric.type=c("decimal", "roman"), + roman.case=c("upper","lower","both") ) +) +mixedorder(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE, + numeric.type=c("decimal", "roman"), + roman.case=c("upper","lower","both") ) } \arguments{ \item{x}{Vector to be sorted.} @@ -25,6 +30,12 @@ \item{blank.last}{for controlling the treatment of blank values. If \code{TRUE}, blank values in the data are put last; if \code{FALSE}, they are put first; if \code{NA}, they are removed.} + \item{numeric.type}{either "decimal" (default) or "roman". Are numeric values represented as + decimal numbers (\code{numeric.type="decimal"}) or as Roman numerals + (\code{numeric.type="roman"})? } + \item{roman.case}{one of "upper", "lower", or "both". Are roman + numerals represented using only capital letters ('IX') or lower-case + letters ('ix') or both?} } \details{ I often have character vectors (e.g. factor labels), such as compound @@ -42,6 +53,11 @@ and \code{NA} values to the end. Setting \code{descending=TRUE} changes the sort order to descending and reverses the meanings of \code{na.last} and \code{blank.last}. + + Parsing looks for decimal numbers unless \code{numeric.type="roman"}, + in which parsing looks for roman numerals, with character case + specified by \code{roman.case}. + } \value{ \code{mixedorder} returns a vector giving the sort order of the input @@ -82,11 +98,21 @@ mixedsort(x, decreasing=FALSE) # default mixedsort(x, decreasing=TRUE) # reverse sort order + +## Roman numerals +chapters <- c("V. Non Sequiturs", "II. More Nonsense", + "I. Nonsense", "IV. Nonesensical Citations", + "III. Utter Nonsense") +mixedsort(chapters, numeric.type="roman" ) + +## Lower-case Roman numerals +vals <- c("xix", "xii", "mcv", "iii", "iv", "dcclxxii", "cdxcii", + "dcxcviii", "dcvi", "cci") +(ordered <- mixedsort(vals, numeric.type="roman", roman.case="lower")) +roman2int(ordered) } \keyword{univar} \keyword{manip} - - \concept{natural sort} \concept{dictionary sort} From noreply at r-forge.r-project.org Wed May 27 04:17:48 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 04:17:48 +0200 (CEST) Subject: [R-gregmisc-commits] r2040 - in pkg/gtools: . inst Message-ID: <20150527021748.1F33218770D@r-forge.r-project.org> Author: warnes Date: 2015-05-27 04:17:45 +0200 (Wed, 27 May 2015) New Revision: 2040 Modified: pkg/gtools/DESCRIPTION pkg/gtools/inst/ChangeLog pkg/gtools/inst/NEWS Log: Update DESCRIPTION, ChangeLog, NEWS Modified: pkg/gtools/DESCRIPTION =================================================================== --- pkg/gtools/DESCRIPTION 2015-05-27 01:37:39 UTC (rev 2039) +++ pkg/gtools/DESCRIPTION 2015-05-27 02:17:45 UTC (rev 2040) @@ -20,10 +20,11 @@ - apply a function over adjacent subsets of a vector ('running'), - modify the TCP\_NODELAY ('de-Nagle') flag for socket objects, - efficient 'rbind' of data frames, even if the column names don't match ('smartbind'), - - generate significance stars from p-values ('stars.pval'). + - generate significance stars from p-values ('stars.pval'), + - convert characters to/from ASCII codes. Version: 3.4.3 -Date: 2015-04-23 +Date: 2015-05-26 Author: Gregory R. Warnes, Ben Bolker, and Thomas Lumley Maintainer: Gregory R. Warnes -License: LGPL-2.1 +License: GPL-2 Modified: pkg/gtools/inst/ChangeLog =================================================================== --- pkg/gtools/inst/ChangeLog 2015-05-27 01:37:39 UTC (rev 2039) +++ pkg/gtools/inst/ChangeLog 2015-05-27 02:17:45 UTC (rev 2040) @@ -1,3 +1,21 @@ +2015-05-27 warnes + + * [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 + between characters and ASCII codes + * [r2036] R/roman2int.R: roman2int() now returns NA for invalid + roman numeral strings instead of generating an error. + * [r2035] NAMESPACE: Add asc(), chr(), assignEdgewise(), + unByteCode(), and + unByteCodeAssign() to package NAMESPACE. + * [r2034] R/asc.R: Add asc() and chr() functions for converting + between characters and ASCII codes + +2015-05-26 warnes + + * [r2030] inst/ChangeLog: Add changelog to svn repository + 2015-05-25 warnes * [r2029] tests/test_ddirichlet.R: Add library call. Modified: pkg/gtools/inst/NEWS =================================================================== --- pkg/gtools/inst/NEWS 2015-05-27 01:37:39 UTC (rev 2039) +++ pkg/gtools/inst/NEWS 2015-05-27 02:17:45 UTC (rev 2040) @@ -1,8 +1,34 @@ -gtools 3.4.3 - 2015-04-06 +gtools 3.5.0 - 2015-04-28 ------------------------- -Enhancements: +New Functions: +- New roman2int() functon to convert roman numerals to integers + without the range restriction of utils::as.roman(). + +- New asc() and chr() functions to convert between ASCII codes and + characters. (Based on the 'Data Debrief' blog entry for 2011-03-09 + at http://datadebrief.blogspot.com/2011/03/ascii-code-table-in-r.html). + +- New unByteCode() and unByteCodeAssign() functions to convert a + byte-code functon to an interpeted code function. + +- New assignEdgewise() function for making assignments into locked + environments. (Used by unByteCodeAssign().) + +Enhacements: + +- mixedsort() and mixedorder() now have arguments 'decreasing', + 'na.last', and 'blank.last' arguments to control sort ordering. + +- mixedsort() and mixedirdeR() now support Roman numerals via the + arguments 'numeric.type', and 'roman.case'. (Request by David + Winsemius, suggested code changes by Henrik Bengtsson.) + +- speed up mixedorder() (and hence mixedsort()) by moving + suppressWarnings() outside of lapply loops. (Suggestion by Henrik + Bengtsson.) + - The 'q' argument to quantcut() now accept an integer indicating the number of equally spaced quantile groups to create. (Suggestion and patch submitted by Ryan C. Thompson.) @@ -11,6 +37,9 @@ - Removed stray browser() call in smartbind(). +- ddirichlet(x, alpha) was incorrectly returning NA when for any i, + x[i]=0 and alpha[i]=1. (Bug report by John Nolan.) + Other changes: - Correct typographical errors in package description. From noreply at r-forge.r-project.org Wed May 27 04:19:56 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 04:19:56 +0200 (CEST) Subject: [R-gregmisc-commits] r2041 - pkg/gtools Message-ID: <20150527021956.D1DA818770D@r-forge.r-project.org> Author: warnes Date: 2015-05-27 04:19:55 +0200 (Wed, 27 May 2015) New Revision: 2041 Modified: pkg/gtools/DESCRIPTION Log: Update gtools version number to 3.5.0 Modified: pkg/gtools/DESCRIPTION =================================================================== --- pkg/gtools/DESCRIPTION 2015-05-27 02:17:45 UTC (rev 2040) +++ pkg/gtools/DESCRIPTION 2015-05-27 02:19:55 UTC (rev 2041) @@ -22,7 +22,7 @@ - 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.4.3 +Version: 3.5.0 Date: 2015-05-26 Author: Gregory R. Warnes, Ben Bolker, and Thomas Lumley Maintainer: Gregory R. Warnes From noreply at r-forge.r-project.org Wed May 27 04:23:38 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 04:23:38 +0200 (CEST) Subject: [R-gregmisc-commits] r2042 - pkg/gtools/R Message-ID: <20150527022338.A4AE518698D@r-forge.r-project.org> Author: warnes Date: 2015-05-27 04:23:37 +0200 (Wed, 27 May 2015) New Revision: 2042 Modified: pkg/gtools/R/asc.R Log: Somehow lost 'simplify=TRUE' argument to asc. Fixed. Modified: pkg/gtools/R/asc.R =================================================================== --- pkg/gtools/R/asc.R 2015-05-27 02:19:55 UTC (rev 2041) +++ pkg/gtools/R/asc.R 2015-05-27 02:23:37 UTC (rev 2042) @@ -1,2 +1,4 @@ -asc <- function(char) sapply(char, function(x) strtoi(charToRaw(x),16L) ) +asc <- function(char, simplify=TRUE) + sapply(char, function(x) strtoi(charToRaw(x),16L), simplify=simplify ) + chr <- function(n) sapply(n, function(x) rawToChar(as.raw(x)) ) From noreply at r-forge.r-project.org Wed May 27 04:26:01 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 04:26:01 +0200 (CEST) Subject: [R-gregmisc-commits] r2043 - pkg/gtools/R Message-ID: <20150527022601.5A18C18698D@r-forge.r-project.org> Author: warnes Date: 2015-05-27 04:26:00 +0200 (Wed, 27 May 2015) New Revision: 2043 Modified: pkg/gtools/R/asc.R Log: Looks like we also lost the change of argument name to chr(). Fixed. Modified: pkg/gtools/R/asc.R =================================================================== --- pkg/gtools/R/asc.R 2015-05-27 02:23:37 UTC (rev 2042) +++ pkg/gtools/R/asc.R 2015-05-27 02:26:00 UTC (rev 2043) @@ -1,4 +1,4 @@ asc <- function(char, simplify=TRUE) sapply(char, function(x) strtoi(charToRaw(x),16L), simplify=simplify ) -chr <- function(n) sapply(n, function(x) rawToChar(as.raw(x)) ) +chr <- function(ascii) sapply(ascii, function(x) rawToChar(as.raw(x)) ) From noreply at r-forge.r-project.org Wed May 27 04:26:38 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 04:26:38 +0200 (CEST) Subject: [R-gregmisc-commits] r2044 - pkg/gtools Message-ID: <20150527022638.B1E6818698D@r-forge.r-project.org> Author: warnes Date: 2015-05-27 04:26:37 +0200 (Wed, 27 May 2015) New Revision: 2044 Modified: pkg/gtools/NAMESPACE Log: Add roman2int() to exported function list. Modified: pkg/gtools/NAMESPACE =================================================================== --- pkg/gtools/NAMESPACE 2015-05-27 02:26:00 UTC (rev 2043) +++ pkg/gtools/NAMESPACE 2015-05-27 02:26:37 UTC (rev 2044) @@ -33,6 +33,7 @@ permute, quantcut, rdirichlet, + roman2int, running, scat, setTCPNoDelay, From noreply at r-forge.r-project.org Wed May 27 04:29:07 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 04:29:07 +0200 (CEST) Subject: [R-gregmisc-commits] r2045 - pkg/gtools/man Message-ID: <20150527022907.F24F318770D@r-forge.r-project.org> Author: warnes Date: 2015-05-27 04:29:07 +0200 (Wed, 27 May 2015) New Revision: 2045 Modified: pkg/gtools/man/mixedsort.Rd Log: Remove extraneous closing paren. Modified: pkg/gtools/man/mixedsort.Rd =================================================================== --- pkg/gtools/man/mixedsort.Rd 2015-05-27 02:26:37 UTC (rev 2044) +++ pkg/gtools/man/mixedsort.Rd 2015-05-27 02:29:07 UTC (rev 2045) @@ -14,7 +14,6 @@ mixedsort(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE, numeric.type=c("decimal", "roman"), roman.case=c("upper","lower","both") ) -) mixedorder(x, decreasing=FALSE, na.last=TRUE, blank.last=FALSE, numeric.type=c("decimal", "roman"), roman.case=c("upper","lower","both") ) From noreply at r-forge.r-project.org Wed May 27 04:48:56 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 04:48:56 +0200 (CEST) Subject: [R-gregmisc-commits] r2046 - pkg/gtools/man Message-ID: <20150527024856.C6B72186DC6@r-forge.r-project.org> Author: warnes Date: 2015-05-27 04:48:54 +0200 (Wed, 27 May 2015) New Revision: 2046 Added: pkg/gtools/man/roman2int.Rd Log: Add man page for roman2int(). Added: pkg/gtools/man/roman2int.Rd =================================================================== --- pkg/gtools/man/roman2int.Rd (rev 0) +++ pkg/gtools/man/roman2int.Rd 2015-05-27 02:48:54 UTC (rev 2046) @@ -0,0 +1,47 @@ +\name{roman2int} +\alias{roman2int} +\title{Convert Roman Numerals to Integers} +\description{ + Convert roman numerals to integers +} +\usage{ +roman2int(roman) +} +\arguments{ + \item{roman}{character vector containing roman numerals} +} +\details{ + This functon will convert roman numerals to integers without the upper bound + imposed by R (3899), ignoring case. +} +\value{ + A integer vector with the same length as \code{roman}. Character + strings which are not valid roman numerals will be converted to \code{NA}. +} +\author{ + Gregory R. Warnes \email{greg at warnes.net} +} +\seealso{ + \code{\link[utils]{as.roman}} +} +\examples{ +roman2int( c('I', 'V', 'X', 'C', 'L', 'D', 'M' ) ) + +# works regardless of case +roman2int( 'MMXVI' ) +roman2int( 'mmxvi' ) + +# works beyond R's limit of 3899 +val.3899 <- 'MMMDCCCXCIX' +val.3900 <- 'MMMCM' +val.4000 <- 'MMMM' +as.numeric(as.roman( val.3899 )) +as.numeric(as.roman( val.3900 )) +as.numeric(as.roman( val.4000 )) + +roman2int(val.3899) +roman2int(val.3900) +roman2int(val.4000) + +} +\keyword{arith} From noreply at r-forge.r-project.org Wed May 27 18:36:14 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 18:36:14 +0200 (CEST) Subject: [R-gregmisc-commits] r2047 - pkg/gtools/R Message-ID: <20150527163614.15F04187158@r-forge.r-project.org> Author: warnes Date: 2015-05-27 18:36:13 +0200 (Wed, 27 May 2015) New Revision: 2047 Added: pkg/gtools/R/trimws.R Removed: pkg/gtools/R/trim.R Modified: pkg/gtools/R/keywords.R pkg/gtools/R/roman2int.R Log: 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(). Modified: pkg/gtools/R/keywords.R =================================================================== --- pkg/gtools/R/keywords.R 2015-05-27 02:48:54 UTC (rev 2046) +++ pkg/gtools/R/keywords.R 2015-05-27 16:36:13 UTC (rev 2047) @@ -8,20 +8,11 @@ } else { - - ## Local copy of trim.character to avoid cyclic dependency with gdata ## - trim <- function(s) - { - s <- sub(pattern="^[[:blank:]]+", replacement="", x=s) - s <- sub(pattern="[[:blank:]]+$", replacement="", x=s) - s - } - kw <- scan(file=file, what=character(), sep="\n", quiet=TRUE) kw <- grep("&", kw, value=TRUE) kw <- gsub("&[^&]*$","", kw) kw <- gsub("&+"," ", kw) - kw <- na.omit(trim(kw)) + kw <- na.omit(trimws(kw)) ischar <- tryCatch(is.character(topic) && length(topic) == 1L, error = identity) Modified: pkg/gtools/R/roman2int.R =================================================================== --- pkg/gtools/R/roman2int.R 2015-05-27 02:48:54 UTC (rev 2046) +++ pkg/gtools/R/roman2int.R 2015-05-27 16:36:13 UTC (rev 2047) @@ -30,7 +30,7 @@ roman2int <- function(roman) { - roman <- trim(toupper(as.character(roman))) + roman <- trimws(toupper(as.character(roman))) tryIt <- function(x) { Deleted: pkg/gtools/R/trim.R =================================================================== --- pkg/gtools/R/trim.R 2015-05-27 02:48:54 UTC (rev 2046) +++ pkg/gtools/R/trim.R 2015-05-27 16:36:13 UTC (rev 2047) @@ -1 +0,0 @@ -link ../../gdata/R/trim.R \ No newline at end of file Added: pkg/gtools/R/trimws.R =================================================================== --- pkg/gtools/R/trimws.R (rev 0) +++ pkg/gtools/R/trimws.R 2015-05-27 16:36:13 UTC (rev 2047) @@ -0,0 +1,11 @@ +## trimws was added in R 2.3.0. If we're using a previous version of +## R we need to define it. +if(!exists('trimws', mode='function') + trimws <- function(s) + { + s <- sub(pattern="^[[:blank:]]+", replacement="", x=s) + s <- sub(pattern="[[:blank:]]+$", replacement="", x=s) + s + } + + From noreply at r-forge.r-project.org Wed May 27 18:38:37 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 18:38:37 +0200 (CEST) Subject: [R-gregmisc-commits] r2048 - pkg/gtools/R Message-ID: <20150527163837.DE74D1872B4@r-forge.r-project.org> Author: warnes Date: 2015-05-27 18:38:37 +0200 (Wed, 27 May 2015) New Revision: 2048 Modified: pkg/gtools/R/trimws.R Log: Fix missing closing paren. Modified: pkg/gtools/R/trimws.R =================================================================== --- pkg/gtools/R/trimws.R 2015-05-27 16:36:13 UTC (rev 2047) +++ pkg/gtools/R/trimws.R 2015-05-27 16:38:37 UTC (rev 2048) @@ -1,6 +1,6 @@ ## trimws was added in R 2.3.0. If we're using a previous version of ## R we need to define it. -if(!exists('trimws', mode='function') +if(!exists('trimws', mode='function')) trimws <- function(s) { s <- sub(pattern="^[[:blank:]]+", replacement="", x=s) From noreply at r-forge.r-project.org Wed May 27 19:01:19 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 27 May 2015 19:01:19 +0200 (CEST) Subject: [R-gregmisc-commits] r2049 - in pkg/gtools: data man Message-ID: <20150527170119.783E7186CF4@r-forge.r-project.org> Author: warnes Date: 2015-05-27 19:01:18 +0200 (Wed, 27 May 2015) New Revision: 2049 Added: pkg/gtools/data/badDend.rda pkg/gtools/man/badDend.Rd Modified: pkg/gtools/man/unByteCode.Rd Log: Create local dataset to use in the example code for unByteCode instead of relying on web access. Added: pkg/gtools/data/badDend.rda =================================================================== (Binary files differ) Property changes on: pkg/gtools/data/badDend.rda ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: pkg/gtools/man/badDend.Rd =================================================================== --- pkg/gtools/man/badDend.Rd (rev 0) +++ pkg/gtools/man/badDend.Rd 2015-05-27 17:01:18 UTC (rev 2049) @@ -0,0 +1,24 @@ +\name{badDend} +\alias{badDend} +\docType{data} +\title{Dataset That Crashes Base:::Plot.Dendogram with 'Node Stack Overflow'} +\description{ + Base:::Plot.Dendogram() will generate a 'Node Stack Overflow' when run + on a dendrogram appropriately constructed from this data set. +} +\usage{data("badDend")} +\format{ + The format is: + num [1:2047, 1:12] 1 2 3 4 5 6 7 8 9 10 ... + - attr(*, "dimnames")=List of 2 + ..$ : NULL + ..$ : chr [1:12] "X" "V1" "V2" "V3" ... +} +\note{ + See help page for \code{\link{unByteCode}} to see how to construct the + 'bad' dentrogram from this data and how to work around the issue. + } +\examples{ +data(badDend) +} +\keyword{datasets} Modified: pkg/gtools/man/unByteCode.Rd =================================================================== --- pkg/gtools/man/unByteCode.Rd 2015-05-27 16:38:37 UTC (rev 2048) +++ pkg/gtools/man/unByteCode.Rd 2015-05-27 17:01:18 UTC (rev 2049) @@ -54,18 +54,17 @@ \code{\link{assign}} } \examples{ -datURL <- "https://bugs.r-project.org/bugzilla/attachment.cgi?id=1659" -dat <- as.matrix(read.csv(file=datURL, row.names=1)) +data(badDend) dist2 <- function(x) as.dist(1-cor(t(x), method="pearson")) hclust1 <- function(x) hclust(x, method = "single") -distance <- dist2(dat) +distance <- dist2(badDend) cluster <- hclust1(distance) dend <- as.dendrogram(cluster) \dontrun{ - ## In R 2.3.0 and earlier crashes R: with a node stack overflow error + ## In R 2.3.0 and earlier crashes with a node stack overflow error plot(dend) ## Error in xy.coords(x, y, recycle = TRUE) : node stack overflow } From noreply at r-forge.r-project.org Fri May 29 04:27:56 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 29 May 2015 04:27:56 +0200 (CEST) Subject: [R-gregmisc-commits] r2050 - pkg/fork Message-ID: <20150529022756.A83AD18788C@r-forge.r-project.org> Author: warnes Date: 2015-05-29 04:27:55 +0200 (Fri, 29 May 2015) New Revision: 2050 Modified: pkg/fork/DESCRIPTION Log: Increment version number Modified: pkg/fork/DESCRIPTION =================================================================== --- pkg/fork/DESCRIPTION 2015-05-27 17:01:18 UTC (rev 2049) +++ pkg/fork/DESCRIPTION 2015-05-29 02:27:55 UTC (rev 2050) @@ -1,8 +1,8 @@ Package: fork Title: R functions for handling multiple processes. -Version: 1.2.4 -Date: 2011-08-26 -Author: Gregory R. Warnes . Financial +Version: 1.2.6 +Date: 2014-09-18 +Author: Gregory R. Warnes . Financial support for some aspects of this package provided by Metrum Research Group, LLC . Description: These functions provides simple wrappers around the Unix process From noreply at r-forge.r-project.org Fri May 29 04:57:51 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 29 May 2015 04:57:51 +0200 (CEST) Subject: [R-gregmisc-commits] r2051 - pkg/fork Message-ID: <20150529025751.6AF1D187876@r-forge.r-project.org> Author: warnes Date: 2015-05-29 04:57:50 +0200 (Fri, 29 May 2015) New Revision: 2051 Modified: pkg/fork/DESCRIPTION Log: Bump version number Modified: pkg/fork/DESCRIPTION =================================================================== --- pkg/fork/DESCRIPTION 2015-05-29 02:27:55 UTC (rev 2050) +++ pkg/fork/DESCRIPTION 2015-05-29 02:57:50 UTC (rev 2051) @@ -1,11 +1,11 @@ Package: fork -Title: R functions for handling multiple processes. -Version: 1.2.6 -Date: 2014-09-18 -Author: Gregory R. Warnes . Financial - support for some aspects of this package provided by Metrum Research Group, +Title: R Functions for Handling Multiple Processes +Version: 1.2.5 +Date: 2014-05-28 +Author: Gregory R. Warnes . Financial + support for some aspects of this package provided by Metrum Research Group, LLC . -Description: These functions provides simple wrappers around the Unix process +Description: These functions provides simple wrappers around the Unix process management API calls: fork, signal, wait, waitpid, kill, and _exit. This enables construction of programs that utilize and mange multiple concurrent processes.