gtools/0000755000176200001440000000000014526673315011575 5ustar liggesusersgtools/NAMESPACE0000644000176200001440000000243214261670123013003 0ustar liggesusers# Generated by roxygen2: do not edit by hand export(ASCIIfy) export(asc) export(ask) export(assert) export(assignEdgewise) export(baseOf) export(binsearch) export(capture) export(capwords) export(checkRVersion) export(chr) export(combinations) export(ddirichlet) export(defmacro) export(even) export(foldchange) export(foldchange2logratio) export(getDependencies) export(inv.logit) export(invalid) export(keywords) export(lastAdd) export(loadedPackages) export(logit) export(logratio2foldchange) export(mixedorder) export(mixedsort) export(na.replace) export(odd) export(permutations) export(permute) export(quantcut) export(rdirichlet) export(roman2int) export(running) export(scat) export(script_file) export(script_path) export(setTCPNoDelay) export(smartbind) export(split_path) export(sprint) export(stars.pval) export(stat_mode) export(strmacro) export(unByteCode) export(unByteCodeAssign) importFrom(methods,is) importFrom(methods,new) importFrom(stats,na.omit) importFrom(stats,quantile) importFrom(stats,rgamma) importFrom(stats,symnum) importFrom(utils,available.packages) importFrom(utils,flush.console) importFrom(utils,head) importFrom(utils,help.search) importFrom(utils,installed.packages) importFrom(utils,modifyList) importFrom(utils,packageVersion) useDynLib(gtools, .registration=TRUE) gtools/ChangeLog0000644000176200001440000007261214261670123013345 0ustar liggesusers2018-06-19 16:48 warnes * DESCRIPTION, NAMESPACE: Update DESCRIPTION and NAMESPACE for gtools 3.8.0. 2018-06-19 16:43 warnes * R/split_path.R, man/split_path.Rd: Add spit_path() function. 2018-06-19 16:43 warnes * R/baseOf.R, man/baseOf.Rd: Improvements to baseOf() function. 2017-08-23 23:03 warnes * R/baseOf.R, man/baseOf.Rd: Add `baseOf` function and documentation to support updated `gplots::venn` function. (Provided by Steffen Möller.) 2017-08-23 22:59 warnes * R/roman2int.R, R/setTCPNoDelay.R: Use correct 'PACKAGE=' parameter to '.C' calls. 2017-06-14 19:44 warnes * inst/ChangeLog, inst/NEWS: Update NEWS and ChangeLog 2017-06-14 19:42 warnes * DESCRIPTION, NAMESPACE, R/checkRVersion.R, R/newVersionAvailable.R, R/roman2int.R, R/setTCPNoDelay.R, man/combinations.Rd, man/defmacro.Rd, src/gtools.h, src/gtools_load.c, src/setTCPNoDelay.c, tests/test_setTCPNoDelay.R: Explicitly register C routines used by gtools 2017-06-13 00:16 warnes * man/combinations.Rd, man/defmacro.Rd: Update R News URLS 2017-06-12 23:30 warnes * man/capwords.Rd: Update link for taxise::taxize_capwords in gtools::capwords man page 2017-06-12 23:28 warnes * inst/ChangeLog: Fix typos 2017-06-12 23:28 warnes * man/capwords.Rd: Update link for taxise::taxize_capwords in gtools::capwords man page 2017-06-12 23:21 warnes * DESCRIPTION, NAMESPACE, inst/ChangeLog, inst/NEWS: Update meta files for gtools 3.7.0 2017-06-12 22:53 warnes * tests/smartbind_emptynames.R: Fix test for smartbind with empty column names 2017-06-12 22:52 warnes * man/setTCPNoDelay.Rd, tests/test_setTCPNoDelay.R: Add improved example to man page for setTCPnoDelat() and fix test function. 2017-06-12 22:51 warnes * man/ask.Rd: Add 'con' argument to ask() to allow specification of the connection to query for input. 2017-06-12 22:49 warnes * R/capwords.R, man/capwords.Rd: Add capwords() function to apply standard capitalization rules to a scharacter string. 2017-05-23 15:55 warnes * R/ask.R, R/quantcut.R, R/smartbind.R: - Integrate changes made by Mango Solutions at https://github.com/MangoTheCat/SASxport. - Remove functions duplicated from the Hmisc package. - Minor code cleanup. 2016-08-24 19:48 warnes * tests/test_setTCPNoDelay.R: Add more testing code. 2016-08-15 19:17 warnes * inst/ChangeLog: Update ChangeLog 2016-08-15 19:16 warnes * DESCRIPTION: Update version number and date 2016-08-15 19:14 warnes * tests/test_setTCPNoDelay.R: Add test code for setTCPNoDelay 2016-08-15 19:14 warnes * R/setTCPNoDelay.R: Modify setTCPNoDelay to work with current socket objects 2016-08-15 19:13 warnes * src/setTCPNoDelay.c: checkStatus() was not correctly getting the error message. 2016-04-22 16:10 warnes * NAMESPACE, R/capwords.R, man/capwords.Rd: Add capwords() function to properly capatilize strings for use in titles 2016-04-22 16:08 warnes * R/na.replace.R, man/na.replace.Rd: na.replace() now accepts a function providing the replcement value. 2015-11-24 17:58 warnes * R/smartbind.R: Correct error when column types don't match (reported by 2015-10-15 21:15 warnes * R/smartbind.R: smartbind() was not properly handling columsn that were numeric on one df and character in the other and other similar ctype conflicts. Fixed. 2015-08-08 05:01 warnes * tests/smartbind_emptynames.R: Add half-hearted test file 2015-08-08 03:14 warnes * R/smartbind.R: - Improve assignment of default names in smartbind. - Disambiguate 'list' into an object named 'list' and the function base::list() in smartbind(). 2015-08-08 01:47 warnes * DESCRIPTION, man/smartbind.Rd: Add example of using 'list' argument to smartbind() man page. 2015-08-08 01:44 warnes * R/smartbind.R, man/smartbind.Rd: - smartbind() gets a new argument 'list' to pass a list of data frames, instead of/in addition to data frames as arguments. - Fix bug in smartbind's handling of factor levels. 2015-07-14 21:19 warnes * R/loadedPackages.R, man/loadedPackages.Rd: Modify loadedPackages() to return data silently so that the results don't get printed twice. 2015-05-27 17:01 warnes * data/badDend.rda, man/badDend.Rd, man/unByteCode.Rd: Create local dataset to use in the example code for unByteCode instead of relying on web access. 2015-05-27 16:38 warnes * R/trimws.R: Fix missing closing paren. 2015-05-27 16:36 warnes * R/keywords.R, R/roman2int.R, R/trim.R, R/trimws.R: Two functions in gtools need to use either gdata::trim() or base::trimws() (added in R 3.2.0). The previous solution was to include gdata/R/gdata/R/trim.R in gtools using a symbolic link. Unfortunately, Rforge doesn't seem to like the symbolic link when building packages, and generates an error. So, instead, create the file trimws.R, which creates trimws() if it isn't already available (e.g. via base::trimws), and modify keywords() and roman2int() to use trimws() instead of gdata::trim(). 2015-05-27 02:48 warnes * man/roman2int.Rd: Add man page for roman2int(). 2015-05-27 02:29 warnes * man/mixedsort.Rd: Remove extraneous closing paren. 2015-05-27 02:26 warnes * NAMESPACE: Add roman2int() to exported function list. 2015-05-27 02:26 warnes * R/asc.R: Looks like we also lost the change of argument name to chr(). Fixed. 2015-05-27 02:23 warnes * R/asc.R: Somehow lost 'simplify=TRUE' argument to asc. Fixed. 2015-05-27 02:19 warnes * DESCRIPTION: Update gtools version number to 3.5.0 2015-05-27 02:17 warnes * DESCRIPTION, inst/ChangeLog, inst/NEWS: Update DESCRIPTION, ChangeLog, NEWS 2015-05-27 01:37 warnes * R/mixedsort.R, man/mixedsort.Rd: Add roman numeral support to mixedorder() and mixedsort(). 2015-05-27 00:21 warnes * man/asc.Rd: Add asc() and chr() functions for converting between characters and ASCII codes 2015-05-27 00:20 warnes * R/roman2int.R: roman2int() now returns NA for invalid roman numeral strings instead of generating an error. 2015-05-27 00:19 warnes * NAMESPACE: Add asc(), chr(), assignEdgewise(), unByteCode(), and unByteCodeAssign() to package NAMESPACE. 2015-05-27 00:17 warnes * R/asc.R: Add asc() and chr() functions for converting between characters and ASCII codes 2015-05-26 16:22 warnes * inst/ChangeLog: Add changelog to svn repository 2015-05-25 14:30 warnes * tests/test_ddirichlet.R: Add library call. 2015-05-25 14:29 warnes * man/unByteCode.Rd: Fix typo and add documentation for argument 'name'. 2015-05-25 14:29 warnes * man/mixedsort.Rd: Fix typo. 2015-05-25 14:16 warnes * man/mixedsort.Rd: Add description of blanklast argument, fix typo. 2015-05-25 14:13 warnes * man/quantcut.Rd: Change usage to match actual definition. 2015-05-25 14:10 warnes * man/mixedsort.Rd: Note characters sorting ignores case. 2015-05-25 14:08 warnes * man/mixedsort.Rd: Remove '...' from arglist to match source code. 2015-05-25 14:05 warnes * man/mixedsort.Rd: Replace unicode quotes with \code{..}. 2015-05-23 22:21 warnes * 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. 2015-05-23 22:12 warnes * 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 22:49 warnes * R/mixedsort.R: Summary: Speed up mixedorder by moving suppressWarnings outside of lapply loops. (Suggestion by Henrik Bengtsson.) 2015-05-02 17:38 warnes * Rename 'trunk' to 'pkg' for compatibility with R-forge 2015-05-02 13:50 warnes * Minor layout change. 2015-05-02 13:48 warnes * Remove stray 'svn' that was inserted into the code. 2015-05-02 13:47 warnes * Add man page for unByteCode(), assignEdgeWise(), and unByteCodeAssign() 2015-04-28 04:27 warnes * Changes to mixedsort(): - Hands off objects that are not character vectors to the default sort. - Add 'decreasing', 'na.last', and 'blank.last' arguments. 2015-04-28 04:16 warnes * Add private function 'checkReverseDependencies'. 2015-04-23 21:53 warnes * Update NEWS and ChangeLog 2015-04-23 21:47 warnes * - 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.) 2015-04-23 21:10 warnes * Revers accidental text deletion: 2015-04-23 21:09 warnes * Update for gtools 3.4.3 2015-04-23 21:06 warnes * Remove debugging code and stray browser() call 2015-04-14 19:39 warnes * Fix typo 2015-04-09 19:46 warnes * Update gtools ChangeLog 2015-04-09 19:45 warnes * Move first()/last()/left()/right() to gdata. Add new functions na.replace() and loadedPackages(). Add more text to package description. 2015-04-08 19:55 warnes * Move first/last/left/right to from gtools to gdata 2015-04-06 22:09 warnes * Correct URL 2015-04-06 22:04 warnes * Update NEWS and ChangeLog for gtools 3.5.0 2015-04-06 21:52 warnes * Add ChangeLog files to repository 2015-04-06 21:44 warnes * Implement fix to keywords() needed for R-3.4.1, as suggested by Kurt Hornik. 2015-04-06 21:40 warnes * - Export S3 methods for first(), last(), left() and right(). - Ensure code matches man page for first(), last(), left(), and right(). 2014-10-09 18:56 warnes * Update for 3.5.0 release of gtools 2014-10-09 18:52 warnes * Make right() and left() S3 methods for classes data.frame and matrix 2014-08-27 00:44 warnes * Fix man page 2014-08-27 00:36 warnes * Finish adding first(), last(), left(), and right(). 2014-08-27 00:12 warnes * Add functions first(), last(), left(), and right(). 2014-05-28 00:24 warnes * Update for gtools 3.4.1 2014-05-28 00:18 warnes * Add test to ensure smartbind() properly handles Date columns. 2014-05-28 00:14 warnes * smartbind: Convert non-native type columns (except factor) to character. 2014-04-18 18:11 arnima * Main arg is 'x' like showNonASCII(x), preformatted notes instead of verb 2014-04-17 17:33 warnes * Update ASCIIfy man page to match source code and add keywords 2014-04-17 17:25 warnes * Update NEWS for gtools 3.4.0 2014-04-17 16:56 warnes * Add ASCIIfy function posted to RDevel by Arni Magnusson 2014-03-01 20:15 warnes * Fix cut-and-paste error. 2014-03-01 20:12 warnes * Update files for gtools 3.3.1 release 2014-03-01 20:02 warnes * Fix bug in gtools::mixedorder regular expression for regognizing numbers. (Periods weren't escaped). 2014-02-11 17:44 warnes * Create and use locate copy of tools:::.split_op_version. 2014-02-11 17:25 warnes * Update for gtools 3.3.0. 2014-02-11 17:19 warnes * Fix arguments 2014-02-11 17:17 warnes * Update arguments to match code. 2014-02-11 17:14 warnes * Add getDependencies() function to return a list of package dependencies. 2014-01-14 19:43 warnes * Update for bug-fix release 2014-01-14 19:37 warnes * Add test file for binsearch() function. 2014-01-14 15:56 warnes * Fixed bug where binsearch() returned the wrong endpoint & value when the found value was at the upper endpoint. 2014-01-13 18:16 warnes * Fix typo 2014-01-11 23:39 warnes * Update for gtools release 3.2.0 2014-01-11 23:38 warnes * fixes for R CMD check 2014-01-11 23:24 warnes * Fixes for gtools release 3.2.0 2013-12-23 18:48 warnes * Extend the keywords() function to return keywords associated with a specified topic via 'keywords(topic)'. 2013-12-23 16:08 warnes * Add keyword. 2013-12-23 16:04 warnes * Add stars.pval() function to convert p-values into significance symbols. 2013-11-26 14:38 warnes * 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 16:06 warnes * Use ".Deprecated" instead of warning. 2013-11-06 14:53 warnes * Update files for gtools 3.1.1 2013-11-06 14:51 warnes * Fix problem with mixedorder/mixedsort when there is only zero or one elements in the vector. 2013-09-23 15:46 warnes * Comment out empty sections in gtools-deprecated.Rd 2013-09-23 15:41 warnes * Update files for gtools 3.1.0 release 2013-09-23 15:37 warnes * Make 'addLast()' defunct. 2013-09-23 15:29 warnes * Mark 'addLast()' as defunct and move 'lastAdd()' function to a separate file. 2013-09-23 15:23 warnes * Update for gtools 3.0.1 release 2013-09-23 15:19 warnes * Use 'suppressWarnings() instead of 'options(warn=-1)' in 'mixedorder()'. 2013-07-07 00:11 warnes * Fix typo. 2013-07-06 23:55 warnes * Fix Rd warning. 2013-07-06 23:49 warnes * Include lastAdd in NAMESPACE 2013-07-06 23:46 warnes * Change assert from deprecated to defunct. 2013-07-06 23:45 warnes * Improve deprecation message 2013-07-06 23:43 warnes * Update for gtools 3.0.0 2013-07-06 23:26 warnes * Create new function lastAdd to replace addLast and mark addLast as deprecated. 2013-07-05 23:48 warnes * Point out that addLast() modifies the value of .Last in the global environment. 2013-07-05 23:47 warnes * Point out that addLast() modifies the value of .Last in the global environment. 2013-07-05 23:34 warnes * Update for gtools 2.7.2 mark 2 2013-07-05 23:33 warnes * Remove cross-reference to (obsolete?) moc package 2013-07-05 17:31 warnes * Update for gtools 2.7.2 2013-07-05 17:29 warnes * Update for R version 3.0.0 and later 2013-03-17 02:21 warnes * 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 19:00 warnes * Update for gtools 2.7.0. 2012-06-19 14:00 warnes * Document new 'verbose' argument to smartbind(). 2012-06-19 13:56 warnes * Clean up R CMD check warnings. 2012-05-04 16:06 warnes * smartbind(): Improve handling of factors and ordered factors. 2011-10-05 17:05 warnes * Update version number for release 2011-10-05 16:53 warnes * Add 'sep' argument to smartbind() to allow specification of character used to separate components of constructed names 2011-09-28 22:56 warnes * smartbind(): Prevent coersion to data frame from mangling column names. 2011-09-28 22:53 warnes * Add 'fill' argument to smartbind() to specify a value to use for missing entries. 2011-09-28 22:53 warnes * Add 'fill' argument to smartbind() to specify a value to use for missing entries. 2010-08-14 19:28 warnes * 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 22:14 warnes * Update version number for new release 2010-05-01 22:03 warnes * Change Greg's email address to greg@warnes.net 2010-05-01 21:59 warnes * Fix error in checkRVersion() 2010-04-28 17:23 ggrothendieck2 * fixed problems with R CMD CHECK 2009-05-09 03:35 warnes * Escape $ in .Rd file to avoid latex issues 2009-05-09 03:26 warnes * Update NEWS and create softlinks for NEWS and ChangeLog in top level directory 2009-05-09 03:15 warnes * Move actual NEWS file into inst. 2009-05-09 03:13 warnes * Update Greg's email address and fix Rd syntax errors 2009-02-16 15:34 warnes * Correct windows make flags as suggested by Brian Ripley. 2008-08-15 13:15 warnes * Add keywords() function to show /doc/KEYWORDS file 2008-05-29 23:19 warnes * Add newVersionAvailable() function to compare running and latest available R versions 2008-05-26 19:15 warnes * Update license specification 2008-05-26 15:04 warnes * Remove 'assert' man page 2008-05-22 16:40 warnes * Finish rename of assert.R to assert-depricated.Rd 2008-05-22 16:35 warnes * Add checkRVersion.R file 2008-05-22 16:34 warnes * Rename again to get correct extension! 2008-05-22 16:30 warnes * Update NEWS for 2.5.0 2008-05-22 16:17 warnes * Add man page for checkRVersion 2008-05-22 16:16 warnes * Rename assert-deprecated.R to assert.R to meet R file name requirements. 2008-05-22 16:15 warnes * Add checkRVersion to NAMESPACE, and increment version in DESCRIPTION. 2008-05-22 16:14 warnes * Remove broken SEE LSO reference 2008-04-12 19:42 warnes * Improve text explanation of how defmacro() and strmacro() differ from function(). 2008-04-12 19:19 warnes * assert() is now deprecated in favor of base::stopifnot() 2008-04-12 19:19 warnes * Rename 'assert.R' to 'deprecated.R'. 2008-04-12 19:14 warnes * Assert is now deprecated in favor of base::stopifnot(), so add call to .Deprecated() to inform the user. 2007-11-30 18:05 warnes * Update defnitions of odd() and even() to use modulus operator instead of division. Prettier, I think, :-D 2007-08-08 13:52 warnes * Fix bug identified by R-2.6's check routings in binsearch() 2007-08-08 13:48 warnes * Add the binsearch(), previously in the genetics package. 2007-07-18 11:48 ggorjan * typo fixed 2007-04-12 21:16 warnes * Add ask() function to prompt the user and collect a single response. 2007-04-07 13:41 warnes * Fix improper escapes in regexp detected by R 2.5.0 package check. 2007-03-23 22:53 warnes * Allow permutations for r>n provided repeats.allowed=TRUE 2006-11-28 00:53 warnes * Replace F with FALSE in smartbind example. 2006-11-27 22:42 warnes * Replace T with TRUE in smartbind example 2006-11-27 21:40 warnes * Temprary remove to reset binary flag 2006-11-27 21:40 warnes * Temprary remove to reset binary flag 2006-11-27 21:34 warnes * Add smartbind() to list of exported functions, and add corresponding documentation file. 2006-11-27 20:52 warnes * Update my email address 2006-11-14 22:25 ggorjan * Removed executable property 2006-08-02 22:21 warnes * Update my email address 2006-05-05 18:13 nj7w * Fixed minor typo - in {value} - n was replaced by r 2006-05-05 16:55 nj7w * Fixed minor typos 2006-03-01 19:12 warnes * Add smartbind function 2006-01-18 16:28 warnes * Add concept tags to make mixedsort easier to locate. 2005-12-21 15:23 warnes * Update version number and date 2005-12-21 06:11 warnes * Note changes for 2.2.3 2005-12-21 06:08 warnes * Should now work on Windows 2005-12-20 20:25 warnes * Temporary fix to allow setTCPNoDelay.c to compile on Windows. If compiled on windows calling setTCPNoDelay will just raise an error. 2005-12-14 15:48 warnes * Change C++ comment to standard comment 2005-12-13 16:19 nj7w * *** empty log message *** 2005-12-13 16:18 nj7w * Updated NEWS and removed ChangeLog 2005-12-12 22:10 nj7w * Updated version for CRAN release 2005-12-08 20:21 warnes * Add C source code for setTCPNoDelay. 2005-12-01 16:54 nj7w * Updated Greg's email address 2005-11-29 22:30 warnes * Add UseDynLib to NAMESPACE so the shared library gets properly loaded. 2005-11-29 22:25 warnes * - Remove debugging comments - Change return value on success to "Success". 2005-11-22 22:54 warnes * NAMESPACE 2005-11-22 22:54 warnes * Update news for 2.2.1 release. 2005-11-22 22:51 warnes * Fixes for R CMD check 2005-11-22 22:31 warnes * Add setTCPNoDelay() function and documentation 2005-11-22 15:46 warnes * New function 'addLast' that adds functions to R's .Last() so that they will be executed when R is terminating. 2005-09-22 18:12 warnes * More changes for strmacro(), also changes for 2.1.1 release 2005-09-22 17:26 warnes * Add strmaco() which defines functions that use strings for macro definition 2005-09-21 18:51 warnes * Add support for DOTS/... arguments to defmacro 2005-09-12 15:44 nj7w * Updated Greg's email 2005-09-02 22:53 nj7w * Exported assert 2005-09-02 22:53 nj7w * Updated the version number 2005-09-02 22:52 nj7w * Added NEWS 2005-09-02 22:52 nj7w * Added ChangeLog 2005-09-02 22:51 nj7w * Fixed syntax errors 2005-09-02 16:43 warnes * Add assert() and documentation 2005-09-02 16:28 warnes * Fix problem in defmacro.Rd file: don't use \code{} in the example section. 2005-08-31 20:00 warnes * 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/} 2005-08-31 16:18 warnes * Add stand-alone DESCRIPTION file and remove old DESCRIPTION.in file. 2005-06-13 17:08 nj7w * Fixed a bug in mixedsort - check if "which.na" and "which.blank" is numeric(0) before subsetting the datasets. 2005-06-09 14:20 nj7w * Updating the version number, and various help files to synchronize splitting of gregmisc bundle in 4 individual components. 2005-05-10 22:05 warnes * 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 00:28 warnes * - 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 04:19 warnes * Move drop.levels() from gtools to gdata. 2005-04-02 04:17 warnes * Minor reordering of functions in file 2005-04-02 04:14 warnes * Move frameApply() to gdata package. 2005-04-02 03:28 warnes * Fix error if only one value passed to mixedorder. 2005-04-02 02:37 warnes * Add proper handling where more than one quantile obtains the same value 2005-04-01 23:00 warnes * Add CVS ID tag to file headers. 2005-04-01 23:00 warnes * Fixes from Jim Rogers for R CMD check problems in frameApply 2005-03-31 19:03 warnes * Updates to drop.levels() and frameApply() from Jim Rogers 2005-03-31 19:01 warnes * Add ELISA data set used by frameApply and drop.levels examples 2005-02-25 23:02 warnes * Replace 'T' with TRUE. 2005-02-25 22:54 warnes * Remove dependency on ELISA data set for the example. 2005-02-25 21:00 warnes * Add drop.levels, frameApply to namespace export. 2005-02-15 00:41 warnes * Add frameApply and drop.levels contributed by Jim Rogers. 2005-01-12 20:50 warnes * 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 21:01 warneg * Updated to pass R CMD check. 2004-09-03 17:27 warneg * initial bundle checkin 2004-09-02 17:14 warneg * Initial revision 2004-08-27 21:57 warnes * Fixed bug in mixedsort, and modified reorder.factor to use mixedsort. 2004-08-26 20:08 warnes * - 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 15:49 warnes * Nitin Jain added by= parameter to allow specifying separation between groups. 2004-05-26 13:40 warnes * Escape underscores in email addresses so Latex is happy. 2004-05-26 13:18 warnes * Replace 'T' with 'TRUE' to pass R CMD check. 2004-05-25 17:11 warnes * Remove extraneous comments. 2004-05-25 17:08 warnes * 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 17:36 warnes * Check if argument is a vector before doing is.na to avoid generating a warning. 2004-05-24 17:17 warnes * Add invalid() function for testing if a parameter value is non-missing, non-NA, non-NULL. 2004-04-27 14:33 warnes * Replaced argument `as.list' with `simplify'. Updated documentation, and updated examples appropriately. 2004-04-26 16:37 warnes * Added as.list argument to return one list element per evaluation. 2004-03-26 22:21 warnes * Uncomment and fix large 'n' example. 2004-03-26 22:19 warnes * - Update to match changes in running() - Add examples to illustrate new arguments. - Modify running correlation plot example to be more clear. 2004-03-26 22:12 warnes * More of the same. 2004-03-26 15:34 warnes * 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 04:31 warnes * - 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 02:46 warnes * - match function argument defaults with 'usage' 2003-11-21 23:00 warnes * Removed 'deqn' call that was confusing things. 2003-11-21 20:54 warnes * Add email address to author field 2003-11-21 20:35 warnes * - new files 2003-11-21 19:54 warnes * - Change 'T' to 'TRUE' in mixedsort.R - Add missing brace in mixedsort.Rd 2003-11-20 15:56 warnes * - Move 'odd' and 'even' functions to a separate file & provide documentation 2003-11-18 22:47 warnes * - Renamed smartsort to mixedsort and added documentation. 2003-11-10 22:11 warnes * - Add files contributed by Arni Magnusson . As well as some of my own. 2003-05-23 18:14 warnes * - 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 16:00 warnes * - Fixed tpyo in example that allowed combinations(500,2) to run when it should have been ignred for testing.. 2003-04-10 16:22 warnes * - 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 19:37 warnes * - 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 00:51 warneg * Checkin for version 0.5.3 2002-03-26 14:49 warneg * Initial Checkin 2002-03-26 14:29 warneg * Initial checkin. 2002-03-20 03:44 warneg * - Added definition of is.R function. - Added boxplot.formula 2002-03-07 23:39 warneg * - Added documentation and example for running2 2002-03-07 23:38 warneg * - Added "running2", which handles both univariate and bivariate cases - Modified "running" to call "running2" 2002-02-05 02:20 warneg * - Fix typo that caused code meant to run only under S-Plus to run under R, causing problems. 2001-12-19 22:45 warneg * - Added code for %in%. 2001-09-18 14:15 warneg * Release 0.3.2 2001-09-01 19:19 warneg * Initial checkin. 2001-09-01 00:01 warneg * Release 0.3.0 2001-08-25 05:53 warneg * Initial CVS checkin. 2001-08-25 05:50 warneg * Fixed a typo and a syntax error. 2001-08-25 03:59 warneg * Initial Checkin 2001-06-29 13:24 warneg * Initial revision. gtools/README.md0000644000176200001440000000501114261670123013037 0ustar liggesusers # gtools R package [![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![R-CMD-check](https://github.com/r-gregmisc/gtools/workflows/R-CMD-check/badge.svg)](https://github.com/r-gregmisc/gtools/actions) [![](https://www.r-pkg.org/badges/version/gtools)](https://www.r-pkg.org/pkg/gtools) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/gtools)](https://www.r-pkg.org/pkg/gtools) The `gtools` R package provides functions to assist in R programming, including: - assist in developing, updating, and maintaining R and R packages (`ask`, `checkRVersion`, `getDependencies`, `keywords`, `scat`), - calculate the logit and inverse logit transformations (`logit`, `inv.logit`), - test if a value is missing, empty or contains only NA and NULL values (`invalid`), - manipulate R’s .Last function (`addLast`), - define macros (`defmacro`), - detect odd and even integers (`odd`, `even`), - convert strings containing non-ASCII characters (like single quotes) to plain ASCII (`ASCIIfy`), - perform a binary search (`binsearch`), - sort strings containing both numeric and character components (`mixedsort`), - create a factor variable from the quantiles of a continuous variable (`quantcut`), - enumerate permutations and combinations (`combinations`, `permutation`), - calculate and convert between fold-change and log-ratio (`foldchange`, `logratio2foldchange`, `foldchange2logratio`), - calculate probabilities and generate random numbers from Dirichlet distributions (`rdirichlet`, `ddirichlet`), - 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`), - convert characters to/from ASCII codes (`asc`, `chr`), - convert character vector to ASCII representation (`ASCIIfy`). - apply title capitalization rules to a character vector (`capwords`) ## Installation You can install the released version of gtools from [CRAN](https://CRAN.R-project.org) with: ``` r install.packages("gtools") ``` And the development version from [GitHub](https://github.com/) with: ``` r # install.packages("devtools") devtools::install_github("r-gregmisc/gtools") ``` gtools/data/0000755000176200001440000000000014261670123012474 5ustar liggesusersgtools/data/badDend.rda0000644000176200001440000036337214261670123014523 0ustar liggesusersdu\T_>l*3sbRQĎei t)6""؂b!b~7}?<Y:ޫӗ軴o.]u޵[n݅٣vѥ {ۯZ3atYmrk J9(TCRAɡEPF(H&(Gr ʱ(ǡrʉ(' ?9?OST< ?Ot<?3L< ?ϳl<?s\<?Ϧ?g3l~ϖPWVx [x}>^x}^_x}!^_Ex}^_x}1^_%x} ^_חx})^_חex}^_חukn׭5^6xx}9^_חx}^_Wu[nm-^_Wx}%^vb=;;}"d]U~_WU~_Wz{\oq=ո~5_Wո~5_W5~ _5~ _z\pw;zG\q#w;~-_~-_u~_u~_~=_~=_ ~߀7 ~߀7~#߈7~#߈7M~߄7M~߄7z'\pwN ;͸~3ߌ7͸~3ߌ7zg\q3wθ;z\%%J].I(QK)JRm?]Q+wE~W]Q+wE~WPwCn ~7PwCn ~7Q;wG~wQ;wG~w=P@{~=P@{~=Q'D{~O=Q'D{~OPB^ {~/PB^ {~/Q7Fި{~oQ7Fި{~o}PA>~}PA>~}Q/E~_}Q/E~_ԿoA[PԿoA[PԿoA[PԿoA[PԿoE[QVԿoE[QVԿoE[QVԿoE[QVPC~~?PC~~?Q?G~Q?G~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#gyțF47iM#oy{G5*ʨ TPZjiZjiZjij5AFP#j 5CPc1j 5@M&P j5@M@-ZjP @-ZjeZjeZjeZjYeZjYeZj9堖Zj9堖Zj9塖Zjy塖ZjyXB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %XB` %0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % 0X` % X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%X"`%`I`I!K+6ۋVҔ).$pgtools/man/0000755000176200001440000000000014526256036012345 5ustar liggesusersgtools/man/checkRVersion.Rd0000644000176200001440000000256714526256036015413 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/checkRVersion.R \name{checkRVersion} \alias{checkRVersion} \title{Check if a newer version of R is available} \usage{ checkRVersion(quiet = FALSE) } \arguments{ \item{quiet}{Logical indicating whether printed output should be suppressed.} } \value{ Either the version number of the latest version of R, if the running version is less than the latest version, or NULL. } \description{ Check if a newer version of R is available } \details{ This function accesses the R web site to discover the latest released version of R. It then compares this version to the running version. If the running version is the same as the latest version, it prints the message, "The latest version of R is installed:" followed by the version number, and returns NULL. If the running version is older than the current version, it displays the message, "A newer version of R is now available:" followed by the corresponding version number, and returns the version number. If \code{quiet=TRUE}, no printing is performed. } \note{ This function uses the internet to access the R project web site. If internet access is unavailable or the R project web site is down, the function will fail. } \examples{ try( ver <- checkRVersion() ) print(ver) } \seealso{ \code{\link[base]{R.Version}} } \author{ Gregory R. Warnes } \keyword{utilities} gtools/man/combinations.Rd0000644000176200001440000000437414261670123015322 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/combinations.R \name{combinations} \alias{combinations} \alias{permutations} \title{Enumerate the Combinations or Permutations of the Elements of a Vector} \usage{ combinations(n, r, v = 1:n, set = TRUE, repeats.allowed = FALSE) permutations(n, r, v = 1:n, set = TRUE, repeats.allowed = FALSE) } \arguments{ \item{n}{Size of the source vector} \item{r}{Size of the target vectors} \item{v}{Source vector. Defaults to \code{1:n}} \item{set}{Logical flag indicating whether duplicates should be removed from the source vector \code{v}. Defaults to \code{TRUE}.} \item{repeats.allowed}{Logical flag indicating whether the constructed vectors may include duplicated values. Defaults to \code{FALSE}.} } \value{ Returns a matrix where each row contains a vector of length \code{r}. } \description{ \code{combinations} enumerates the possible combinations of a specified size from the elements of a vector. \code{permutations} enumerates the possible permutations. } \details{ Caution: The number of combinations and permutations increases rapidly with \code{n} and \code{r}!. To use values of \code{n} above about 45, you will need to increase R's recursion limit. See the \code{expression} argument to the \code{options} command for details on how to do this. Taken from an email by Brian D Ripley to r-help dated Tue, 14 Dec 1999 11:14:04 +0000 (GMT) in response to Alex Ahgarin \email{datamanagement@email.com}. Original version was named "subsets" and was Written by Bill Venables. } \examples{ combinations(3,2,letters[1:3]) combinations(3,2,letters[1:3],repeats=TRUE) permutations(3,2,letters[1:3]) permutations(3,2,letters[1:3],repeats=TRUE) \dontrun{ # To use large 'n', you need to change the default recusion limit options(expressions=1e5) cmat <- combinations(300,2) dim(cmat) # 44850 by 2 } } \references{ Venables, Bill. "Programmers Note", R-News, Vol 1/1, Jan. 2001. \url{https://cran.r-project.org/doc/Rnews/} } \seealso{ \code{\link[base]{choose}}, \code{\link[base]{options}} } \author{ Original versions by Bill Venables \email{Bill.Venables@cmis.csiro.au}. Extended to handle \code{repeats.allowed} by Gregory R. Warnes \email{greg@warnes.net}. } \keyword{manip} gtools/man/logit.Rd0000644000176200001440000000224414261670123013745 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/logit.R \name{logit} \alias{logit} \alias{inv.logit} \title{Generalized logit and inverse logit function} \usage{ logit(x, min = 0, max = 1) inv.logit(x, min = 0, max = 1) } \arguments{ \item{x}{value(s) to be transformed} \item{min}{Lower end of logit interval} \item{max}{Upper end of logit interval} } \value{ Transformed value(s). } \description{ Compute generalized logit and generalized inverse logit functions. } \details{ The generalized logit function takes values on [min, max] and transforms them to span [-Inf,Inf] it is defined as: \deqn{y = log(\frac{p}{(1-p)})}{y = log(p/(1-p))} where \deqn{p=\frac{(x-min)}{(max-min)}}{p=(x-min)/(max-min)} The generalized inverse logit function provides the inverse transformation: \deqn{x = p' (max-min) + min}{x = p * (max-min) + min} where \deqn{p'=\frac{exp(y)}{(1+exp(y))}}{exp(y)/(1+exp(y))} } \examples{ x <- seq(0, 10, by = 0.25) xt <- logit(x, min = 0, max = 10) cbind(x, xt) y <- inv.logit(xt, min = 0, max = 10) cbind(x, xt, y) } \seealso{ \code{\link[car]{logit}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{math} gtools/man/baseOf.Rd0000644000176200001440000000657014261670123014034 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/baseOf.R \name{baseOf} \alias{baseOf} \title{Transform an integer to an array of base-n digits} \usage{ baseOf(v, base = 10, len = 1) } \arguments{ \item{v}{A single integer value to be transformed.} \item{base}{The base to which to transform to.} \item{len}{The minimal length of the returned array.} } \description{ Transform an integer to an array of base-n digits } \details{ This function converts the elements of an integer vector as an array of its digits. The base of the numbering scheme may be changed away from 10, which defines our decimal system, to any other integer value. For base=2, the number is returned in the binary system. The least significant digit has the highest index in the array, i.e. it appears on the right. The highest exponent is at position 1, i.e. left. To write decimal values in another base is very common in computer science. In particular at the basis 2 the then possible values 0 and 1 are often interpreted as logical false or true. And at the very interface to electrical engineering, it is indicated as an absence or presence of voltage. When several bit values are transported synchronously, then it is common to give every lane of such a data bus a unique 2^x value and interpret it as a number in the binary system. To distinguish 256 characters one once needed 8 bit ("byte"). It is the common unit in which larger non-printable data is presented. Because of the many non-printable characters and the difficulty for most humans to memorize an even longer alphabet, it is presented as two half bytes ("nibble") of 4 bit in a hexadecimal presentation. Example code is shown below. For statisticians, it is more likely to use bit representations for hashing. A bit set to 1 (TRUE) at e.g. position 2, 9 or 17 is interpreted as the presence of a particular feature combination of a sample. With baseOf, you can refer to the bit combination as a number, which is more easily and more efficiently dealt with than with an array of binary values. The example code presents a counter of combinations of features which may be interpreted as a Venn diagram. } \examples{ # decimal representation baseOf(123) # binary representation baseOf(123, base = 2) # octal representation baseOf(123, base = 8) # hexadecimal representation baseOf(123, base = 16) # hexadecimal with more typical letter-notation c(0:9, LETTERS)[baseOf(123, 16)] # hexadecimal again, now showing a single string paste(c(0:9, LETTERS)[baseOf(123, 16)], collapse = "") # decimal representation but filling leading zeroes baseOf(123, len = 5) # and converting that back sum(2^(4:0) * baseOf(123, len = 5)) # hashing and a tabular venn diagram derived from it m <- matrix(sample(c(FALSE, TRUE), replace = TRUE, size = 300), ncol = 4) colnames(m) <- c("strong", "colorful", "nice", "humorous") names(dimnames(m)) <- c("samples", "features") head(m) m.val <- apply(m, 1, function(X) { return(sum(2^((ncol(m) - 1):0) * X)) }) m.val.rle <- rle(sort(m.val)) m.counts <- cbind( baseOf(m.val.rle$value, base = 2, len = ncol(m)), m.val.rle$lengths ) colnames(m.counts) <- c(colnames(m), "num") rownames(m.counts) <- apply(m.counts[, 1:ncol(m)], 1, paste, collapse = "") m.counts[1 == m.counts[, "nice"] & 1 == m.counts[, "humorous"], , drop = FALSE] m.counts[, "num", drop = TRUE] } \author{ Steffen Moeller \email{moeller@debian.org} } \keyword{base} gtools/man/running.Rd0000644000176200001440000001100414261670123014301 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/running.R \name{running} \alias{running} \title{Apply a Function Over Adjacent Subsets of a Vector} \usage{ running( X, Y = NULL, fun = mean, width = min(length(X), 20), allow.fewer = FALSE, pad = FALSE, align = c("right", "center", "left"), simplify = TRUE, by, ... ) } \arguments{ \item{X}{data vector} \item{Y}{data vector (optional)} \item{fun}{Function to apply. Default is \code{mean}} \item{width}{Integer giving the number of vector elements to include in the subsets. Defaults to the lesser of the length of the data and 20 elements.} \item{allow.fewer}{Boolean indicating whether the function should be computed for subsets with fewer than \code{width} points} \item{pad}{Boolean indicating whether the returned results should be 'padded' with NAs corresponding to sets with less than \code{width} elements. This only applies when when \code{allow.fewer} is FALSE.} \item{align}{One of "right", "center", or "left". This controls the relative location of `short' subsets with less then \code{width} elements: "right" allows short subsets only at the beginning of the sequence so that all of the complete subsets are at the end of the sequence (i.e. `right aligned'), "left" allows short subsets only at the end of the data so that the complete subsets are `left aligned', and "center" allows short subsets at both ends of the data so that complete subsets are `centered'.} \item{simplify}{Boolean. If FALSE the returned object will be a list containing one element per evaluation. If TRUE, the returned object will be coerced into a vector (if the computation returns a scalar) or a matrix (if the computation returns multiple values). Defaults to FALSE.} \item{by}{Integer separation between groups. If \code{by=width} will give non-overlapping windows. Default is missing, in which case groups will start at each value in the X/Y range.} \item{\dots}{parameters to be passed to \code{fun}} } \value{ List (if \code{simplify==TRUE}), vector, or matrix containing the results of applying the function \code{fun} to the subsets of \code{X} (\code{running}) or \code{X} and \code{Y}. Note that this function will create a vector or matrix even for objects which are not simplified by \code{sapply}. } \description{ Applies a function over subsets of the vector(s) formed by taking a fixed number of previous points. } \details{ \code{running} applies the specified function to a sequential windows on \code{X} and (optionally) \code{Y}. If \code{Y} is specified the function must be bivariate. } \examples{ # show effect of pad running(1:20, width = 5) running(1:20, width = 5, pad = TRUE) # show effect of align running(1:20, width = 5, align = "left", pad = TRUE) running(1:20, width = 5, align = "center", pad = TRUE) running(1:20, width = 5, align = "right", pad = TRUE) # show effect of simplify running(1:20, width = 5, fun = function(x) x) # matrix running(1:20, width = 5, fun = function(x) x, simplify = FALSE) # list # show effect of by running(1:20, width = 5) # normal running(1:20, width = 5, by = 5) # non-overlapping running(1:20, width = 5, by = 2) # starting every 2nd # Use 'pad' to ensure correct length of vector, also show the effect # of allow.fewer. par(mfrow = c(2, 1)) plot(1:20, running(1:20, width = 5, allow.fewer = FALSE, pad = TRUE), type = "b") plot(1:20, running(1:20, width = 5, allow.fewer = TRUE, pad = TRUE), type = "b") par(mfrow = c(1, 1)) # plot running mean and central 2 standard deviation range # estimated by *last* 40 observations dat <- rnorm(500, sd = 1 + (1:500) / 500) plot(dat) sdfun <- function(x, sign = 1) mean(x) + sign * sqrt(var(x)) lines(running(dat, width = 51, pad = TRUE, fun = mean), col = "blue") lines(running(dat, width = 51, pad = TRUE, fun = sdfun, sign = -1), col = "red") lines(running(dat, width = 51, pad = TRUE, fun = sdfun, sign = 1), col = "red") # plot running correlation estimated by last 40 observations (red) # against the true local correlation (blue) sd.Y <- seq(0, 1, length = 500) X <- rnorm(500, sd = 1) Y <- rnorm(500, sd = sd.Y) plot(running(X, X + Y, width = 20, fun = cor, pad = TRUE), col = "red", type = "s") r <- 1 / sqrt(1 + sd.Y^2) # true cor of (X,X+Y) lines(r, type = "l", col = "blue") } \seealso{ \code{\link[gplots]{wapply}} to apply a function over an x-y window centered at each x point, \code{\link[base]{sapply}}, \code{\link[base]{lapply}} } \author{ Gregory R. Warnes \email{greg@warnes.net}, with contributions by Nitin Jain \email{nitin.jain@pfizer.com}. } \keyword{misc} gtools/man/stat_mode.Rd0000644000176200001440000000407314437664036014623 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/stat_mode.R \name{stat_mode} \alias{stat_mode} \title{Most frequently occurring value} \usage{ stat_mode(x, na.rm = TRUE, ties = c("all", "first", "last", "missing"), ...) } \arguments{ \item{x}{vector of values} \item{na.rm}{logical. Should \code{NA} values be removed before processing?} \item{ties}{character. Which value(s) should be returned in the case of ties?} \item{\dots}{optional additional parameters.} } \value{ vector of the same class as \code{x} } \description{ Most frequently occurring value } \examples{ # Character vector chr_vec <- c("a", "d", "d", "h", "h", NA, NA) # Multiple modes stat_mode(x = chr_vec) stat_mode(x = chr_vec, na.rm = FALSE) stat_mode(x = chr_vec, na.rm = FALSE, ties = "first") stat_mode(x = chr_vec, na.rm = FALSE, ties = "last") # - # Numeric vector # See that it keeps the original vector type num_vec <- c(2, 3, 3, 4, 4, NA, NA) stat_mode(x = num_vec) stat_mode(x = num_vec, na.rm = FALSE) stat_mode(x = num_vec, na.rm = FALSE, ties = "first") stat_mode(x = num_vec, na.rm = FALSE, ties = "last") # The default option is ties="all" but it is very easy for the user to control # the ties without changing this parameter. # Select always just one mode, being that the first mode stat_mode(x = num_vec)[1] # Select the first and the second stat_mode stat_mode(x = num_vec)[c(1, 2)] # Logical Vectors stat_mode(x = c(TRUE, TRUE)) stat_mode(x = c(FALSE, FALSE, TRUE, TRUE)) # - # Single element cases stat_mode(x = c(NA_real_)) stat_mode(x = 2) stat_mode(x = NA) stat_mode(x = c("a")) # Not allowing multiple stat_mode, returning NA if that happens stat_mode(x = c(1, 1, 2, 2), multiple_modes = FALSE) # multiple stat_mode stat_mode(x = c(1, 1), multiple_modes = FALSE) # single mode # Empty vector cases # The ties of any empty vector will be itself (an empty vector of the same type) stat_mode(x = double()) stat_mode(x = complex()) stat_mode(x = vector("numeric")) stat_mode(x = vector("character")) } \author{ Genei Ryodan and Gregory R. Warnes \email{greg@warnes.net}. } gtools/man/setTCPNoDelay.Rd0000644000176200001440000000357214261670123015252 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/setTCPNoDelay.R \name{setTCPNoDelay} \alias{setTCPNoDelay} \title{Modify the TCP_NODELAY (`de-Nagle') flag for socket objects} \usage{ setTCPNoDelay(socket, value = TRUE) } \arguments{ \item{socket}{A socket connection object} \item{value}{Logical indicating whether to set (\code{TRUE}) or unset (\code{FALSE}) the flag} } \value{ The character string "SUCCESS" will be returned invisible if the operation was successful. On failure, an error will be generated. } \description{ Modify the TCP_NODELAY (`de-Nagle') flag for socket objects } \details{ By default, TCP connections wait a small fixed interval before actually sending data, in order to permit small packets to be combined. This algorithm is named after its inventor, John Nagle, and is often referred to as 'Nagling'. While this reduces network resource utilization in these situations, it imposes a delay on all outgoing message data, which can cause problems in client/server situations. This function allows this feature to be disabled (de-Nagling, \code{value=TRUE}) or enabled (Nagling, \code{value=FALSE}) for the specified socket. } \examples{ \dontrun{ host <- "www.r-project.org" socket <- make.socket(host, 80) print(socket) setTCPNoDelay(socket, TRUE) write.socket(socket, "GET /\n\n") write.socket(socket, "A") write.socket(socket, "B\n") while ((str <- read.socket(socket)) > "") { cat(str) } close.socket(socket) } } \references{ "Nagle's algorithm" \url{https://en.wikipedia.org/wiki/Nagle's_algorithm}, Nagle, John. "Congestion Control in IP/TCP Internetworks", IETF Request for Comments 896, January 1984. \url{https://www.ietf.org/rfc/rfc0896.txt?number=896} } \seealso{ \code{\link{make.socket}}, \code{\link{socketConnection}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{misc} \keyword{programming} \keyword{utilities} gtools/man/stars.pval.Rd0000644000176200001440000000163114322256611014723 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/stars.pval.R \name{stars.pval} \alias{stars.pval} \title{Generate significance stars from p-values} \usage{ stars.pval(p.value) } \arguments{ \item{p.value}{numeric vector of p-values} } \value{ A character vector containing the same number of elements as \code{p-value}, with an attribute "legend" providing the conversion pattern. } \description{ Generate significance stars (e.g. '***', '**', '*', '.') from p-values using R's standard definitions. } \details{ Mapping from p-value ranges to symbols: \describe{ \item{0 - 0.001}{'***'} \item{0.001 - 0.01}{'**'} \item{0.01 - 0.05}{'*'} \item{0.05 - 0.1}{'.'} \item{0.1 - 1.0}{'' (No symbol)} } } \examples{ p.val <- c(0.0004, 0.0015, 0.013, 0.044, 0.067, 0.24) stars.pval(p.val) } \seealso{ \code{\link[stats]{symnum}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{misc} gtools/man/mixedsort.Rd0000644000176200001440000001135414322256737014660 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mixedsort.R \name{mixedsort} \alias{mixedsort} \alias{mixedorder} \title{Order or Sort strings with embedded numbers so that the numbers are in the correct order} \usage{ mixedsort( x, decreasing = FALSE, na.last = TRUE, blank.last = FALSE, numeric.type = c("decimal", "roman"), roman.case = c("upper", "lower", "both"), scientific = TRUE ) mixedorder( x, decreasing = FALSE, na.last = TRUE, blank.last = FALSE, numeric.type = c("decimal", "roman"), roman.case = c("upper", "lower", "both"), scientific = TRUE ) } \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.} \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?} \item{scientific}{logical. Should exponential notation be allowed for numeric values.} } \value{ \code{mixedorder} returns a vector giving the sort order of the input elements. \code{mixedsort} returns the sorted vector. } \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. "Aspirin 50mg" will come before "Aspirin 100mg". In addition, case of character strings is ignored so that "a", will come before "B" and "C". } \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}. 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}. } \examples{ ## compound & dose labels Treatment <- c( "Control", "Aspirin 10mg/day", "Aspirin 50mg/day", "Aspirin 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 ## 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) ## Control scientific notation for number matching: vals <- c("3E1", "2E3", "4e0") mixedsort(vals) # With scientfic notation mixedsort(vals, scientific = FALSE) # Without scientfic notation } \seealso{ \code{\link[base]{sort}}, \code{\link[base]{order}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{manip} \keyword{univar} gtools/man/split_path.Rd0000644000176200001440000000112014261670123014766 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/split_path.R \name{split_path} \alias{split_path} \title{Split a File Path into Components} \usage{ split_path(x, depth_first = TRUE) } \arguments{ \item{x}{character scalar. Path to be processed.} \item{depth_first}{logical. Should path be returned depth first? Defaults to \code{TRUE}.} } \value{ Character vector of path components, depth first. } \description{ This function converts a character scalar containing a \emph{valid} file path into a character vector of path components (e.g. directories). } gtools/man/script_file.Rd0000644000176200001440000000313314322256737015141 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/script_file.R \name{script_file} \alias{script_file} \alias{script_path} \title{Determine the directory or full path to the currently executing script} \usage{ script_file(fail = c("stop", "warning", "quiet")) script_path(fail = c("stop", "warning", "quiet")) } \arguments{ \item{fail}{character, one of "stop", "warning", "quiet". specifying what should be done when the script path cannot be determined: "stop" causes an error to be generated, "warn" generates a warning message and returns NA, "quiet" silently returns NA. These function should work with \code{Rscript}, \code{source()}, \code{Rmarkdown} \code{RStudio}'s "Run selection", and the \code{RStudio} Console.} } \value{ A character scalar containing the full path to the currently executing script file (\code{script_file}) or its directory (\code{script_path}). If unable to determine the script path, it generates a warning and returns \code{""} (empty string). } \description{ Determine the directory or full path to the currently executing script } \section{Functions}{ \itemize{ \item \code{script_file()}: Determine the full path of the currently executing script \item \code{script_path()}: Determine the directory of the currently executing script }} \examples{ getwd() commandArgs(trailingOnly = FALSE) script_file("warning") script_path("warning") } \author{ Greg Warnes \email{greg@warnes.net} based on on a Stack Overflow post by jerry-t (\url{https://stackoverflow.com/users/2292993/jerry-t}) at \url{https://stackoverflow.com/a/36777602/2744062}. } gtools/man/gtools-defunct.Rd0000644000176200001440000000174614261670123015572 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gtools-defunct.R \name{assert} \alias{assert} \alias{gtools-defunct} \alias{addLast} \alias{capture} \alias{sprint} \title{Defunct Functions in package \code{gtools}} \usage{ assert(...) capture(expression, collapse = "\\n") sprint(x, ...) } \arguments{ \item{expression, collapse, x, \dots}{ignored} } \description{ The functions or variables listed here are no longer part of package \code{gtools}. } \details{ \itemize{ \item \code{assert} is a defunct synonym for \code{\link[base]{stopifnot}}. \item \code{addLast} has been replaced by \code{lastAdd}, which has the same purpose but applied using different syntax. \item \code{capture} and \code{capture.output} have been removed in favor of \code{capture.output} from the \code{utils} package. } } \seealso{ \code{\link[base]{Defunct}}, \code{\link[base]{stopifnot}}, \code{\link[gtools]{lastAdd}}, \code{\link[utils]{capture.output}} } \keyword{misc} gtools/man/permute.Rd0000644000176200001440000000107314261670123014307 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/permute.R \name{permute} \alias{permute} \title{Randomly Permute the Elements of a Vector} \usage{ permute(x) } \arguments{ \item{x}{Vector of items to be permuted} } \value{ Vector with the original items reordered. } \description{ Randomly Permute the elements of a vector } \details{ This is simply a wrapper function for \code{\link{sample}}. } \examples{ x <- 1:10 permute(x) } \seealso{ \code{\link{sample}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{distribution} gtools/man/gtools.Rd0000644000176200001440000000474514526256036014155 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gtools-package.R \docType{package} \name{gtools} \alias{gtools} \alias{gtools-package} \title{gtools: Various R Programming Tools} \description{ Functions to assist in R programming, including: \describe{ \item{developing, updating, and maintaining R and R packages}{'ask', 'checkRVersion', 'getDependencies', 'keywords', 'scat'} \item{calculate the logit and inverse logit transformations}{'logit', 'inv.logit'} \item{test if a value is missing, empty, contains only NA and NULL values, or is a 'try-error'}{'invalid'} \item{manipulate R's .Last function}{'addLast'} \item{define macros}{'defmacro', 'strmacro'} \item{detect odd and even integers}{'odd', 'even'} \item{convert strings containing non-ASCII characters (like single quotes) to plain ASCII}{'ASCIIfy'} \item{perform a binary search}{'binsearch'} \item{sort strings containing both numeric and character components}{'mixedsort', 'mixedorder'} \item{create a factor variable from the quantiles of a continuous variable}{'quantcut'} \item{enumerate permutations and combinations}{'combinations', 'permutation'} \item{calculate and convert between fold-change and log-ratio}{'foldchange', 'logratio2foldchange', 'foldchange2logratio'} \item{calculate probabilities and generate random numbers from Dirichlet distributions}{'rdirichlet', 'ddirichlet'} \item{apply a function over adjacent subsets of a vector}{'running'} \item{modify the TCP_NODELAY ('de-Nagle') flag for socket objects}{'tcpNoDelay'} \item{efficient 'rbind' of data frames, even if the column names don't match}{'smartbind'} \item{generate significance stars from p-values}{'stars.pval'} \item{convert characters to/from ASCII codes}{asc, chr} \item{convert character vector to ASCII representation}{'ASCIIfy'} \item{apply title capitalization rules to a character vector}{'capwords'} } } \seealso{ Useful links: \itemize{ \item \url{https://github.com/r-gregmisc/gtools} \item Report bugs at \url{https://github.com/r-gregmisc/gtools/issues} } } \author{ \strong{Maintainer}: Ben Bolker \email{bolker@mcmaster.ca} (\href{https://orcid.org/0000-0002-2127-0443}{ORCID}) Authors: \itemize{ \item Gregory R. Warnes \item Thomas Lumley \item Arni Magnusson \item Bill Venables \item Genei Ryodan \item Steffen Moeller } Other contributors: \itemize{ \item Ian Wilson [contributor] \item Mark Davis [contributor] \item Nitin Jain [contributor] \item Scott Chamberlain [contributor] } } \keyword{internal} gtools/man/ask.Rd0000644000176200001440000000220414261670123013401 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ask.R \name{ask} \alias{ask} \title{Display a prompt and collect the user's response} \usage{ ask(msg = "Press to continue: ", con = stdin()) } \arguments{ \item{msg}{Character vector providing the message to be displayed} \item{con}{Character connection to query, defaults to \code{stdin()}.} } \value{ A character scalar containing the input provided by the user. } \description{ Display a prompt and collect the user's response } \details{ The prompt message will be displayed, and then \code{readLines} is used to collect a single input value (possibly empty), which is then returned. In most situations using the default \code{con=stdin()} should work properly. Under RStudio, it is necessary to specify \code{con=file("stdin")} for proper operation. } \examples{ # use default prompt ask() silly <- function() { age <- ask("How old aroe you? ") age <- as.numeric(age) cat("In 10 years you will be", age + 10, "years old!\n") } } \seealso{ \code{\link{readLines}}, \code{\link{scan}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{IO} gtools/man/ELISA.Rd0000644000176200001440000000153114261670123013462 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ELISA.R \docType{data} \name{ELISA} \alias{ELISA} \title{Data from an ELISA assay} \format{ a data frame with the following columns: \itemize{ \item PlateDay factor. Specifies one of four physically distinct 96 well plates \item Read factor. The signal was read 3 times for each plate. \item Description character. Indicates contents of sample. \item Concentration numeric. Nominal concentration of standards (NA for all other samples). \item Signal numeric. Assay signal. Specifically, optical density (a colorimetric assay). } } \source{ Anonymized data. } \description{ Observed signals and (for some observations) nominal concentrations for samples that were aliquoted to multiple assay plates, which were read multiple times on multiple days. } \keyword{datasets} gtools/man/invalid.Rd0000644000176200001440000000153714261670123014261 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/invalid.R \name{invalid} \alias{invalid} \title{Test if a value is missing, empty, contains only NA or NULL values, or is a try-error.} \usage{ invalid(x) } \arguments{ \item{x}{value to be tested} } \value{ Logical value. } \description{ Test if a value is missing, empty, contains only NA or NULL values, or is a try-error. } \examples{ invalid(NA) invalid() invalid(c(NA, NA, NULL, NA)) invalid(list(a = 1, b = NULL)) x <- try(log("A")) invalid(x) # example use in a function myplot <- function(x, y) { if (invalid(y)) { y <- x x <- 1:length(y) } plot(x, y) } myplot(1:10) myplot(1:10, NA) } \seealso{ \code{\link[base]{missing}}, \code{\link[base]{is.na}}, \code{\link[base]{is.null}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{programming} gtools/man/keywords.Rd0000644000176200001440000000135314262132512014472 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/keywords.R \name{keywords} \alias{keywords} \title{List valid keywords for R man pages} \usage{ keywords(topic) } \arguments{ \item{topic}{object or man page topic} } \description{ List valid keywords for R man pages } \details{ If \code{topic} is provided, return a list of the keywords associated with \code{topic}. Otherwise, display the list of valid R keywords from the R doc/KEYWORDS file. } \examples{ ## Show all valid R keywords \dontrun{ keywords() ## Show keywords associated with the 'merge' function keywords(merge) keywords("merge") } } \seealso{ \code{\link[utils]{help}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{documentation} gt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R/defmacro.R, R/strmacro.R \name{defmacro} \alias{defmacro} \alias{strmacro} \title{Define a macro} \usage{ defmacro(..., expr) strmacro(..., expr, strexpr) } \arguments{ \item{\dots}{macro argument list} \item{expr}{R expression defining the macro body} \item{strexpr}{character string defining the macro body} } \value{ A macro function. } \description{ \code{defmacro} define a macro that uses R expression replacement } \details{ \code{strmacro} define a macro that uses string replacement \code{defmacro} and \code{strmacro} create a macro from the expression given in \code{expr}, with formal arguments given by the other elements of the argument list. A macro is similar to a function definition except for handling of formal arguments. In a function, formal arguments are simply variables that contains the result of evaluating the expressions provided to the function call. In contrast, macros actually modify the macro body by \emph{replacing} each formal argument by the expression (\code{defmacro}) or string (\code{strmacro}) provided to the macro call. For \code{defmacro}, the special argument name \code{DOTS} will be replaced by \code{...} in the formal argument list of the macro so that \code{...} in the body of the expression can be used to obtain any additional arguments passed to the macro. For \code{strmacro} you can mimic this behavior providing a \code{DOTS=""} argument. This is illustrated by the last example below. Macros are often useful for creating new functions during code execution. } \note{ Note that because [the defmacro code] works on the parsed expression, not on a text string, defmacro avoids some of the problems of traditional string substitution macros such as \code{strmacro} and the C preprocessor macros. For example, in \preformatted{ mul <- defmacro(a, b, expr={a*b}) } a C programmer might expect \code{mul(i, j + k)} to expand (incorrectly) to \code{i*j + k}. In fact it expands correctly, to the equivalent of \code{i*(j + k)}. For a discussion of the differences between functions and macros, please Thomas Lumley's R-News article (reference below). } \examples{ #### # macro for replacing a specified missing value indicator with NA # within a dataframe ### setNA <- defmacro(df, var, values, expr = { df$var[df$var \%in\% values] <- NA } ) # create example data using 999 as a missing value indicator d <- data.frame( Grp = c("Trt", "Ctl", "Ctl", "Trt", "Ctl", "Ctl", "Trt", "Ctl", "Trt", "Ctl"), V1 = c(1, 2, 3, 4, 5, 6, 999, 8, 9, 10), V2 = c(1, 1, 1, 1, 1, 2, 999, 2, 999, 999), stringsAsFactors = TRUE ) d # Try it out setNA(d, V1, 999) setNA(d, V2, 999) d ### # Expression macro ### plot.d <- defmacro(df, var, DOTS, col = "red", title = "", expr = plot(df$var ~ df$Grp, type = "b", col = col, main = title, ...) ) plot.d(d, V1) plot.d(d, V1, col = "blue") plot.d(d, V1, lwd = 4) # use optional 'DOTS' argument ### # String macro (note the quoted text in the calls below) # # This style of macro can be useful when you are reading # function arguments from a text file ### plot.s <- strmacro(DF, VAR, COL = "'red'", TITLE = "''", DOTS = "", expr = plot(DF$VAR ~ DF$Grp, type = "b", col = COL, main = TITLE, DOTS) ) plot.s("d", "V1") plot.s(DF = "d", VAR = "V1", COL = '"blue"') plot.s("d", "V1", DOTS = "lwd=4") # use optional 'DOTS' argument ####### # Create a macro that defines new functions ###### plot.sf <- defmacro( type = "b", col = "black", title = deparse(substitute(x)), DOTS, expr = function(x, y) plot(x, y, type = type, col = col, main = title, ...) ) plot.red <- plot.sf(col = "red", title = "Red is more Fun!") plot.blue <- plot.sf(col = "blue", title = "Blue is Best!", lty = 2) plot.red(1:100, rnorm(100)) plot.blue(1:100, rnorm(100)) } \references{ The original \code{defmacro} code was directly taken from: Lumley T. "Programmer's Niche: Macros in R", R News, 2001, Vol 1, No. 3, pp 11--13, \url{https://cran.r-project.org/doc/Rnews/} } \seealso{ \code{\link[base]{function}} \code{\link[base]{substitute}}, \code{\link[base]{eval}}, \code{\link[base]{parse}}, \code{\link[base]{source}}, \code{\link[base]{parse}}, } \author{ Thomas Lumley wrote \code{defmacro}. Gregory R. Warnes \email{greg@warnes.net} enhanced it and created \code{strmacro}. } \keyword{##} \keyword{Code} \keyword{from} \keyword{programming} gtools/man/roman2int.Rd0000644000176200001440000000207614261670123014543 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/roman2int.R \name{roman2int} \alias{roman2int} \title{Convert Roman Numerals to Integers} \usage{ roman2int(roman) } \arguments{ \item{roman}{character vector containing roman numerals} } \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}. } \description{ Convert roman numerals to integers } \details{ This function will convert roman numerals to integers without the upper bound imposed by R (3899), ignoring case. } \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) } \seealso{ \code{\link[utils]{as.roman}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{arith} gtools/man/ASCIIfy.Rd0000644000176200001440000000257714437664036014042 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ASCIIfy.R \name{ASCIIfy} \alias{ASCIIfy} \title{Convert Characters to ASCII} \usage{ ASCIIfy(x, bytes = 2, fallback = "?") } \arguments{ \item{x}{a character vector, possibly containing non-ASCII characters.} \item{bytes}{either \code{1} or \code{2}, for single-byte (\samp{\x00}) or two-byte (\samp{\u0000}) codes.} \item{fallback}{an output character to use, when input characters cannot be converted.} } \value{ A character vector like \code{x}, except non-ASCII characters have been replaced with \samp{\x00} or \samp{\u0000} codes. } \description{ Convert character vector to ASCII, replacing non-ASCII characters with single-byte (\samp{\x00}) or two-byte (\samp{\u0000}) codes. } \note{ To render single backslashes, use these or similar techniques: \preformatted{ write(ASCIIfy(x), "file.txt") cat(paste(ASCIIfy(x), collapse="\n"), "\n", sep="")} The resulting strings are plain ASCII and can be used in R functions and datasets to improve package portability. } \examples{ cities <- c("S\u00e3o Paulo", "Reykjav\u00edk") print(cities) ASCIIfy(cities, 1) ASCIIfy(cities, 2) athens <- "\u0391\u03b8\u03ae\u03bd\u03b1" print(athens) ASCIIfy(athens) } \seealso{ \code{\link[tools]{showNonASCII}} identifies non-ASCII characters in a character vector. } \author{ Arni Magnusson. } \keyword{character} \keyword{utilites} gtools/man/capwords.Rd0000644000176200001440000000510614437664036014464 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/capwords.R \name{capwords} \alias{capwords} \title{Capitalize Words for Titles} \usage{ capwords( s, strict = FALSE, AP = TRUE, onlyfirst = FALSE, preserveMixed = FALSE, sep = " " ) } \arguments{ \item{s}{character string to be processed} \item{strict}{Logical, remove all additional capitalization.} \item{AP}{Logical, apply the Associated Press (AP) rules for prepositions and conjunctions that should not be capitalized in titles.} \item{onlyfirst}{Logical, only capitalize the first word.} \item{preserveMixed}{Logical, preserve the capitalization mixed-case words containing an upper-case letter after a lower-case letter.} \item{sep}{Character string, word separator} } \value{ A character scalar containing the capitalized words. } \description{ This function capitalizes words for use in titles } \details{ This function separates the provided character string into separate words using \code{sep} as the word separator. If \code{firstonly==TRUE}, it then capitalizes the first letter the first word, otherwise (the default), it capitalizes the first letter of every word. If \code{AP==TRUE}, it then un-capitalizes words in the Associated Press's (AP) list of prepositions and conjunctions should not be capitalized in titles. Next, it capitalizes the first word. It then re-joins the words using the specified separator. If \code{preserveMixed==TRUE}, words with an upper-case letter appearing after a lower-case letter will not be changed (e.g. "iDevice"). } \examples{ capwords("a function to capitalize words in a title") capwords("a function to capitalize words in a title", AP = FALSE) capwords("testing the iProduct for defects") capwords("testing the iProduct for defects", strict = TRUE) capwords("testing the iProduct for defects", onlyfirst = TRUE) capwords("testing the iProduct for defects", preserveMixed = TRUE) capwords("title_using_underscores_as_separators", sep = "_") } \references{ Fogarty, Mignon. Capitalizing Titles: "Which words should you capitalize? Grammar Girl's Quick and Dirty Tips for Better Writing. 9 Jun. 2011. Quick and Dirty Tips Website." Accessed 22 April 2016 \url{https://www.quickanddirtytips.com/articles/capitalizing-titles/} } \seealso{ \code{\link[base]{chartr}}, \code{\link[taxize]{taxize_capwords}}, \code{\link[SGP]{capwords}} } \author{ Gregory R. Warnes \email{greg@warnes.net} based on code from the \code{\link[base]{chartr}} manual page, and Scott Chamberlain's \code{\link[taxize]{taxize_capwords}} in the taxize package. } \keyword{character} \keyword{utilites} gtools/man/gtools-deprecated.Rd0000644000176200001440000000114014261670123016226 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gtools-deprecated.R \name{gtools-deprecated} \alias{gtools-deprecated} \title{Deprecated Functions in the gtools package} \description{ These functions are provided for compatibility with older versions of gtools, and may be defunct as soon as the next release. } \details{ gtools currently contains no deprecated functions. % The original help page for these functions is often % available at \code{help("oldName-deprecated")} (note the quotes). % % \itemize{ % \item{} % } } \seealso{ \code{\link{Deprecated}} } \keyword{misc} gtools/man/quantcut.Rd0000644000176200001440000000371614261670123014500 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/quantcut.R \name{quantcut} \alias{quantcut} \title{Create a Factor Variable Using the Quantiles of a Continuous Variable} \usage{ quantcut(x, q = 4, na.rm = TRUE, ...) } \arguments{ \item{x}{Continuous 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}}.} } \value{ Factor variable with one level for each quantile interval. } \description{ Create a factor variable using the quantiles of a continuous variable. } \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. } \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{ stopifnot(identical(deciles.1, deciles.2)) # } ## show handling of 'tied' quantiles. x <- round(x) # discretize to create ties stem(x) # display the ties deciles <- quantcut(x, 10) table(deciles) # note that there are only 5 groups (not 10) # due to duplicates } \seealso{ \code{\link{cut}}, \code{\link{quantile}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{manip} gtools/man/binsearch.Rd0000644000176200001440000000763414261670123014575 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/binsearch.R \name{binsearch} \alias{binsearch} \title{Binary Search} \usage{ binsearch( fun, range, ..., target = 0, lower = ceiling(min(range)), upper = floor(max(range)), maxiter = 100, showiter = FALSE ) } \arguments{ \item{fun}{Monotonic function over which the search will be performed.} \item{range}{2-element vector giving the range for the search.} \item{\dots}{Additional parameters to the function \code{fun}.} \item{target}{Target value for \code{fun}. Defaults to 0.} \item{lower}{Lower limit of search range. Defaults to \code{min(range)}.} \item{upper}{Upper limit of search range. Defaults to \code{max(range)}.} \item{maxiter}{Maximum number of search iterations. Defaults to 100.} \item{showiter}{Boolean flag indicating whether the algorithm state should be printed at each iteration. Defaults to FALSE.} } \value{ A list containing: \item{call}{How the function was called.} \item{numiter}{The number of iterations performed} \item{flag }{One of the strings, "Found", "Between Elements", "Maximum number of iterations reached", "Reached lower boundary", or "Reached upper boundary."} \item{where}{One or two values indicating where the search terminated.} \item{value}{Value of the function \code{fun} at the values of \code{where}.} } \description{ Search within a specified range to locate an integer parameter which results in the the specified monotonic function obtaining a given value. } \details{ This function implements an extension to the standard binary search algorithm for searching a sorted list. The algorithm has been extended to cope with cases where an exact match is not possible, to detect whether that the function may be monotonic increasing or decreasing and act appropriately, and to detect when the target value is outside the specified range. The algorithm initializes two variable \code{lo} and \code{high} to the extremes values of \code{range}. It then generates a new value \code{center} halfway between \code{lo} and \code{hi}. If the value of \code{fun} at \code{center} exceeds \code{target}, it becomes the new value for \code{lo}, otherwise it becomes the new value for \code{hi}. This process is iterated until \code{lo} and \code{hi} are adjacent. If the function at one or the other equals the target, this value is returned, otherwise \code{lo}, \code{hi}, and the function value at both are returned. Note that when the specified target value falls between integers, the \emph{two} closest values are returned. If the specified target falls outside of the specified \code{range}, the closest endpoint of the range will be returned, and an warning message will be generated. If the maximum number if iterations was reached, the endpoints of the current subset of the range under consideration will be returned. } \note{ This function often returns two values for \code{where} and \code{value}. Be sure to check the \code{flag} parameter to see what these values mean. } \examples{ ### Toy examples # search for x=10 binsearch(function(x) x - 10, range = c(0, 20)) # search for x=10.1 binsearch(function(x) x - 10.1, range = c(0, 20)) ### Classical toy example # binary search for the index of 'M' among the sorted letters fun <- function(X) { ifelse(LETTERS[X] > "M", 1, ifelse(LETTERS[X] < "M", -1, 0) ) } binsearch(fun, range = 1:26) # returns $where=13 LETTERS[13] ### Substantive example, from genetics \dontrun{ library(genetics) # Determine the necessary sample size to detect all alleles with # frequency 0.07 or greater with probability 0.95. power.fun <- function(N) 1 - gregorius(N = N, freq = 0.07)$missprob binsearch(power.fun, range = c(0, 100), target = 0.95) # equivalent to gregorius(freq = 0.07, missprob = 0.05) } } \seealso{ \code{\link{optim}}, \code{\link{optimize}}, \code{\link{uniroot}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{optimize} \keyword{programming} gtools/man/na.replace.Rd0000644000176200001440000000170114261670123014634 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/na.replace.R \name{na.replace} \alias{na.replace} \title{Replace Missing Values} \usage{ na.replace(x, replace, ...) } \arguments{ \item{x}{vector possibly containing missing (\code{NA}) values} \item{replace}{either a scalar replacement value, or a function returning a scalar value} \item{...}{Optional arguments to be passed to \code{replace}} } \value{ Vector with missing values (\code{NA}) replaced by the value of \code{replace}. } \description{ Replace missing values } \details{ This is a convenience function that is the same as x[is.na(x)] <- replace } \examples{ x <- c(1, 2, 3, NA, 6, 7, 8, NA, NA) # Replace with a specified value na.replace(x, "999") # Replace with the calculated median na.replace(x, median, na.rm = TRUE) } \seealso{ \code{\link[base]{is.na}}, \code{\link[stats]{na.omit}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{manip} gtools/man/dirichlet.Rd0000644000176200001440000000320014322256737014600 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/dirichlet.R \name{dirichlet} \alias{dirichlet} \alias{rdirichlet} \alias{ddirichlet} \title{Functions for the Dirichlet Distribution} \usage{ ddirichlet(x, alpha) rdirichlet(n, alpha) } \arguments{ \item{x}{A vector containing a single random deviate or matrix containing one random deviate per row.} \item{alpha}{Vector or (for \code{ddirichlet}) matrix containing shape parameters.} \item{n}{Number of random vectors to generate.} } \value{ \code{ddirichlet} returns a vector containing the Dirichlet density for the corresponding rows of \code{x}. \code{rdirichlet} returns a matrix with \code{n} rows, each containing a single Dirichlet random deviate. } \description{ Functions to compute the density of or generate random deviates from the Dirichlet distribution } \details{ The Dirichlet distribution is the multidimensional generalization of the beta distribution. It is the canonical Bayesian distribution for the parameter estimates of a multinomial distribution. } \section{Functions}{ \itemize{ \item \code{ddirichlet()}: Dirichlet distribution function. \item \code{rdirichlet()}: Generate dirichlet random deviates. }} \examples{ x <- rdirichlet(20, c(1, 1, 1)) ddirichlet(x, c(1, 1, 1)) } \seealso{ \code{\link{dbeta}}, \code{\link{rbeta}} } \author{ Code original posted by Ben Bolker to R-News on Fri Dec 15 2000. See \url{https://stat.ethz.ch/pipermail/r-help/2000-December/009561.html}. Ben attributed the code to Ian Wilson \email{i.wilson@maths.abdn.ac.uk}. Subsequent modifications by Gregory R. Warnes \email{greg@warnes.net}. } \keyword{distribution} gtools/man/unByteCode.Rd0000644000176200001440000000522414262130165014667 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/unByteCode.R \name{unByteCode} \alias{unByteCode} \alias{unByteCodeAssign} \alias{assignEdgewise} \title{Convert a byte-code function to an interpreted-code function} \usage{ unByteCode(fun) assignEdgewise(name, env, value) unByteCodeAssign(fun) } \arguments{ \item{fun}{function to be modified} \item{name}{object name} \item{env}{namespace} \item{value}{new function body} } \value{ All three functions return a copy of the modified function or assigned value. } \description{ The purpose of these functions is to allow a byte coded function to be converted back into a fully interpreted function as a \emph{temporary} work around for issues in byte-code interpretation. } \details{ \code{unByteCode} returns a copy of the function that is directly interpreted from text rather than from byte-code. \code{assignEdgewise} makes an assignment into a locked environment. \code{unByteCodeAssign} changes the specified function \emph{in its source environment} to be directly interpreted from text rather than from byte-code. The latter two functions no longer work out of the box because \code{assignEdgewise} (which \code{unByteCodeAssign} uses) makes use of an unsafe \code{unlockBinding} call, but running \code{assignEdgewise()} will } \note{ These functions are not intended as a permanent solution to issues with byte-code compilation or interpretation. Any such issues should be promptly reported to the R maintainers via the R Bug Tracking System at \url{https://bugs.r-project.org} and via the R-devel mailing list \url{https://stat.ethz.ch/mailman/listinfo/r-devel}. } \examples{ data(badDend) dist2 <- function(x) as.dist(1 - cor(t(x), method = "pearson")) hclust1 <- function(x) hclust(x, method = "single") distance <- dist2(badDend) cluster <- hclust1(distance) dend <- as.dendrogram(cluster) \dontrun{ ## 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 } ## convert stats:::plotNode from byte-code to interpreted-code ## (no longer available unless assignEdgewise is defined by the user) ## unByteCodeAssign(stats:::plotNode) ## illustrated in https://stackoverflow.com/questions/16559250/error-in-heatmap-2-gplots # increase recursion limit options("expressions" = 5e4) # now the function does not crash plot(dend) } \references{ These functions were inspired as a work-around to R bug \url{https://bugs.r-project.org/show_bug.cgi?id=15215}. } \seealso{ \code{\link[compiler]{disassemble}}, \code{\link{assign}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{programming} \keyword{utilites} gtools/man/oddeven.Rd0000644000176200001440000000074514261670123014257 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/oddeven.R \name{oddeven} \alias{oddeven} \alias{odd} \alias{even} \title{Detect odd/even integers} \usage{ odd(x) even(x) } \arguments{ \item{x}{vector of integers} } \value{ Vector of TRUE/FALSE values. } \description{ detect odd/even integers } \examples{ odd(4) even(4) odd(1:10) even(1:10) } \seealso{ \code{\link[base]{round}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{arith} gtools/man/smartbind.Rd0000644000176200001440000000511314261670123014610 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/smartbind.R \name{smartbind} \alias{smartbind} \title{Efficient rbind of data frames, even if the column names don't match} \usage{ smartbind(..., list, fill = NA, sep = ":", verbose = FALSE) } \arguments{ \item{\dots}{Data frames to combine} \item{list}{List containing data frames to combine} \item{fill}{Value to use when 'filling' missing columns. Defaults to \code{NA}.} \item{sep}{Character string used to separate column names when pasting them together.} \item{verbose}{Logical flag indicating whether to display processing messages. Defaults to \code{FALSE}.} } \value{ The returned data frame will contain: \item{columns}{all columns present in any provided data frame} \item{rows}{a set of rows from each provided data frame, with values in columns not present in the given data frame filled with missing (\code{NA}) values.} The data type of columns will be preserved, as long as all data frames with a given column name agree on the data type of that column. If the data frames disagree, the column will be converted into a character strings. The user will need to coerce such character columns into an appropriate type. } \description{ Efficient rbind of data frames, even if the column names don't match } \examples{ df1 <- data.frame(A = 1:10, B = LETTERS[1:10], C = rnorm(10)) df2 <- data.frame(A = 11:20, D = rnorm(10), E = letters[1:10]) # rbind would fail \dontrun{ rbind(df1, df2) # Error in match.names(clabs, names(xi)) : names do not match previous # names: # D, E } # but smartbind combines them, appropriately creating NA entries smartbind(df1, df2) # specify fill=0 to put 0 into the missing row entries smartbind(df1, df2, fill = 0) \dontshow{ n <- 10 # number of data frames to create s <- 10 # number of rows in each data frame # create a bunch of column names names <- LETTERS[2:5] # create a list 'Z' containing 'n' data frames, each with 3 columns # and 's' rows. The first column is always named 'A', but the other # two have a names randomly selected from 'names' Z <- list() for (i in 1:n) { X <- data.frame( A = sample(letters, s, replace = TRUE), B = letters[1:s], C = rnorm(s) ) colnames(X) <- c("A", sample(names, 2, replace = FALSE)) Z[[i]] <- X } # Error in match.names(clabs, names(xi)) : names do not match # previous names: E # But smartbind will 'do the right thing' df <- do.call("smartbind", Z) df # Equivalent call: df <- smartbind(list = Z) } } \seealso{ \code{\link{rbind}}, \code{\link{cbind}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{manip} gtools/man/scat.Rd0000644000176200001440000000133314261670123013557 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scat.R \name{scat} \alias{scat} \title{Display debugging text} \usage{ scat(...) } \arguments{ \item{\dots}{Arguments passed to \code{cat}} } \value{ NULL (invisibly) } \description{ If \code{getOption('DEBUG')==TRUE}, write text to STDOUT and flush so that the text is immediately displayed. Otherwise, do nothing. } \examples{ options(DEBUG = NULL) # makee sure DEBUG isn't set scat("Not displayed") options(DEBUG = TRUE) scat("This will be displayed immediately (even in R BATCH output \n") scat("files), provided options()$DEBUG is TRUE.") } \seealso{ \code{\link[base]{cat}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{print} gtools/man/badDend.Rd0000644000176200001440000000130414261670123014144 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/badDend.R \docType{data} \name{badDend} \alias{badDend} \title{Dataset That Crashes Base:::Plot.Dendogram with 'Node Stack Overflow'} \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" ... } \description{ Base:::Plot.Dendogram() will generate a 'Node Stack Overflow' when run on a dendrogram appropriately constructed from this data set. } \note{ See help page for \code{\link{unByteCode}} to see how to construct the 'bad' dendrogram from this data and how to work around the issue. } \examples{ data(badDend) } \keyword{datasets} gtools/man/asc.Rd0000644000176200001440000000405614437664036013413 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/asc.R \name{asc} \alias{asc} \alias{chr} \title{Convert between characters and 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 containing 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. } \description{ Convert between characters and ASCII codes } \section{Functions}{ \itemize{ \item \code{asc()}: return the characters corresponding to the specified ASCII codes \item \code{chr()}: return the ASCII codes for the specified characters. }} \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) } \seealso{ \code{\link[base]{strtoi}}, \code{\link[base]{charToRaw}}, \code{\link[base]{rawToChar}}, \code{\link[base]{as.raw}} } \author{ Adapted by Gregory R. Warnes \email{greg@warnes.net} from code posted by Mark Davis on the 'Data Debrief' blog on 2011-03-09 at \url{https://datadebrief.blogspot.com/2011/03/ascii-code-table-in-r.html}. } \keyword{character} \keyword{programming} gtools/man/getDependencies.Rd0000644000176200001440000000454314262132512015715 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/getDependencies.R \name{getDependencies} \alias{getDependencies} \title{Get package dependencies} \usage{ getDependencies( pkgs, dependencies = c("Depends", "Imports", "LinkingTo"), installed = TRUE, available = TRUE, base = FALSE, recommended = FALSE ) } \arguments{ \item{pkgs}{character vector of package names} \item{dependencies}{character vector of dependency types to include. Choices are "Depends", "Imports", "LinkingTo", "Suggests", and "Enhances". Defaults to \code{c("Depends", "Imports", "LinkingTo")}.} \item{installed}{Logical indicating whether to pull dependency information from installed packages. Defaults to TRUE.} \item{available}{Logical indicating whether to pull dependency information from available packages. Defaults to TRUE.} \item{base}{Logical indicating whether to include dependencies on base packages that are included in the R installation. Defaults to FALSE.} \item{recommended}{Logical indicating whether to include dependencies on recommended packages that are included in the R installation. Defaults to FALSE.} } \value{ A character vector of package names. } \description{ Get package dependencies } \details{ This function recursively constructs the list of dependencies for the packages given by \code{pkgs}. By default, the dependency information is extracted from both installed and available packages. As a consequence, it works both for local and CRAN packages. } \note{ If \code{available=TRUE} R will attempt to access the currently selected CRAN repository, prompting for one if necessary. } \examples{ \dontrun{ ## A locally installed package #' getDependencies("MASS", installed = TRUE, available = FALSE) ## A package on CRAN getDependencies("gregmisc", installed = FALSE, available = TRUE) ## Show base and recommended dependencies getDependencies("MASS", available = FALSE, base = TRUE, recommended = TRUE) ## Download the set of packages necessary to support a local package deps <- getDependencies("MyLocalPackage", available = FALSE) download.packages(deps, destdir = "./R_Packages") } } \seealso{ \code{\link{installed.packages}}, \code{\link{available.packages}} } \author{ Gregory R. Warnes \email{greg@warnes.net} based on the non exported \code{utils:::getDependencies} and \code{utils:::.clean_up_dependencies2}. } \keyword{utilities} gtools/man/loadedPackages.Rd0000644000176200001440000000211514261670123015513 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/loadedPackages.R \name{loadedPackages} \alias{loadedPackages} \title{Provide Name, Version, and Path of Loaded Package Namespaces} \usage{ loadedPackages(silent = FALSE) } \arguments{ \item{silent}{Logical indicating whether the results should be printed} } \value{ Invisibly returns a data frame containing one row per loaded package namespace, with columns: \item{Package}{Package name} \item{Version}{Version string} \item{Path}{Path to package files} \item{SearchPath}{Either the index of the package namespace in the current search path, or '-' if the package namespace is not in the search path. '1' corresponds to the top of the search path (the first namespace searched for values). } } \description{ Provide name, version, and path of loaded package namespaces } \examples{ loadedPackages() } \seealso{ \code{\link[base]{loadedNamespaces}}, \code{\link[utils]{packageVersion}}, \code{\link[base]{search}}, \code{\link[base]{find.package}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{package} gtools/man/lastAdd.Rd0000644000176200001440000000306014261670123014200 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lastAdd.R \name{lastAdd} \alias{lastAdd} \title{Non-destructively construct a .Last function to be executed when R exits.} \usage{ lastAdd(fun) } \arguments{ \item{fun}{Function to be called.} } \value{ A new function to be used for \code{.Last}. } \description{ Non-destructively construct a \code{.Last} function to be executed when R exits. } \details{ \code{lastAdd} constructs a new function which can be used to replace the existing definition of \code{.Last}, which will be executed when R terminates normally. If a \code{.Last} function already exists in the global environment, the original definition is stored in a private environment, and the new function is defined to call the function \code{fun} and then to call the previous (stored) definition of \code{.Last}. If no \code{.Last} function exists in the global environment, \code{lastAdd} simply returns the function \code{fun}. } \note{ This function replaces the (now defunct) \code{addLast} function. } \examples{ ## Print a couple of cute messages when R exits. helloWorld <- function() cat("\nHello World!\n") byeWorld <- function() cat("\nGoodbye World!\n") .Last <- lastAdd(byeWorld) .Last <- lastAdd(helloWorld) \dontshow{ .Last() } \dontrun{ q("no") ## Should yield: ## ## Save workspace image? [y/n/c]: n ## ## Hello World! ## ## Goodbye World! ## ## Process R finished at Tue Nov 22 10:28:55 2005 } } \seealso{ \code{\link[base]{.Last}} } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{programming} gtools/man/foldchange.Rd0000644000176200001440000000343614322256737014736 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/foldchange.R \name{foldchange} \alias{foldchange} \alias{logratio2foldchange} \alias{foldchange2logratio} \title{Compute fold-change or convert between log-ratio and fold-change.} \usage{ foldchange(num, denom) logratio2foldchange(logratio, base = 2) foldchange2logratio(foldchange, base = 2) } \arguments{ \item{num, denom}{vector/matrix of numeric values} \item{logratio}{vector/matrix of log-ratio values} \item{base}{Exponential base for the log-ratio.} \item{foldchange}{vector/matrix of fold-change values} } \value{ A vector or matrix of the same dimensions as the input containing the converted values. } \description{ \code{foldchange} computes the fold change for two sets of values. \code{logratio2foldchange} converts values from log-ratios to fold changes. \code{foldchange2logratio} does the reverse. } \details{ Fold changes are commonly used in the biological sciences as a mechanism for comparing the relative size of two measurements. They are computed as: \eqn{\frac{num}{denom}}{num/denom} if \eqn{num>denom}, and as \eqn{\frac{-denom}{num}}{-denom/num} otherwise. Fold-changes have the advantage of ease of interpretation and symmetry about \eqn{num=denom}, but suffer from a discontinuity between -1 and 1, which can cause significant problems when performing data analysis. Consequently statisticians prefer to use log-ratios. } \section{Functions}{ \itemize{ \item \code{foldchange()}: Compute fold-change. \item \code{logratio2foldchange()}: Compute foldchange from log-ratio values. \item \code{foldchange2logratio()}: Compute log-ratio from fold-change values. }} \examples{ a <- 1:21 b <- 21:1 f <- foldchange(a, b) cbind(a, b, f) } \author{ Gregory R. Warnes \email{greg@warnes.net} } \keyword{math} gtools/DESCRIPTION0000644000176200001440000000606314526673315013310 0ustar liggesusersPackage: gtools Title: Various R Programming Tools Description: Functions to assist in R programming, including: - assist in developing, updating, and maintaining R and R packages ('ask', 'checkRVersion', 'getDependencies', 'keywords', 'scat'), - calculate the logit and inverse logit transformations ('logit', 'inv.logit'), - test if a value is missing, empty or contains only NA and NULL values ('invalid'), - manipulate R's .Last function ('addLast'), - define macros ('defmacro'), - detect odd and even integers ('odd', 'even'), - convert strings containing non-ASCII characters (like single quotes) to plain ASCII ('ASCIIfy'), - perform a binary search ('binsearch'), - sort strings containing both numeric and character components ('mixedsort'), - create a factor variable from the quantiles of a continuous variable ('quantcut'), - enumerate permutations and combinations ('combinations', 'permutation'), - calculate and convert between fold-change and log-ratio ('foldchange', 'logratio2foldchange', 'foldchange2logratio'), - calculate probabilities and generate random numbers from Dirichlet distributions ('rdirichlet', 'ddirichlet'), - 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'), - convert characters to/from ASCII codes ('asc', 'chr'), - convert character vector to ASCII representation ('ASCIIfy'), - apply title capitalization rules to a character vector ('capwords'). Version: 3.9.5 Authors@R: c(person("Gregory R.", "Warnes", role = "aut"), person("Ben", "Bolker", role = c("aut", "cre"), email = "bolker@mcmaster.ca", comment=c(ORCID="0000-0002-2127-0443")), person("Thomas", "Lumley", role = "aut"), person("Arni", "Magnusson", role = "aut"), person("Bill", "Venables", role = "aut"), person("Genei", "Ryodan", role = "aut"), person("Steffen", "Moeller", role = "aut"), person("Ian", "Wilson", role = "ctb"), person("Mark", "Davis", role = "ctb"), person("Nitin", "Jain", role="ctb"), person("Scott", "Chamberlain", role = "ctb")) License: GPL-2 Depends: methods, stats, utils URL: https://github.com/r-gregmisc/gtools BugReports: https://github.com/r-gregmisc/gtools/issues Language: en-US Suggests: car, gplots, knitr, rstudioapi, SGP, taxize RoxygenNote: 7.2.3 Encoding: UTF-8 NeedsCompilation: yes Packaged: 2023-11-19 00:52:21 UTC; bolker Author: Gregory R. Warnes [aut], Ben Bolker [aut, cre] (), Thomas Lumley [aut], Arni Magnusson [aut], Bill Venables [aut], Genei Ryodan [aut], Steffen Moeller [aut], Ian Wilson [ctb], Mark Davis [ctb], Nitin Jain [ctb], Scott Chamberlain [ctb] Maintainer: Ben Bolker Repository: CRAN Date/Publication: 2023-11-20 15:10:05 UTC gtools/tests/0000755000176200001440000000000014526256036012734 5ustar liggesusersgtools/tests/smartbind_emptynames.R0000644000176200001440000000031514261670123017274 0ustar liggesuserslibrary(gtools) df1 <- data.frame(a = 1, b = 2, d = TRUE) df2 <- data.frame(b = 7, c = "YES", d = FALSE) df3 <- data.frame(b = 7, c = "YES") smartbind(df1, df2, df3) smartbind(df1 = df1, df2, df3 = df3) gtools/tests/test_setTCPNoDelay.R0000644000176200001440000000114514526256036016535 0ustar liggesuserslibrary("gtools") host <- "www.r-project.org" host_index <- sprintf("http://%s/index.html", host) ## check that network/CRAN are available rproj_OK <- try(scan(host_index, character(1), quiet = TRUE)) if (!inherits(rproj_OK, "try-error")) { socket <- make.socket(host, 80) print(socket) setTCPNoDelay(socket, TRUE) write.socket(socket, sprintf("GET %s\r\n", host_index)) write.socket(socket, "HOST 127.0.0.1\r\n") write.socket(socket, "\r\n") ## Read and display the response while ((str <- read.socket(socket)) > "") { cat(str) } close.socket(socket) } gtools/tests/smartbind_Dates.R0000644000176200001440000000043314261670123016153 0ustar liggesuserslibrary(gtools) today <- Sys.Date() tenweeks <- seq(today, length.out = 10, by = "1 week") df1 <- data.frame(dates = tenweeks, chars = letters[1:10], ints = 1:10, numeric = 1.1:10.1) df2 <- data.frame(chars = letters[11:20], ints = 11:20, numeric = 11.1:20.1) smartbind(df1, df2) gtools/tests/test_script_file.R0000644000176200001440000000054414261670123016415 0ustar liggesuserslibrary(gtools) # For debugging conveneince cmdArgs <- commandArgs(trailingOnly = FALSE) print(cmdArgs) file <- script_file("warning") cat("script_file:", file, "\n") stopifnot(endsWith(file, "test_script_file.R")) path <- script_path("warning") cat("script_path:", path, "\n") # stopifnot(endsWith(path, "tests")) # save.image("test_script_file.Rda") gtools/tests/test_mixedorder.R0000644000176200001440000000167014261670123016255 0ustar liggesuserslibrary(gtools) Sys.setlocale(category = "LC_ALL", locale = "C") ## Examples from man page Treatment <- c( "Control", "Asprin 10mg/day", "Asprin 50mg/day", "Asprin 100mg/day", "Acetomycin 100mg/day", "Acetomycin 1000mg/day" ) stopifnot(mixedorder(Treatment) == c(5, 6, 2, 3, 4, 1)) 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" )) stopifnot(mixedorder(x) == c(7, 11, 4, 5, 3, 8, 2, 1, 6, 12, 18, 17, 16, 13, 15, 14, 10, 9)) ## Bug reported by Aaron Taudt on 2014-03-01 tmp <- c( "uniresult_simulated_H3k27ac_binsize_200_chr1.RData", "uniresult_simulated_H3k27me3_binsize_200_chr1.RData", "uniresult_simulated_H3k36me3_binsize_200_chr1.RData", "uniresult_simulated_H3k4me3_binsize_200_chr1.RData", "uniresult_simulated_H3k9me3_binsize_200_chr1.RData" ) stopifnot(mixedorder(tmp) == c(4, 5, 1, 2, 3)) gtools/tests/test_binsearch.R0000644000176200001440000000306314261670123016047 0ustar liggesuserslibrary(gtools) ############################## ### Examples from man page ### ############################## ### Toy examples # search for x=10 s <- binsearch(function(x) x - 10, range = c(0, 20)) stopifnot(s$where == 10) # search for x=10.1 s <- binsearch(function(x) x - 10.1, range = c(0, 20)) stopifnot(s$where == c(10, 11)) ### Classical toy example # binary search for the index of 'M' among the sorted letters fun <- function(X) { ifelse(LETTERS[X] > "M", 1, ifelse(LETTERS[X] < "M", -1, 0) ) } s <- binsearch(fun, range = 1:26) stopifnot(LETTERS[s$where] == "M") ################################## ### Test boundary contiditions ### ################################## s <- binsearch(fun = function(x) x - 10, range = c(1, 10)) with(s, stopifnot(where == 10, value == 0, flag == "Found")) s <- binsearch(fun = function(x) x - 1, range = c(1, 10)) with(s, stopifnot(where == 1, value == 0, flag == "Found")) checkWarning <- function(expr) { myEnv <- environment() catchWarning <- function(w) { assign("warningValue", w, pos = myEnv) invokeRestart("muffleWarning") } retval <- withCallingHandlers( expr = expr, warning = catchWarning ) if (!exists("warningValue", where = myEnv, inherits = FALSE)) { stop("Expected a warning message") } } checkWarning(s <- binsearch(fun = function(x) x - 10, range = c(1, 9))) with(s, stopifnot(where == 9, value == -1, flag == "Upper Boundary")) checkWarning(s <- binsearch(fun = function(x) x - 1, range = c(2, 10))) with(s, stopifnot(where == 2, value == 1, flag == "Lower Boundary")) gtools/tests/test_ddirichlet.R0000644000176200001440000000064214261670123016224 0ustar liggesusers## Regression test for bug reported by John Nolan: ## ## Whenever the pair (x[i], a[i]) == (0,1), NA would be returned, due ## to an internal computation of ( 0 * -Inf ) => NaN ## ## The code now checks for this particular issue and sets the value of ## ( 0 * -Inf ) to 0, which is correct for this calculation. ## library(gtools) x <- c(0, 0, 1) alpha <- c(1, 2, 3) stopifnot(ddirichlet(x = x, alpha = alpha) == 0) gtools/src/0000755000176200001440000000000014526256101012352 5ustar liggesusersgtools/src/gtools.h0000644000176200001440000000245114261670123014034 0ustar liggesusers#include #include #include extern void C_checkStatus( int status, char* status_str, int status_len ); extern void C_setTCPNoDelay( int *socket, int* flag, int* status, char** status_str, int* status_len ); extern void C_convert( char** letters, int* nchar, int* values ); extern void C_roman2int( char** str, int* nchar, int* retval ); static R_NativePrimitiveArgType C_convert_t[] = { STRSXP, // letters INTSXP, // nchar INTSXP // values }; static R_NativePrimitiveArgType C_roman2int_t[] = { STRSXP, // str INTSXP, // nchar INTSXP // retval }; static R_NativePrimitiveArgType C_checkStatus_t[] = { INTSXP, // status STRSXP, // status_str INTSXP // status_len }; static R_NativePrimitiveArgType C_setTCPNoDelay_t[] = { INTSXP, // socket INTSXP, // flag INTSXP, // status STRSXP, // status_str INTSXP // status_len }; static const R_CMethodDef cMethods[] = { {"C_convert", (DL_FUNC) &C_convert, 3, C_convert_t }, {"C_roman2int", (DL_FUNC) &C_roman2int, 3, C_roman2int_t }, {"C_checkStatus", (DL_FUNC) &C_checkStatus, 3, C_checkStatus_t }, {"C_setTCPNoDelay", (DL_FUNC) &C_setTCPNoDelay, 5, C_setTCPNoDelay_t}, {NULL, NULL, 0, NULL} }; gtools/src/roman2int.c0000644000176200001440000000207514261670123014433 0ustar liggesusers#include void C_convert( char** letters, int* nchar, int* values ) { if(*nchar<1) return; for(int i=0; i<*nchar; i++) { if(letters[0][i]== 'I') values[i]=1; else if(letters[0][i]== 'V') values[i]=5; else if(letters[0][i]== 'X') values[i]=10; else if(letters[0][i]== 'L') values[i]=50; else if(letters[0][i]== 'C') values[i]=100; else if(letters[0][i]== 'D') values[i]=500; else if(letters[0][i]== 'M') values[i]=1000; else error("Invalid roman numeral '%c'", letters[0][i]); } } void C_roman2int(char** str, int* nchar, int* retval) { if (*nchar < 1) { *retval = NA_INTEGER; return; } int* values = (int*) R_alloc(*nchar, sizeof(int)); C_convert(str, nchar, values); int total=0; if (*nchar > 1) { for(int n=0; n<*nchar-1; n++) { if(values[n] #include # include #ifdef WIN32 # include /*#include */ #else # include # include #endif #include #define TCP_NODELAY 1 /* Macro to: 1: Check if the constant is defined. If not, omit. 2: Generate a case statement for the constant, which creates a string error description constructed from the constant name and the supplied error message. */ #define CASE_ERR(ERRNO, DESCR) #ifdef ERRNO case ERRNO strncpy( status_str, ERRNO ":" DESCR, status_len); break; #endif /* Convert integer status into a string error code */ void C_checkStatus( int status, char* status_str, int status_len) { status_len = status_len>1000?1000:status_len; switch(status) { /* Unix messages */ CASE_ERR(EBADF, "Invalid descriptor."); CASE_ERR(ENOTSOCK, "Descriptor is a file, not a socket."); CASE_ERR(ENOPROTOOPT, "The option is unknown at the level indicated."); CASE_ERR(EFAULT, "invalid pointer"); CASE_ERR(EINVAL, "optlen invalid in setsockopt"); /* Windows messages */ CASE_ERR(WSANOTINITIALISED, "A successful WSAStartup call must occur before using this function."); CASE_ERR(WSAENETDOWN, "The network subsystem has failed."); CASE_ERR(WSAEFAULT, "optval is not in a valid part of the process address space or optlen parameter is too small."); CASE_ERR(WSAEINPROGRESS, "A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function."); CASE_ERR(WSAEINVAL, "level is not valid, or the information in optval is not valid."); CASE_ERR(WSAENETRESET, "onnection has timed out when SO_KEEPALIVE is set."); CASE_ERR(WSAENOPROTOOPT, "he option is unknown or unsupported for the specified provider or socket (see SO_GROUP_PRIORITY limitations)."); CASE_ERR(WSAENOTCONN, "Connection has been reset when SO_KEEPALIVE is set."); CASE_ERR(WSAENOTSOCK, "The descriptor is not a socket."); case 0: strncpy( status_str, "SUCCESS", status_len); break; default: strncpy(status_str, strerror(status), status_len); break; } status_str[status_len-1] = 0x0; /* Just in case... */ } /* Function to de-nagle a TCP socket connection */ void C_setTCPNoDelay( int *socket, int* flag, int* status, char** status_str, int* status_len) { int off; /* ensure that we use only 0,1 values */ off = (*flag) ? 1 : 0; *status = setsockopt( *socket, IPPROTO_TCP, TCP_NODELAY, (char * )&off, sizeof ( off ) ); C_checkStatus(errno, status_str[0], *status_len); return; } /* function to check socket options */ /* NOT USED... void C_getsockopt(int *s, int *level, int *optname, int *optval, int *optlen, int *status, char *status_str, int *status_len) { *status = getsockopt(*s, *level, *optname, optval, optlen); C_checkStatus(*status, status_str, *status_len); } */ /* function to set socket options */ /* NOT USED ... void C_setsockopt(int *s, int *level, int *optname, int *optval, int *optlen, int *status, char *status_str, int *status_len) { *status = setsockopt(*s, *level, *optname, optval, *optlen); C_checkStatus(*status, status_str, *status_len); } */ gtools/src/Makevars.win0000644000176200001440000000002414261670123014636 0ustar liggesusersPKG_LIBS = -lws2_32 gtools/R/0000755000176200001440000000000014526256102011765 5ustar liggesusersgtools/R/setTCPNoDelay.R0000644000176200001440000000465114261670123014533 0ustar liggesusers#' Modify the TCP_NODELAY (`de-Nagle') flag for socket objects #' #' Modify the TCP_NODELAY (`de-Nagle') flag for socket objects #' #' By default, TCP connections wait a small fixed interval before actually #' sending data, in order to permit small packets to be combined. This #' algorithm is named after its inventor, John Nagle, and is often referred to #' as 'Nagling'. #' #' While this reduces network resource utilization in these situations, it #' imposes a delay on all outgoing message data, which can cause problems in #' client/server situations. #' #' This function allows this feature to be disabled (de-Nagling, #' \code{value=TRUE}) or enabled (Nagling, \code{value=FALSE}) for the #' specified socket. #' #' @param socket A socket connection object #' @param value Logical indicating whether to set (\code{TRUE}) or unset #' (\code{FALSE}) the flag #' #' @return The character string "SUCCESS" will be returned invisible if the #' operation was successful. On failure, an error will be generated. #' #' @author Gregory R. Warnes \email{greg@@warnes.net} #' #' @seealso \code{\link{make.socket}}, \code{\link{socketConnection}} #' #' @references #' "Nagle's algorithm" \url{https://en.wikipedia.org/wiki/Nagle's_algorithm}, #' #' Nagle, John. "Congestion Control in IP/TCP Internetworks", IETF Request for #' Comments 896, January 1984. \url{https://www.ietf.org/rfc/rfc0896.txt?number=896} #' #' @keywords programming misc utilities #' @examples #' \dontrun{ #' host <- "www.r-project.org" #' socket <- make.socket(host, 80) #' print(socket) #' setTCPNoDelay(socket, TRUE) #' #' write.socket(socket, "GET /\n\n") #' write.socket(socket, "A") #' write.socket(socket, "B\n") #' while ((str <- read.socket(socket)) > "") { #' cat(str) #' } #' close.socket(socket) #' } #' #' @export setTCPNoDelay <- function(socket, value = TRUE) { if (!any(c("socket", "sockconn") %in% class(socket))) { stop("socket must be a socket object") } buffer <- paste(rep(" ", 1000), sep = "", collapse = "") if ("sockconn" %in% class(socket)) { conn <- getConnection(socket[1]) } else { conn <- socket } retval <- .C(C_setTCPNoDelay, socket = as.integer(socket[1]), flag = as.integer(value), status = integer(1), status.str = as.character(buffer), status.len = as.integer(nchar(buffer)), PACKAGE = "gtools" ) if (retval$status != 0) { stop(retval$status.str) } else { invisible(retval$status.str) } } gtools/R/melt_array.R0000644000176200001440000000137714437664726014277 0ustar liggesusers## https://stackoverflow.com/questions/73491296/is-there-an-alternative-to-reshape2melt-for-multidimensional-arrays-in-base-r/76388312?noredirect=1#comment134733759_76388312 #' @param x a multidimensional array #' @examples #' a <- array(1:27, dim = c(3,3,3), #' dimnames = list(dim1 = letters[1:3], dim2 = LETTERS[1:3], #' dim3 = c("i", "ii", "iii"))) #' melt_array(a) melt_array <- function(x) { data.frame(arrayInd(seq_along(x), dim(x)), value = as.vector(x)) ## list2DF(lapply(as.data.frame.table(x), unclass)) ## list2DF(c(Map( ## \(i, j, n) rep(rep(1:i, each = j), length.out = n), ## dim(x), ## c(1, cumprod(dim(x)[-length(dim(x))])), ## length(x) ## ), Value = list(as.vector(x)))) } gtools/R/na.replace.R0000644000176200001440000000166514261670123014127 0ustar liggesusers#' Replace Missing Values #' #' Replace missing values #' #' This is a convenience function that is the same as x[is.na(x)] <- replace #' #' @param x vector possibly containing missing (\code{NA}) values #' @param replace either a scalar replacement value, or a function returning a #' scalar value #' @param ... Optional arguments to be passed to \code{replace} #' @return Vector with missing values (\code{NA}) replaced by the value of #' \code{replace}. #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link[base]{is.na}}, \code{\link[stats]{na.omit}} #' @keywords manip #' @examples #' #' x <- c(1, 2, 3, NA, 6, 7, 8, NA, NA) #' #' # Replace with a specified value #' na.replace(x, "999") #' #' # Replace with the calculated median #' na.replace(x, median, na.rm = TRUE) #' @export na.replace <- function(x, replace, ...) { if (is.function(replace)) { replace <- replace(x, ...) } x[is.na(x)] <- replace x } gtools/R/checkRVersion.R0000644000176200001440000000413114526256036014662 0ustar liggesusers#' Check if a newer version of R is available #' #' Check if a newer version of R is available #' #' This function accesses the R web site to discover the latest released #' version of R. It then compares this version to the running version. If the #' running version is the same as the latest version, it prints the message, #' "The latest version of R is installed:" followed by the version number, and #' returns NULL. If the running version is older than the current version, it #' displays the message, "A newer version of R is now available:" followed by #' the corresponding version number, and returns the version number. #' #' If \code{quiet=TRUE}, no printing is performed. #' #' @param quiet Logical indicating whether printed output should be suppressed. #' @return Either the version number of the latest version of R, if the running #' version is less than the latest version, or NULL. #' @note This function uses the internet to access the R project web site. #' If internet access is unavailable or the R project web site is down, the function will fail. #' @author Gregory R. Warnes #' @seealso \code{\link[base]{R.Version}} #' @keywords utilities #' @examples #' #' try( #' ver <- checkRVersion() #' ) #' print(ver) #' @export checkRVersion <- function(quiet = FALSE) { cran_page <- tryCatch( suppressWarnings(scan( file = "https://cran.r-project.org/src/base/R-4", what = "", quiet = TRUE)), error = function(cond) { stop("Your internet connection is not working (or CRAN is down)") } ) matches <- grep("R-[0-9]\\.[0-9]+\\.[0-9]+", cran_page, value = TRUE) versionList <- gsub("^.*R-([0-9].[0-9]+.[0-9]+).*$", "\\1", matches) versionList <- numeric_version(versionList) if (max(versionList) > getRversion()) { if (!quiet) { cat("A newer version of R is now available: ") cat(as.character(max(versionList))) cat("\n") } invisible(max(versionList)) } else { if (!quiet) { cat("The latest version of R is installed: ") cat(as.character(max(versionList))) cat("\n") } invisible(NULL) } } gtools/R/lastAdd.R0000644000176200001440000000350114437664036013475 0ustar liggesusers#' Non-destructively construct a .Last function to be executed when R exits. #' #' Non-destructively construct a \code{.Last} function to be executed when R #' exits. #' #' \code{lastAdd} constructs a new function which can be used to replace the #' existing definition of \code{.Last}, which will be executed when R terminates #' normally. #' #' If a \code{.Last} function already exists in the global environment, the #' original definition is stored in a private environment, and the new function #' is defined to call the function \code{fun} and then to call the previous #' (stored) definition of \code{.Last}. #' #' If no \code{.Last} function exists in the global environment, \code{lastAdd} #' simply returns the function \code{fun}. #' #' @param fun Function to be called. #' @return A new function to be used for \code{.Last}. #' @note This function replaces the (now defunct) \code{addLast} function. #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link[base]{.Last}} #' @keywords programming #' @examples #' #' #' ## Print a couple of cute messages when R exits. #' helloWorld <- function() cat("\nHello World!\n") #' byeWorld <- function() cat("\nGoodbye World!\n") #' #' .Last <- lastAdd(byeWorld) #' .Last <- lastAdd(helloWorld) #' \dontshow{ #' .Last() #' } #' \dontrun{ #' q("no") #' #' ## Should yield: #' ## #' ## Save workspace image? [y/n/c]: n #' ## #' ## Hello World! #' ## #' ## Goodbye World! #' ## #' ## Process R finished at Tue Nov 22 10:28:55 2005 #' } #' #' @export lastAdd <- function(fun) { if (!is.function(fun)) stop("fun must be a function") if (!exists(".Last", envir = .GlobalEnv, mode = "function")) { return(fun) } else { Last <- get(".Last", envir = .GlobalEnv, mode = "function") newfun <- function(...) { fun() Last() } return(newfun) } } gtools/R/logit.R0000644000176200001440000000251414261670123013227 0ustar liggesusers#' Generalized logit and inverse logit function #' #' Compute generalized logit and generalized inverse logit functions. #' #' #' The generalized logit function takes values on [min, max] and transforms #' them to span [-Inf,Inf] it is defined as: #' #' \deqn{y = log(\frac{p}{(1-p)})}{y = log(p/(1-p))} #' #' where #' #' \deqn{p=\frac{(x-min)}{(max-min)}}{p=(x-min)/(max-min)} #' #' The generalized inverse logit function provides the inverse transformation: #' #' \deqn{x = p' (max-min) + min}{x = p * (max-min) + min} #' #' where #' #' \deqn{p'=\frac{exp(y)}{(1+exp(y))}}{exp(y)/(1+exp(y))} #' #' @aliases logit inv.logit #' @param x value(s) to be transformed #' @param min Lower end of logit interval #' @param max Upper end of logit interval #' @return Transformed value(s). #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link[car]{logit}} #' @keywords math #' @examples #' #' #' x <- seq(0, 10, by = 0.25) #' xt <- logit(x, min = 0, max = 10) #' cbind(x, xt) #' #' y <- inv.logit(xt, min = 0, max = 10) #' cbind(x, xt, y) #' @export logit <- function(x, min = 0, max = 1) { p <- (x - min) / (max - min) log(p / (1 - p)) } #' @rdname logit #' @export inv.logit <- function(x, min = 0, max = 1) { p <- exp(x) / (1 + exp(x)) p <- ifelse(is.na(p) & !is.na(x), 1, p) # fix problems with +Inf p * (max - min) + min } gtools/R/defmacro.R0000644000176200001440000001257314261670123013677 0ustar liggesusers#' Define a macro #' #' \code{defmacro} define a macro that uses R expression replacement #' #' \code{strmacro} define a macro that uses string replacement #' #' #' \code{defmacro} and \code{strmacro} create a macro from the expression given #' in \code{expr}, with formal arguments given by the other elements of the #' argument list. #' #' A macro is similar to a function definition except for handling of formal #' arguments. In a function, formal arguments are simply variables that #' contains the result of evaluating the expressions provided to the function #' call. In contrast, macros actually modify the macro body by #' \emph{replacing} each formal argument by the expression (\code{defmacro}) or #' string (\code{strmacro}) provided to the macro call. #' #' For \code{defmacro}, the special argument name \code{DOTS} will be replaced #' by \code{...} in the formal argument list of the macro so that \code{...} in #' the body of the expression can be used to obtain any additional arguments #' passed to the macro. For \code{strmacro} you can mimic this behavior #' providing a \code{DOTS=""} argument. This is illustrated by the last #' example below. #' #' Macros are often useful for creating new functions during code execution. #' #' @aliases defmacro strmacro #' @param \dots macro argument list #' @param expr R expression defining the macro body #' @param strexpr character string defining the macro body #' @return A macro function. #' #' @note Note that because [the defmacro code] works on the parsed expression, #' not on a text string, defmacro avoids some of the problems of traditional #' string substitution macros such as \code{strmacro} and the C preprocessor #' macros. For example, in \preformatted{ mul <- defmacro(a, b, expr={a*b}) } a #' C programmer might expect \code{mul(i, j + k)} to expand (incorrectly) to #' \code{i*j + k}. In fact it expands correctly, to the equivalent of #' \code{i*(j + k)}. #' #' For a discussion of the differences between functions and macros, please #' Thomas Lumley's R-News article (reference below). #' @author Thomas Lumley wrote \code{defmacro}. Gregory R. Warnes #' \email{greg@@warnes.net} enhanced it and created \code{strmacro}. #' @seealso \code{\link[base]{function}} \code{\link[base]{substitute}}, #' \code{\link[base]{eval}}, \code{\link[base]{parse}}, #' \code{\link[base]{source}}, \code{\link[base]{parse}}, #' @references The original \code{defmacro} code was directly taken from: #' #' Lumley T. "Programmer's Niche: Macros in R", R News, 2001, Vol 1, No. 3, pp #' 11--13, \url{https://cran.r-project.org/doc/Rnews/} #' @keywords programming #' ## Code from #' @examples #' #' #### #' # macro for replacing a specified missing value indicator with NA #' # within a dataframe #' ### #' setNA <- defmacro(df, var, values, #' expr = { #' df$var[df$var %in% values] <- NA #' } #' ) #' #' # create example data using 999 as a missing value indicator #' d <- data.frame( #' Grp = c("Trt", "Ctl", "Ctl", "Trt", "Ctl", "Ctl", "Trt", "Ctl", "Trt", "Ctl"), #' V1 = c(1, 2, 3, 4, 5, 6, 999, 8, 9, 10), #' V2 = c(1, 1, 1, 1, 1, 2, 999, 2, 999, 999), #' stringsAsFactors = TRUE #' ) #' d #' #' # Try it out #' setNA(d, V1, 999) #' setNA(d, V2, 999) #' d #' #' #' ### #' # Expression macro #' ### #' plot.d <- defmacro(df, var, DOTS, #' col = "red", title = "", expr = #' plot(df$var ~ df$Grp, type = "b", col = col, main = title, ...) #' ) #' #' plot.d(d, V1) #' plot.d(d, V1, col = "blue") #' plot.d(d, V1, lwd = 4) # use optional 'DOTS' argument #' #' ### #' # String macro (note the quoted text in the calls below) #' # #' # This style of macro can be useful when you are reading #' # function arguments from a text file #' ### #' plot.s <- strmacro(DF, VAR, #' COL = "'red'", TITLE = "''", DOTS = "", expr = #' plot(DF$VAR ~ DF$Grp, type = "b", col = COL, main = TITLE, DOTS) #' ) #' #' plot.s("d", "V1") #' plot.s(DF = "d", VAR = "V1", COL = '"blue"') #' plot.s("d", "V1", DOTS = "lwd=4") # use optional 'DOTS' argument #' #' #' #' ####### #' # Create a macro that defines new functions #' ###### #' plot.sf <- defmacro( #' type = "b", col = "black", #' title = deparse(substitute(x)), DOTS, expr = #' function(x, y) plot(x, y, type = type, col = col, main = title, ...) #' ) #' #' plot.red <- plot.sf(col = "red", title = "Red is more Fun!") #' plot.blue <- plot.sf(col = "blue", title = "Blue is Best!", lty = 2) #' #' plot.red(1:100, rnorm(100)) #' plot.blue(1:100, rnorm(100)) #' @export defmacro <- function(..., expr) # , DOTS=FALSE) { expr <- substitute(expr) a <- substitute(list(...))[-1] ## process the argument list nn <- names(a) if (is.null(nn)) { nn <- rep("", length(a)) } for (i in 1:length(a)) { if (nn[i] == "") { nn[i] <- paste(a[[i]]) msg <- paste(a[[i]], "not supplied") a[[i]] <- substitute( stop(foo), list(foo = msg) ) } if (nn[i] == "DOTS") { nn[i] <- "..." a[[i]] <- formals(function(...) {})[[1]] } } names(a) <- nn a <- as.list(a) ## this is where the work is done ff <- eval(substitute( function() { tmp <- substitute(body) eval(tmp, parent.frame()) }, list(body = expr) )) ## add the argument list formals(ff) <- a ## create a fake source attribute mm <- match.call() mm$expr <- NULL mm[[1]] <- as.name("macro") attr(ff, "source") <- c( deparse(mm), deparse(expr) ) ## return the 'macro' ff } gtools/R/ASCIIfy.R0000644000176200001440000000541714437664036013320 0ustar liggesusers#' Convert Characters to ASCII #' #' Convert character vector to ASCII, replacing non-ASCII characters with #' single-byte (\samp{\x00}) or two-byte (\samp{\u0000}) codes. #' #' @param x a character vector, possibly containing non-ASCII characters. #' @param bytes either \code{1} or \code{2}, for single-byte (\samp{\x00}) or #' two-byte (\samp{\u0000}) codes. #' @param fallback an output character to use, when input characters cannot be #' converted. #' #' @return #' A character vector like \code{x}, except non-ASCII characters have been #' replaced with \samp{\x00} or \samp{\u0000} codes. #' #' @note #' To render single backslashes, use these or similar techniques: \preformatted{ #' write(ASCIIfy(x), "file.txt") #' cat(paste(ASCIIfy(x), collapse="\n"), "\n", sep="")} #' #' The resulting strings are plain ASCII and can be used in R functions and #' datasets to improve package portability. #' #' @author Arni Magnusson. #' #' @seealso #' \code{\link[tools]{showNonASCII}} identifies non-ASCII characters in a #' character vector. #' #' @keywords utilites character #' #' @examples #' cities <- c("S\u00e3o Paulo", "Reykjav\u00edk") #' print(cities) #' ASCIIfy(cities, 1) #' ASCIIfy(cities, 2) #' #' athens <- "\u0391\u03b8\u03ae\u03bd\u03b1" #' print(athens) #' ASCIIfy(athens) #' #' @export ASCIIfy <- function(x, bytes = 2, fallback = "?") { bytes <- match.arg(as.character(bytes), 1:2) convert <- function(char) # convert to ASCII, e.g. "z", "\xfe", or "\u00fe" { raw <- charToRaw(char) if (length(raw) == 1 && raw <= 127) { # 7-bit ascii <- char } else if (length(raw) == 1 && bytes == 1) { # 8-bit to \x00 ascii <- paste0("\\x", raw) } else if (length(raw) == 1 && bytes == 2) { # 8-bit to \u0000 ascii <- paste0("\\u", chartr(" ", "0", formatC(as.character(raw), width = 4))) } else if (length(raw) == 2 && bytes == 1) { # 16-bit to \x00, if possible if (utf8ToInt(char) <= 255) { ascii <- paste0("\\x", format.hexmode(utf8ToInt(char))) } else { ascii <- fallback warning(char, " could not be converted to 1 byte") } } else if (length(raw) == 2 && bytes == 2) { # UTF-8 to \u0000 ascii <- paste0("\\u", format.hexmode(utf8ToInt(char), width = 4)) } else { ascii <- fallback warning(char, " could not be converted to ", bytes, " byte") } return(ascii) } if (length(x) > 1) { sapply(x, ASCIIfy, bytes = bytes, fallback = fallback, USE.NAMES = FALSE) } else { input <- unlist(strsplit(x, "")) # "c" "a" "f" "<\'e>" output <- character(length(input)) # "" "" "" "" for (i in seq_along(input)) { output[i] <- convert(input[i]) } # "c" "a" "f" "\\u00e9" output <- paste(output, collapse = "") # "caf\\u00e9" return(output) } } gtools/R/unByteCode.R0000644000176200001440000000664014262130163014152 0ustar liggesusers#' Convert a byte-code function to an interpreted-code function #' #' The purpose of these functions is to allow a byte coded function to be #' converted back into a fully interpreted function as a \emph{temporary} work #' around for issues in byte-code interpretation. #' #' \code{unByteCode} returns a copy of the function that is directly #' interpreted from text rather than from byte-code. #' #' \code{assignEdgewise} makes an assignment into a locked environment. #' #' \code{unByteCodeAssign} changes the specified function \emph{in its source #' environment} to be directly interpreted from text rather than from #' byte-code. #' #' The latter two functions no longer work out of the box because \code{assignEdgewise} #' (which \code{unByteCodeAssign} uses) makes use of an unsafe \code{unlockBinding} #' call, but running \code{assignEdgewise()} will #' #' @aliases unByteCode unByteCodeAssign assignEdgewise #' @param fun function to be modified #' @param name object name #' @param env namespace #' @param value new function body #' @return All three functions return a copy of the modified function or #' assigned value. #' @note These functions are not intended as a permanent solution to issues #' with byte-code compilation or interpretation. Any such issues should be #' promptly reported to the R maintainers via the R Bug Tracking System at #' \url{https://bugs.r-project.org} and via the R-devel mailing list #' \url{https://stat.ethz.ch/mailman/listinfo/r-devel}. #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link[compiler]{disassemble}}, \code{\link{assign}} #' @references These functions were inspired as a work-around to R bug #' \url{https://bugs.r-project.org/show_bug.cgi?id=15215}. #' @keywords programming utilites #' @examples #' #' data(badDend) #' dist2 <- function(x) as.dist(1 - cor(t(x), method = "pearson")) #' hclust1 <- function(x) hclust(x, method = "single") #' #' distance <- dist2(badDend) #' cluster <- hclust1(distance) #' #' dend <- as.dendrogram(cluster) #' \dontrun{ #' ## 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 #' } #' #' ## convert stats:::plotNode from byte-code to interpreted-code #' ## (no longer available unless assignEdgewise is defined by the user) #' ## unByteCodeAssign(stats:::plotNode) #' ## illustrated in https://stackoverflow.com/questions/16559250/error-in-heatmap-2-gplots #' #' # increase recursion limit #' options("expressions" = 5e4) #' #' # now the function does not crash #' plot(dend) #' @export unByteCode <- function(fun) { FUN <- eval(parse(text = deparse(fun))) environment(FUN) <- environment(fun) FUN } #' @rdname unByteCode #' @export assignEdgewise <- function(name, env, value) { stop("assignEdgewise no longer works due to unsafe use of ", sQuote("unlockBinding"), ". You can define this function yourself: ", "\n\nassignEdgewise <- function(name, env, value) {", "\n unlockBinding(name, env = env)", "\n assign(name, envir = env, value = value)", "\n lockBinding(name, env = env)", "\n invisible(value)", "\n}") } #' @rdname unByteCode #' @export unByteCodeAssign <- function(fun) { name <- gsub("^.*::+", "", deparse(substitute(fun))) FUN <- unByteCode(fun) retval <- assignEdgewise( name = name, env = environment(FUN), value = FUN ) invisible(retval) } gtools/R/ELISA.R0000644000176200001440000000142314261670123012744 0ustar liggesusers#' Data from an ELISA assay #' #' Observed signals and (for some observations) nominal concentrations for #' samples that were aliquoted to multiple assay plates, which were read #' multiple times on multiple days. #' #' #' @name ELISA #' @docType data #' @format a data frame with the following columns: #' \itemize{ #' \item PlateDay factor. Specifies one of four physically distinct 96 well plates #' \item Read factor. The signal was read 3 times for each plate. #' \item Description character. Indicates contents of sample. #' \item Concentration numeric. Nominal concentration of standards (NA for all other samples). #' \item Signal numeric. Assay signal. Specifically, optical density (a colorimetric assay). #' } #' @source Anonymized data. #' @keywords datasets NULL gtools/R/clean_up_dependencies2.R0000644000176200001440000000507014261670123016467 0ustar liggesusers.clean_up_dependencies2 <- function(x, installed, available) { .split_op_version <- function(x) { pat <- "^([^\\([:space:]]+)[[:space:]]*\\(([^\\)]+)\\).*" x1 <- sub(pat, "\\1", x) x2 <- sub(pat, "\\2", x) if (x2 != x1) { pat <- "[[:space:]]*([[<>=!]+)[[:space:]]+(.*)" version <- sub(pat, "\\2", x2) if (!grepl("^r", version)) { version <- package_version(version) } list(name = x1, op = sub(pat, "\\1", x2), version = version) } else { list(name = x1) } } .split_dependencies <- function(x) { .split2 <- function(x) { x <- sub("[[:space:]]+$", "", x) x <- unique(sub("^[[:space:]]*(.*)", "\\1", x)) names(x) <- sub("^([[:alnum:].]+).*$", "\\1", x) x <- x[names(x) != "R"] x <- x[nzchar(x)] x <- x[!duplicated(names(x))] lapply(x, .split_op_version) } if (!any(nzchar(x))) { return(list()) } unlist(lapply(strsplit(x, ","), .split2), FALSE, FALSE) } x <- x[!is.na(x)] if (!length(x)) { return(list(character(), character())) } xx <- .split_dependencies(x) if (!length(xx)) { return(list(character(), character())) } pkgs <- installed[, "Package"] have <- sapply(xx, function(x) { if (length(x) == 3L) { if (!x[[1L]] %in% pkgs) { return(FALSE) } if (x[[2L]] != ">=") { return(TRUE) } current <- as.package_version(installed[ pkgs == x[[1L]], "Version" ]) target <- as.package_version(x[[3L]]) eval(parse(text = paste("any(current", x$op, "target)"))) } else { x[[1L]] %in% pkgs } }) xx <- xx[!have] if (!length(xx)) { return(list(character(), character())) } pkgs <- row.names(available) canget <- miss <- character() for (i in seq_along(xx)) { x <- xx[[i]] if (length(x) == 3L) { if (!x[[1L]] %in% pkgs) { miss <- c(miss, x[[1L]]) next } if (x[[2L]] != ">=") { canget <- c(canget, x[[1L]]) next } current <- as.package_version(available[ pkgs == x[[1L]], "Version" ]) target <- as.package_version(x[[3L]]) res <- eval(parse(text = paste( "any(current", x$op, "target)" ))) if (res) { canget <- c(canget, x[[1L]]) } else { miss <- c(miss, paste0( x[[1L]], " (>= ", x[[3L]], ")" )) } } else if (x[[1L]] %in% pkgs) { canget <- c(canget, x[[1L]]) } else { miss <- c(miss, x[[1L]]) } } list(canget, miss) } gtools/R/asc.R0000644000176200001440000000415314437664036012673 0ustar liggesusers#' Convert between characters and ASCII codes #' #' @aliases asc chr #' @param char vector of character strings #' @param simplify logical indicating whether to attempt to convert the result #' into a vector or matrix object. See \code{\link[base]{sapply}} for details. #' @param ascii vector or list of vectors containing integer ASCII codes #' @return \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 containing 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@@warnes.net} from code #' posted by Mark Davis on the 'Data Debrief' blog on 2011-03-09 at #' \url{https://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}} #' @keywords character programming #' @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) #' @name asc NULL #' @describeIn asc return the characters corresponding to the specified ASCII codes #' @export asc <- function(char, simplify = TRUE) { sapply(char, function(x) strtoi(charToRaw(x), 16L), simplify = simplify) } #' @describeIn asc return the ASCII codes for the specified characters. #' @export chr <- function(ascii) sapply(ascii, function(x) rawToChar(as.raw(x))) gtools/R/keywords.R0000644000176200001440000000306514262132404013756 0ustar liggesusers#' List valid keywords for R man pages #' #' List valid keywords for R man pages #' #' If \code{topic} is provided, return a list of the keywords associated with #' \code{topic}. Otherwise, display the list of valid R keywords from the R #' doc/KEYWORDS file. #' #' @param topic object or man page topic #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link[utils]{help}} #' @keywords documentation #' @examples #' #' ## Show all valid R keywords #' \dontrun{ #' keywords() #' #' ## Show keywords associated with the 'merge' function #' keywords(merge) #' keywords("merge") #' } #' @importFrom stats na.omit #' @importFrom utils help.search #' @export keywords <- function(topic) { file <- file.path(R.home("doc"), "KEYWORDS") if (missing(topic)) { file.show(file) } else { kw <- scan(file = file, what = character(), sep = "\n", quiet = TRUE) kw <- grep("&", kw, value = TRUE) kw <- gsub("&[^&]*$", "", kw) kw <- gsub("&+", " ", kw) kw <- na.omit(trimws(kw)) ischar <- tryCatch(is.character(topic) && length(topic) == 1L, error = identity) if (inherits(ischar, "error")) { ischar <- FALSE } if (!ischar) { topic <- deparse(substitute(topic)) } item <- paste("^", topic, "$", sep = "") topics <- function(k) { matches <- help.search(keyword = k)$matches matches[, match("topic", tolower(colnames(matches)))] } matches <- lapply(kw, topics) names(matches) <- kw tmp <- unlist(lapply(matches, function(m) grep(item, m, value = TRUE))) names(tmp) } } gtools/R/ask.R0000644000176200001440000000214414261670123012666 0ustar liggesusers#' Display a prompt and collect the user's response #' #' Display a prompt and collect the user's response #' #' The prompt message will be displayed, and then \code{readLines} is used to #' collect a single input value (possibly empty), which is then returned. #' #' In most situations using the default \code{con=stdin()} should work #' properly. Under RStudio, it is necessary to specify #' \code{con=file("stdin")} for proper operation. #' #' @param msg Character vector providing the message to be displayed #' @param con Character connection to query, defaults to \code{stdin()}. #' @return A character scalar containing the input provided by the user. #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link{readLines}}, \code{\link{scan}} #' @keywords IO #' @examples #' #' #' # use default prompt #' ask() #' #' silly <- function() { #' age <- ask("How old aroe you? ") #' age <- as.numeric(age) #' cat("In 10 years you will be", age + 10, "years old!\n") #' } #' @export ask <- function(msg = "Press to continue: ", con = stdin()) { cat(msg) readLines(con = con, n = 1) } gtools/R/dirichlet.R0000644000176200001440000000500714261670123014060 0ustar liggesusers#' Functions for the Dirichlet Distribution #' #' Functions to compute the density of or generate random deviates from the #' Dirichlet distribution #' #' The Dirichlet distribution is the multidimensional generalization of the #' beta distribution. It is the canonical Bayesian distribution for the #' parameter estimates of a multinomial distribution. #' #' @aliases rdirichlet ddirichlet #' @param x A vector containing a single random deviate or matrix containing one #' random deviate per row. #' @param alpha Vector or (for \code{ddirichlet}) matrix containing shape #' parameters. #' @return \code{ddirichlet} returns a vector containing the Dirichlet density #' for the corresponding rows of \code{x}. #' #' \code{rdirichlet} returns a matrix with \code{n} rows, each containing a #' single Dirichlet random deviate. #' @author Code original posted by Ben Bolker to R-News on Fri Dec 15 2000. See #' \url{https://stat.ethz.ch/pipermail/r-help/2000-December/009561.html}. Ben #' attributed the code to Ian Wilson \email{i.wilson@@maths.abdn.ac.uk}. #' Subsequent modifications by Gregory R. Warnes \email{greg@@warnes.net}. #' @seealso \code{\link{dbeta}}, \code{\link{rbeta}} #' @keywords distribution #' @examples #' #' #' x <- rdirichlet(20, c(1, 1, 1)) #' #' ddirichlet(x, c(1, 1, 1)) #' @name dirichlet NULL #' @describeIn dirichlet Dirichlet distribution function. #' @export ddirichlet <- function(x, alpha) { 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 } #' @describeIn dirichlet Generate dirichlet random deviates. #' @param n Number of random vectors to generate. #' @importFrom stats rgamma #' @export rdirichlet <- function(n, alpha) { l <- length(alpha) x <- matrix(rgamma(l * n, alpha), ncol = l, byrow = TRUE) sm <- x %*% rep(1, l) x / as.vector(sm) } gtools/R/gtools-package.R0000644000176200001440000000354514526256036015025 0ustar liggesusers#' gtools: Various R Programming Tools #' #' Functions to assist in R programming, including: #' \describe{ #' \item{developing, updating, and maintaining R and R packages}{'ask', 'checkRVersion', 'getDependencies', 'keywords', 'scat'} #' \item{calculate the logit and inverse logit transformations}{'logit', 'inv.logit'} #' \item{test if a value is missing, empty, contains only NA and NULL values, or is a 'try-error'}{'invalid'} #' \item{manipulate R's .Last function}{'addLast'} #' \item{define macros}{'defmacro', 'strmacro'} #' \item{detect odd and even integers}{'odd', 'even'} #' \item{convert strings containing non-ASCII characters (like single quotes) to plain ASCII}{'ASCIIfy'} #' \item{perform a binary search}{'binsearch'} #' \item{sort strings containing both numeric and character components}{'mixedsort', 'mixedorder'} #' \item{create a factor variable from the quantiles of a continuous variable}{'quantcut'} #' \item{enumerate permutations and combinations}{'combinations', 'permutation'} #' \item{calculate and convert between fold-change and log-ratio}{'foldchange', 'logratio2foldchange', 'foldchange2logratio'} #' \item{calculate probabilities and generate random numbers from Dirichlet distributions}{'rdirichlet', 'ddirichlet'} #' \item{apply a function over adjacent subsets of a vector}{'running'} #' \item{modify the TCP_NODELAY ('de-Nagle') flag for socket objects}{'tcpNoDelay'} #' \item{efficient 'rbind' of data frames, even if the column names don't match}{'smartbind'} #' \item{generate significance stars from p-values}{'stars.pval'} #' \item{convert characters to/from ASCII codes}{asc, chr} #' \item{convert character vector to ASCII representation}{'ASCIIfy'} #' \item{apply title capitalization rules to a character vector}{'capwords'} #' } #' #' @docType package #' @name gtools #' @useDynLib gtools, .registration=TRUE #' @keywords internal "_PACKAGE" gtools/R/getDependencies.R0000644000176200001440000001176614262132476015215 0ustar liggesusers#' Get package dependencies #' #' Get package dependencies #' #' This function recursively constructs the list of dependencies for the #' packages given by \code{pkgs}. By default, the dependency information is #' extracted from both installed and available packages. As a consequence, it #' works both for local and CRAN packages. #' #' @param pkgs character vector of package names #' @param dependencies character vector of dependency types to include. #' Choices are "Depends", "Imports", "LinkingTo", "Suggests", and "Enhances". #' Defaults to \code{c("Depends", "Imports", "LinkingTo")}. #' @param installed Logical indicating whether to pull dependency information #' from installed packages. Defaults to TRUE. #' @param available Logical indicating whether to pull dependency information #' from available packages. Defaults to TRUE. #' @param base Logical indicating whether to include dependencies on base #' packages that are included in the R installation. Defaults to FALSE. #' @param recommended Logical indicating whether to include dependencies on #' recommended packages that are included in the R installation. Defaults to #' FALSE. #' @return A character vector of package names. #' @note If \code{available=TRUE} R will attempt to access the currently #' selected CRAN repository, prompting for one if necessary. #' @author Gregory R. Warnes \email{greg@@warnes.net} based on the non exported #' \code{utils:::getDependencies} and \code{utils:::.clean_up_dependencies2}. #' @seealso \code{\link{installed.packages}}, \code{\link{available.packages}} #' @keywords utilities #' @examples #' #' \dontrun{ #' ## A locally installed package #' #' getDependencies("MASS", installed = TRUE, available = FALSE) #' #' ## A package on CRAN #' getDependencies("gregmisc", installed = FALSE, available = TRUE) #' #' #' ## Show base and recommended dependencies #' getDependencies("MASS", available = FALSE, base = TRUE, recommended = TRUE) #' #' ## Download the set of packages necessary to support a local package #' deps <- getDependencies("MyLocalPackage", available = FALSE) #' download.packages(deps, destdir = "./R_Packages") #' } #' #' @importFrom utils available.packages #' @importFrom utils flush.console #' @importFrom utils head #' @importFrom utils installed.packages #' @export getDependencies <- function(pkgs, dependencies = c("Depends", "Imports", "LinkingTo"), installed = TRUE, available = TRUE, base = FALSE, recommended = FALSE) { pkgs.in <- pkgs if (is.null(dependencies)) { return(unique(pkgs)) } dep2 <- c("Depends", "Imports", "LinkingTo") if (installed && !available) { all.packages <- installed.packages() } else if (available && !installed) { all.packages <- available.packages() } else { all.packages <- as.matrix(smartbind( ## installed.packages(), available.packages() )) } rownames(all.packages) <- all.packages[, "Package"] p0 <- unique(pkgs) miss <- !p0 %in% row.names(all.packages) if (sum(miss)) { warning(sprintf(ngettext( sum(miss), "package %s is not available (for %s)", "packages %s are not available (for %s)" ), paste(sQuote(p0[miss]), collapse = ", " ), sub(" *\\(.*", "", R.version.string)), domain = NA, call. = FALSE ) if (sum(miss) == 1L && !is.na(w <- match( tolower(p0[miss]), tolower(row.names(all.packages)) ))) { warning(sprintf("Perhaps you meant %s ?", sQuote(row.names(all.packages)[w])), call. = FALSE, domain = NA ) } flush.console() } ## Whether to exclude base and recommended packages if (!base || !recommended) { priority <- NULL if (!base) priority <- c("base", priority) if (!recommended) priority <- c("recommended", priority) installed <- installed.packages(priority = priority) } else { installed <- installed.packages()[FALSE, ] } p0 <- p0[!miss] p1 <- p0 not_avail <- character() repeat { deps <- apply( all.packages[p1, dependencies, drop = FALSE], 1L, function(x) paste(x[!is.na(x)], collapse = ", ") ) res <- .clean_up_dependencies2( deps, installed = installed, all.packages ) not_avail <- c(not_avail, res[[2L]]) deps <- unique(res[[1L]]) deps <- deps[!deps %in% c("R", pkgs)] if (!length(deps)) { break } pkgs <- c(deps, pkgs) p1 <- deps if (!is.null(dep2)) { dependencies <- dep2 dep2 <- NULL } } if (length(not_avail)) { not_avail <- unique(not_avail) warning(sprintf( ngettext( length(not_avail), "dependency %s is not available", "dependencies %s are not available" ), paste(sQuote(not_avail), collapse = ", " ) ), domain = NA, call. = FALSE, immediate. = TRUE ) flush.console() } pkgs <- unique(pkgs) pkgs <- pkgs[pkgs %in% row.names(all.packages)] p0 <- pkgs p0[!p0 %in% pkgs.in] } gtools/R/capwords.R0000644000176200001440000000753214437664036013753 0ustar liggesusers#' Capitalize Words for Titles #' #' This function capitalizes words for use in titles #' #' This function separates the provided character string into separate words #' using \code{sep} as the word separator. If \code{firstonly==TRUE}, it then #' capitalizes the first letter the first word, otherwise (the default), it #' capitalizes the first letter of every word. If \code{AP==TRUE}, it then #' un-capitalizes words in the Associated Press's (AP) list of prepositions and #' conjunctions should not be capitalized in titles. Next, it capitalizes the #' first word. It then re-joins the words using the specified separator. #' #' If \code{preserveMixed==TRUE}, words with an upper-case letter appearing #' after a lower-case letter will not be changed (e.g. "iDevice"). #' #' @param s character string to be processed #' @param strict Logical, remove all additional capitalization. #' @param AP Logical, apply the Associated Press (AP) rules for prepositions #' and conjunctions that should not be capitalized in titles. #' @param onlyfirst Logical, only capitalize the first word. #' @param preserveMixed Logical, preserve the capitalization mixed-case words #' containing an upper-case letter after a lower-case letter. #' @param sep Character string, word separator #' @return A character scalar containing the capitalized words. #' @author Gregory R. Warnes \email{greg@@warnes.net} based on code from the #' \code{\link[base]{chartr}} manual page, and Scott Chamberlain's #' \code{\link[taxize]{taxize_capwords}} in the taxize package. #' @seealso \code{\link[base]{chartr}}, \code{\link[taxize]{taxize_capwords}}, #' \code{\link[SGP]{capwords}} #' @references Fogarty, Mignon. Capitalizing Titles: "Which words should you #' capitalize? Grammar Girl's Quick and Dirty Tips for Better Writing. 9 Jun. #' 2011. Quick and Dirty Tips Website." Accessed 22 April 2016 #' \url{https://www.quickanddirtytips.com/articles/capitalizing-titles/} #' @keywords utilites character #' @examples #' #' capwords("a function to capitalize words in a title") #' capwords("a function to capitalize words in a title", AP = FALSE) #' #' capwords("testing the iProduct for defects") #' capwords("testing the iProduct for defects", strict = TRUE) #' capwords("testing the iProduct for defects", onlyfirst = TRUE) #' capwords("testing the iProduct for defects", preserveMixed = TRUE) #' #' capwords("title_using_underscores_as_separators", sep = "_") #' @export capwords <- function(s, strict = FALSE, AP = TRUE, onlyfirst = FALSE, preserveMixed = FALSE, sep = " ") { # worker functions cap <- function(s) { paste(toupper(substring(s, 1, 1)), { s <- substring(s, 2) if (strict) tolower(s) else s }, sep = "" ) } # test if there is a lowercase letter followed by an uppercase letter isMixedCase <- function(s) { grepl("[a-z][A-Z]", s) } words <- unlist(strsplit(s, split = sep)) mixedCaseFlag <- sapply(words, isMixedCase) # First, capitalize *every* word if (!onlyfirst) { newWords <- sapply( words, cap ) if (preserveMixed == TRUE) { newWords[mixedCaseFlag] <- words[mixedCaseFlag] } words <- newWords } # Next (optionally) uncapitalize prepositions and conjunctions # recommended by the Associated Press. AP.nocap <- c( "a", "an", "and", "at", "but", "by", "for", "in", "nor", "of", "on", "or", "so", "the", "to", "up", "yet" ) if (AP && !onlyfirst) { for (word in AP.nocap) { words <- gsub(paste0("^", word, "$"), word, words, ignore.case = TRUE ) } } # Finally, ensure that the first word is capitalized if (length(words) > 0 && mixedCaseFlag[1] == FALSE) { words[1] <- cap(words[1]) } retval <- paste(words, collapse = sep) retval } gtools/R/badDend.R0000644000176200001440000000116014261670123013426 0ustar liggesusers#' Dataset That Crashes Base:::Plot.Dendogram with 'Node Stack Overflow' #' #' Base:::Plot.Dendogram() will generate a 'Node Stack Overflow' when run on a #' dendrogram appropriately constructed from this data set. #' #' #' @name badDend #' @docType data #' @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' dendrogram from this data and how to work around the issue. #' @keywords datasets #' @examples #' #' data(badDend) NULL gtools/R/binsearch.R0000644000176200001440000001477714261670123014065 0ustar liggesusers#' Binary Search #' #' Search within a specified range to locate an integer parameter which results #' in the the specified monotonic function obtaining a given value. #' #' This function implements an extension to the standard binary search #' algorithm for searching a sorted list. The algorithm has been extended to #' cope with cases where an exact match is not possible, to detect whether that #' the function may be monotonic increasing or decreasing and act #' appropriately, and to detect when the target value is outside the specified #' range. #' #' The algorithm initializes two variable \code{lo} and \code{high} to the #' extremes values of \code{range}. It then generates a new value #' \code{center} halfway between \code{lo} and \code{hi}. If the value of #' \code{fun} at \code{center} exceeds \code{target}, it becomes the new value #' for \code{lo}, otherwise it becomes the new value for \code{hi}. This #' process is iterated until \code{lo} and \code{hi} are adjacent. If the #' function at one or the other equals the target, this value is returned, #' otherwise \code{lo}, \code{hi}, and the function value at both are returned. #' #' Note that when the specified target value falls between integers, the #' \emph{two} closest values are returned. If the specified target falls #' outside of the specified \code{range}, the closest endpoint of the range #' will be returned, and an warning message will be generated. If the maximum #' number if iterations was reached, the endpoints of the current subset of the #' range under consideration will be returned. #' #' @param fun Monotonic function over which the search will be performed. #' @param range 2-element vector giving the range for the search. #' @param \dots Additional parameters to the function \code{fun}. #' @param target Target value for \code{fun}. Defaults to 0. #' @param lower Lower limit of search range. Defaults to \code{min(range)}. #' @param upper Upper limit of search range. Defaults to \code{max(range)}. #' @param maxiter Maximum number of search iterations. Defaults to 100. #' @param showiter Boolean flag indicating whether the algorithm state should #' be printed at each iteration. Defaults to FALSE. #' @return A list containing: \item{call}{How the function was called.} #' \item{numiter}{The number of iterations performed} \item{flag }{One of the #' strings, "Found", "Between Elements", "Maximum number of iterations #' reached", "Reached lower boundary", or "Reached upper boundary."} #' \item{where}{One or two values indicating where the search terminated.} #' \item{value}{Value of the function \code{fun} at the values of #' \code{where}.} #' @note This function often returns two values for \code{where} and #' \code{value}. Be sure to check the \code{flag} parameter to see what these #' values mean. #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link{optim}}, \code{\link{optimize}}, \code{\link{uniroot}} #' @keywords optimize programming #' @examples #' #' #' ### Toy examples #' #' # search for x=10 #' binsearch(function(x) x - 10, range = c(0, 20)) #' #' # search for x=10.1 #' binsearch(function(x) x - 10.1, range = c(0, 20)) #' #' ### Classical toy example #' #' # binary search for the index of 'M' among the sorted letters #' fun <- function(X) { #' ifelse(LETTERS[X] > "M", 1, #' ifelse(LETTERS[X] < "M", -1, 0) #' ) #' } #' #' binsearch(fun, range = 1:26) #' # returns $where=13 #' LETTERS[13] #' #' ### Substantive example, from genetics #' \dontrun{ #' library(genetics) #' # Determine the necessary sample size to detect all alleles with #' # frequency 0.07 or greater with probability 0.95. #' power.fun <- function(N) 1 - gregorius(N = N, freq = 0.07)$missprob #' #' binsearch(power.fun, range = c(0, 100), target = 0.95) #' #' # equivalent to #' gregorius(freq = 0.07, missprob = 0.05) #' } #' #' @export binsearch <- function(fun, range, ..., target = 0, lower = ceiling(min(range)), upper = floor(max(range)), maxiter = 100, showiter = FALSE) { # initialize lo <- lower hi <- upper counter <- 0 val.lo <- fun(lo, ...) val.hi <- fun(hi, ...) # check whether function is increasing or decreasing, & set sign # appropriately. if (val.lo > val.hi) { sign <- -1 } else { sign <- 1 } # check if value is outside specified range if (target * sign < val.lo * sign) { outside.range <- TRUE } else if (target * sign > val.hi * sign) { outside.range <- TRUE } else { outside.range <- FALSE } # iteratively move lo & high closer together until we run out of # iterations, or they are adjacent, or they are identical while (counter < maxiter && !outside.range) { counter <- counter + 1 if (hi - lo <= 1 || lo < lower || hi > upper) break center <- round((hi - lo) / 2 + lo, 0) val <- fun(center, ...) if (showiter) { cat("--------------\n") cat("Iteration #", counter, "\n") cat("lo=", lo, "\n") cat("hi=", hi, "\n") cat("center=", center, "\n") cat("fun(lo)=", val.lo, "\n") cat("fun(hi)=", val.hi, "\n") cat("fun(center)=", val, "\n") } if (val == target) { val.lo <- val.hi <- val lo <- hi <- center break } else if (sign * val < sign * target) { lo <- center val.lo <- val } else # ( val > target ) { hi <- center val.hi <- val } if (showiter) { cat("new lo=", lo, "\n") cat("new hi=", hi, "\n") cat("--------------\n") } } # Create return value retval <- list() retval$call <- match.call() retval$numiter <- counter if (outside.range) { if (target * sign < val.lo * sign) { warning("Reached lower boundary") retval$flag <- "Lower Boundary" retval$where <- lo retval$value <- val.lo } else # (target * sign > val.hi * sign) { warning("Reached upper boundary") retval$flag <- "Upper Boundary" retval$where <- hi retval$value <- val.hi } } else if (counter >= maxiter) { warning("Maximum number of iterations reached") retval$flag <- "Maximum number of iterations reached" retval$where <- c(lo, hi) retval$value <- c(val.lo, val.hi) } else if (val.lo == target) { retval$flag <- "Found" retval$where <- lo retval$value <- val.lo } else if (val.hi == target) { retval$flag <- "Found" retval$where <- hi retval$value <- val.hi } else { retval$flag <- "Between Elements" retval$where <- c(lo, hi) retval$value <- c(val.lo, val.hi) } return(retval) } gtools/R/roman2int.R0000644000176200001440000000347414261670123014030 0ustar liggesuserstestConvert <- 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(C_convert, roman = as.character(roman), nchar = as.integer(nchar(roman)), values = integer(nchar(roman)), PACKAGE = "gtools" ) retval$values } roman2int.inner <- function(roman) { results <- .C(C_roman2int, roman = as.character(roman), nchar = as.integer(nchar(roman)), value = integer(1), PACKAGE = "gtools" ) return(results$value) } #' Convert Roman Numerals to Integers #' #' Convert roman numerals to integers #' #' This function will convert roman numerals to integers without the upper bound #' imposed by R (3899), ignoring case. #' #' @param roman character vector containing roman numerals #' @return 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@@warnes.net} #' @seealso \code{\link[utils]{as.roman}} #' @keywords arith #' @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) #' @export roman2int <- function(roman) { roman <- trimws(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 } gtools/R/trimws.R0000644000176200001440000000046514261670123013441 0ustar liggesusers## 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 } } gtools/R/oddeven.R0000644000176200001440000000074514261670123013541 0ustar liggesusers#' Detect odd/even integers #' #' detect odd/even integers #' #' #' @aliases odd even #' @param x vector of integers #' @return Vector of TRUE/FALSE values. #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link[base]{round}} #' @keywords arith #' @examples #' #' #' odd(4) #' even(4) #' #' odd(1:10) #' even(1:10) #' @name oddeven NULL #' @rdname oddeven #' @export odd <- function(x) x %% 2 == 1 #' @rdname oddeven #' @export even <- function(x) x %% 2 == 0 gtools/R/baseOf.R0000644000176200001440000001160014261670123013304 0ustar liggesusers#' Transform an integer to an array of base-n digits #' #' Transform an integer to an array of base-n digits #' #' This function converts the elements of an integer vector as an array of its #' digits. The base of the numbering scheme may be changed away from 10, which #' defines our decimal system, to any other integer value. For base=2, the #' number is returned in the binary system. The least significant digit has the #' highest index in the array, i.e. it appears on the right. The highest #' exponent is at position 1, i.e. left. #' #' To write decimal values in another base is very common in computer science. #' In particular at the basis 2 the then possible values 0 and 1 are often #' interpreted as logical false or true. And at the very interface to #' electrical engineering, it is indicated as an absence or presence of #' voltage. When several bit values are transported synchronously, then it is #' common to give every lane of such a data bus a unique 2^x value and #' interpret it as a number in the binary system. To distinguish 256 characters #' one once needed 8 bit ("byte"). It is the common unit in which larger #' non-printable data is presented. Because of the many non-printable #' characters and the difficulty for most humans to memorize an even longer #' alphabet, it is presented as two half bytes ("nibble") of 4 bit in a #' hexadecimal presentation. Example code is shown below. #' #' For statisticians, it is more likely to use bit representations for hashing. #' A bit set to 1 (TRUE) at e.g. position 2, 9 or 17 is interpreted as the #' presence of a particular feature combination of a sample. With baseOf, you #' can refer to the bit combination as a number, which is more easily and more #' efficiently dealt with than with an array of binary values. The example code #' presents a counter of combinations of features which may be interpreted as a #' Venn diagram. #' #' @param v A single integer value to be transformed. #' @param base The base to which to transform to. #' @param len The minimal length of the returned array. #' @author Steffen Moeller \email{moeller@@debian.org} #' @keywords base #' @examples #' #' # decimal representation #' baseOf(123) #' #' # binary representation #' baseOf(123, base = 2) #' #' # octal representation #' baseOf(123, base = 8) #' #' # hexadecimal representation #' baseOf(123, base = 16) #' #' # hexadecimal with more typical letter-notation #' c(0:9, LETTERS)[baseOf(123, 16)] #' #' # hexadecimal again, now showing a single string #' paste(c(0:9, LETTERS)[baseOf(123, 16)], collapse = "") #' #' # decimal representation but filling leading zeroes #' baseOf(123, len = 5) #' #' # and converting that back #' sum(2^(4:0) * baseOf(123, len = 5)) #' #' # hashing and a tabular venn diagram derived from it #' m <- matrix(sample(c(FALSE, TRUE), replace = TRUE, size = 300), ncol = 4) #' colnames(m) <- c("strong", "colorful", "nice", "humorous") #' names(dimnames(m)) <- c("samples", "features") #' head(m) #' #' m.val <- apply(m, 1, function(X) { #' return(sum(2^((ncol(m) - 1):0) * X)) #' }) #' m.val.rle <- rle(sort(m.val)) #' m.counts <- cbind( #' baseOf(m.val.rle$value, base = 2, len = ncol(m)), #' m.val.rle$lengths #' ) #' colnames(m.counts) <- c(colnames(m), "num") #' rownames(m.counts) <- apply(m.counts[, 1:ncol(m)], 1, paste, collapse = "") #' m.counts[1 == m.counts[, "nice"] & 1 == m.counts[, "humorous"], , drop = FALSE] #' m.counts[, "num", drop = TRUE] #' @export baseOf <- function(v, base = 10, len = 1) { if (is.null(v)) { stop("v is null") } if (length(v) == 0) { return(integer(0)) } if (any(as.integer(v) != v)) { stop("non-integer value(s) provided for v.") } if (length(v) > 1) { # this returns a list which may have vectors of varying lenths val.list <- lapply(X = v, FUN = baseOf.inner, base = base, len = len) longest <- max(sapply(val.list, length)) # call again, forcing all elements to have the same lenth retval <- t(sapply(X = v, FUN = baseOf.inner, base = base, len = longest)) # add informative row and column names rownames(retval) <- paste0("v.", v) colnames(retval) <- paste0("b.", rev(c(0, base^(1:(longest - 1))))) retval } else { retval <- baseOf.inner(v = v, base = base, len = len) } retval } # Transform integer to array of digits in specified baseOf.inner <- function(v, base = 10, len = 1) { if (is.na(v)) { return(rep(NA, len)) } if (v == 0) { return(rep(0, len)) } remainder <- v i <- len ret <- NULL while (remainder > 0 || i > 0) { # print(paste("i=",i," remainder=",remainder)) m <- remainder %% base if (is.null(ret)) { ret <- m } else { ret <- c(m, ret) } remainder <- remainder %/% base i <- i - 1 } if (length(ret) > 1) { names(ret) <- rev(c(0, base^(1:(length(ret) - 1)))) } return(ret) } gtools/R/stars.pval.R0000644000176200001440000000175314322256611014212 0ustar liggesusers#' Generate significance stars from p-values #' #' Generate significance stars (e.g. '***', '**', '*', '.') from p-values using #' R's standard definitions. #' #' Mapping from p-value ranges to symbols: \describe{ \item{0 - 0.001}{'***'} #' \item{0.001 - 0.01}{'**'} \item{0.01 - 0.05}{'*'} \item{0.05 - 0.1}{'.'} #' \item{0.1 - 1.0}{'' (No symbol)} } #' #' @param p.value numeric vector of p-values #' @return A character vector containing the same number of elements as #' \code{p-value}, with an attribute "legend" providing the conversion pattern. #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link[stats]{symnum}} #' @keywords misc #' @examples #' #' p.val <- c(0.0004, 0.0015, 0.013, 0.044, 0.067, 0.24) #' stars.pval(p.val) #' @importFrom stats symnum #' @export stars.pval <- function(p.value) { unclass( symnum(p.value, corr = FALSE, na = FALSE, cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1), symbols = c("***", "**", "*", ".", " ") ) ) } gtools/R/script_file.R0000644000176200001440000000753114261670123014420 0ustar liggesusers#' Determine the directory or full path to the currently executing script #' #' @param fail character, one of "stop", "warning", "quiet". specifying what #' should be done when the script path cannot be determined: #' "stop" causes an error to be generated, #' "warn" generates a warning message and returns NA, #' "quiet" silently returns NA. #' #' These function should work with \code{Rscript}, \code{source()}, #' \code{Rmarkdown} \code{RStudio}'s "Run selection", and the \code{RStudio} #' Console. #' #' @author Greg Warnes \email{greg@warnes.net} based on on a Stack Overflow post by #' jerry-t (\url{https://stackoverflow.com/users/2292993/jerry-t}) at #' \url{https://stackoverflow.com/a/36777602/2744062}. #' #' @return A character scalar containing the full path to the currently #' executing script file (\code{script_file}) or its directory #' (\code{script_path}). If unable to determine the script path, it generates #' a warning and returns \code{""} (empty string). #' #' @examples #' #' getwd() #' commandArgs(trailingOnly = FALSE) #' #' script_file("warning") #' script_path("warning") #' @name script_file NULL #' @describeIn script_file Determine the full path of the currently executing #' script #' @export script_file <- function(fail = c("stop", "warning", "quiet")) { fail <- match.arg(fail) # https://stackoverflow.com/a/32016824/2292993 cmdArgs <- commandArgs(trailingOnly = FALSE) needle <- "--file=" match <- grep(needle, cmdArgs) if (length(match) > 0) { # Rscript via command line with "--file=" return(normalizePath(sub(needle, "", cmdArgs[match]))) } else if ("-f" %in% cmdArgs) { idx <- which("-f" == cmdArgs) + 1 return(normalizePath(cmdArgs[idx])) } else { ls_vars <- ls(sys.frames()[[1]]) if ("fileName" %in% ls_vars) { # Source'd via RStudio return(normalizePath(sys.frames()[[1]]$fileName)) } else { if (!is.null(sys.frames()[[1]]$ofile)) { # Source'd via R console return(normalizePath(sys.frames()[[1]]$ofile)) } else { tryCatch( { if (requireNamespace("knitr", quietly = TRUE)) { # Executing in a RMarkdown file pth <- knitr::current_input(dir = TRUE) if (length(pth) > 0 && nchar(pth) > 0) { return(normalizePath(pth)) } } if (requireNamespace("rstudioapi", quietly = TRUE) && rstudioapi::isAvailable()) { # RStudio Run Selection # http://stackoverflow.com/a/35842176/2292993 pth <- rstudioapi::getActiveDocumentContext()$path if (length(pth) > 0 && nchar(pth) > 0) { return(normalizePath(pth)) } # RStudio Console pth <- rstudioapi::getSourceEditorContext()$path if (length(pth) > 0 && nchar(pth) > 0) { return(normalizePath(pth)) } # RStudio Source Editor pth <- rstudioapi::getConsoleEditorContext()$path if (length(pth) > 0 && nchar(pth) > 0) { return(normalizePath(pth)) } } stop() }, error = function(e) { if (fail == "stop") { stop("Unable to resolve file path.") } else if (fail == "warning") { warning("Unable to resolve file path, returning NA.") return(NA) } else { # fail=="quiet" return(NA) } } ) } } } NA } #' @describeIn script_file Determine the directory of the currently executing script #' #' @export script_path <- function(fail = c("stop", "warning", "quiet")) { fail <- match.arg(fail) file <- script_file(fail = fail) if (is.na(file)) { NA } else { dirname(file) } } gtools/R/foldchange.R0000644000176200001440000000373314261670123014207 0ustar liggesusers#' Compute fold-change or convert between log-ratio and fold-change. #' #' \code{foldchange} computes the fold change for two sets of values. #' \code{logratio2foldchange} converts values from log-ratios to fold changes. #' \code{foldchange2logratio} does the reverse. #' #' Fold changes are commonly used in the biological sciences as a mechanism for #' comparing the relative size of two measurements. They are computed as: #' \eqn{\frac{num}{denom}}{num/denom} if \eqn{num>denom}, and as #' \eqn{\frac{-denom}{num}}{-denom/num} otherwise. #' #' Fold-changes have the advantage of ease of interpretation and symmetry about #' \eqn{num=denom}, but suffer from a discontinuity between -1 and 1, which can #' cause significant problems when performing data analysis. Consequently #' statisticians prefer to use log-ratios. #' #' @aliases foldchange logratio2foldchange foldchange2logratio #' @param num,denom vector/matrix of numeric values #' @param logratio vector/matrix of log-ratio values #' @param foldchange vector/matrix of fold-change values #' @param base Exponential base for the log-ratio. #' @return A vector or matrix of the same dimensions as the input containing #' the converted values. #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @keywords math #' @examples #' #' #' a <- 1:21 #' b <- 21:1 #' #' f <- foldchange(a, b) #' #' cbind(a, b, f) #' @name foldchange NULL #' @describeIn foldchange Compute fold-change. #' @export foldchange <- function(num, denom) { ifelse(num >= denom, num / denom, -denom / num) } #' @describeIn foldchange Compute foldchange from log-ratio values. #' @export logratio2foldchange <- function(logratio, base = 2) { retval <- base^(logratio) retval <- ifelse(retval < 1, -1 / retval, retval) retval } #' @describeIn foldchange Compute log-ratio from fold-change values. #' @export foldchange2logratio <- function(foldchange, base = 2) { retval <- ifelse(foldchange < 0, 1 / -foldchange, foldchange) retval <- log(retval, base) retval } gtools/R/quantcut.R0000644000176200001440000001010114261670123013744 0ustar liggesusers#' Create a Factor Variable Using the Quantiles of a Continuous Variable #' #' Create a factor variable using the quantiles of a continuous variable. #' #' #' 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. #' #' @param x Continuous variable. #' @param 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. #' @param na.rm Boolean indicating whether missing values should be removed #' when computing quantiles. Defaults to TRUE. #' @param \dots Optional arguments passed to \code{\link{cut}}. #' @return Factor variable with one level for each quantile interval. #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link{cut}}, \code{\link{quantile}} #' @keywords manip #' @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{ #' stopifnot(identical(deciles.1, deciles.2)) #' # } #' #' ## show handling of 'tied' quantiles. #' x <- round(x) # discretize to create ties #' stem(x) # display the ties #' deciles <- quantcut(x, 10) #' #' table(deciles) # note that there are only 5 groups (not 10) #' # due to duplicates #' @importFrom stats quantile #' @export quantcut <- function(x, q = 4, na.rm = TRUE, ...) { if (length(q) == 1) { q <- seq(0, 1, length.out = q + 1) } quant <- quantile(x, q, na.rm = na.rm) dups <- duplicated(quant) if (any(dups)) { flag <- x %in% unique(quant[dups]) retval <- ifelse(flag, paste("[", as.character(x), "]", sep = "" ), NA ) uniqs <- unique(quant) # move cut points over a bit... reposition <- function(cut) { flag <- x >= cut if (sum(flag, na.rm = na.rm) == 0) { return(cut) } else { return(min(x[flag], na.rm = na.rm)) } } newquant <- sapply(uniqs, reposition) retval[!flag] <- as.character(cut(x[!flag], breaks = newquant, include.lowest = TRUE, ... )) levs <- unique(retval[order(x)]) # ensure factor levels are # properly ordered retval <- factor(retval, levels = levs) ## determine open/closed interval ends mkpairs <- function(x) { # make table of lower, upper sapply( x, function(y) if (length(y) == 2) y[c(2, 2)] else y[2:3] ) } pairs <- mkpairs(strsplit(levs, "[^0-9+\\.\\-]+")) rownames(pairs) <- c("lower.bound", "upper.bound") colnames(pairs) <- levs closed.lower <- rep(F, ncol(pairs)) # default lower is open closed.upper <- rep(T, ncol(pairs)) # default upper is closed closed.lower[1] <- TRUE # lowest interval is always closed for (i in 2:ncol(pairs)) { # open lower interval if above singlet if (pairs[1, i] == pairs[1, i - 1] && pairs[1, i] == pairs[2, i - 1]) { closed.lower[i] <- FALSE } } for (i in 1:(ncol(pairs) - 1)) { # open upper inteval if below singlet if (pairs[2, i] == pairs[1, i + 1] && pairs[2, i] == pairs[2, i + 1]) { closed.upper[i] <- FALSE } } levs <- ifelse(pairs[1, ] == pairs[2, ], pairs[1, ], paste(ifelse(closed.lower, "[", "("), pairs[1, ], ",", pairs[2, ], ifelse(closed.upper, "]", ")"), sep = "" ) ) levels(retval) <- levs } else { retval <- cut(x, quant, include.lowest = TRUE, ...) } return(retval) } gtools/R/permute.R0000644000176200001440000000075514261670123013577 0ustar liggesusers#' Randomly Permute the Elements of a Vector #' #' Randomly Permute the elements of a vector #' #' This is simply a wrapper function for \code{\link{sample}}. #' #' @param x Vector of items to be permuted #' @return Vector with the original items reordered. #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link{sample}} #' @keywords distribution #' @examples #' #' x <- 1:10 #' permute(x) #' @export permute <- function(x) sample(x, size = length(x), replace = FALSE) gtools/R/strmacro.R0000644000176200001440000000276314261670123013751 0ustar liggesusers#' @rdname defmacro #' @export strmacro <- function(..., expr, strexpr) { if (!missing(expr)) { strexpr <- deparse(substitute(expr)) } a <- substitute(list(...))[-1] nn <- names(a) if (is.null(nn)) { nn <- rep("", length(a)) } for (i in 1:length(a)) { if (nn[i] == "") { nn[i] <- paste(a[[i]]) msg <- paste(a[[i]], "not supplied") a[[i]] <- substitute( stop(foo), list(foo = msg) ) } else { a[[i]] <- a[[i]] } } names(a) <- nn a <- as.list(a) ## this is where the work is done ff <- function(...) { ## build replacement list reptab <- a # copy defaults first reptab$"..." <- NULL args <- match.call(expand.dots = TRUE)[-1] for (item in names(args)) { reptab[[item]] <- args[[item]] } ## do the replacements body <- strexpr for (i in 1:length(reptab)) { pattern <- paste("\\b", names(reptab)[i], "\\b", sep = "" ) value <- reptab[[i]] if (missing(value)) { value <- "" } body <- gsub( pattern, value, body ) } fun <- parse(text = body) eval(fun, parent.frame()) } ## add the argument list formals(ff) <- a ## create a fake source attribute mm <- match.call() mm$expr <- NULL mm[[1]] <- as.name("macro") attr(ff, "source") <- c(deparse(mm), strexpr) ## return the 'macro' ff } gtools/R/combinations.R0000644000176200001440000001130414261670123014573 0ustar liggesusers#' Enumerate the Combinations or Permutations of the Elements of a Vector #' #' \code{combinations} enumerates the possible combinations of a specified size #' from the elements of a vector. \code{permutations} enumerates the possible #' permutations. #' #' Caution: The number of combinations and permutations increases rapidly with #' \code{n} and \code{r}!. #' #' To use values of \code{n} above about 45, you will need to increase R's #' recursion limit. See the \code{expression} argument to the \code{options} #' command for details on how to do this. #' #' @aliases combinations permutations #' @param n Size of the source vector #' @param r Size of the target vectors #' @param v Source vector. Defaults to \code{1:n} #' @param set Logical flag indicating whether duplicates should be removed from #' the source vector \code{v}. Defaults to \code{TRUE}. #' @param repeats.allowed Logical flag indicating whether the constructed #' vectors may include duplicated values. Defaults to \code{FALSE}. #' @return Returns a matrix where each row contains a vector of length #' \code{r}. #' @author Original versions by Bill Venables #' \email{Bill.Venables@@cmis.csiro.au}. Extended to handle #' \code{repeats.allowed} by Gregory R. Warnes \email{greg@@warnes.net}. #' @seealso \code{\link[base]{choose}}, \code{\link[base]{options}} #' @references Venables, Bill. "Programmers Note", R-News, Vol 1/1, Jan. 2001. #' \url{https://cran.r-project.org/doc/Rnews/} #' @keywords manip #' #' @details #' #' Taken from an email by Brian D Ripley to r-help #' dated Tue, 14 Dec 1999 11:14:04 +0000 (GMT) in response to #' Alex Ahgarin \email{datamanagement@email.com}. Original version was #' named "subsets" and was Written by Bill Venables. #' #' @examples #' #' combinations(3,2,letters[1:3]) #' combinations(3,2,letters[1:3],repeats=TRUE) #' #' permutations(3,2,letters[1:3]) #' permutations(3,2,letters[1:3],repeats=TRUE) #' #' \dontrun{ #' # To use large 'n', you need to change the default recusion limit #' options(expressions=1e5) #' cmat <- combinations(300,2) #' dim(cmat) # 44850 by 2 #' } #' #' @export combinations <- function(n, r, v = 1:n, set = TRUE, repeats.allowed=FALSE) { if(mode(n) != "numeric" || length(n) != 1 || n < 1 || (n %% 1) != 0) stop("bad value of n") if(mode(r) != "numeric" || length(r) != 1 || r < 1 || (r %% 1) != 0) stop("bad value of r") if(!is.atomic(v) || length(v) < n) stop("v is either non-atomic or too short") if( (r > n) & repeats.allowed==FALSE) stop("r > n and repeats.allowed=FALSE") if(set) { v <- unique(sort(v)) if (length(v) < n) stop("too few different elements") } v0 <- vector(mode(v), 0) ## Inner workhorse if(repeats.allowed) sub <- function(n, r, v) { if(r == 0) v0 else if(r == 1) matrix(v, n, 1) else if(n == 1) matrix(v, 1, r) else rbind( cbind(v[1], Recall(n, r-1, v)), Recall(n-1, r, v[-1])) } else sub <- function(n, r, v) { if(r == 0) v0 else if(r == 1) matrix(v, n, 1) else if(r == n) matrix(v, 1, n) else rbind(cbind(v[1], Recall(n-1, r-1, v[-1])), Recall(n-1, r, v[-1])) } sub(n, r, v[1:n]) } ## ## Original version by Bill Venables and cited by by Matthew ## Wiener (mcw@ln.nimh.nih.gov) in an email to R-help dated ## Tue, 14 Dec 1999 09:11:32 -0500 (EST) in response to ## Alex Ahgarin ## ## #' @rdname combinations #' @export permutations <- function(n, r, v = 1:n, set = TRUE, repeats.allowed=FALSE) { if(mode(n) != "numeric" || length(n) != 1 || n < 1 || (n %% 1) != 0) stop("bad value of n") if(mode(r) != "numeric" || length(r) != 1 || r < 1 || (r %% 1) != 0) stop("bad value of r") if(!is.atomic(v) || length(v) < n) stop("v is either non-atomic or too short") if( (r > n) & repeats.allowed==FALSE) stop("r > n and repeats.allowed=FALSE") if(set) { v <- unique(sort(v)) if (length(v) < n) stop("too few different elements") } v0 <- vector(mode(v), 0) ## Inner workhorse if(repeats.allowed) sub <- function(n, r, v) { if(r==1) matrix(v,n,1) else if(n==1) matrix(v,1,r) else { inner <- Recall(n, r-1, v) cbind( rep( v, rep(nrow(inner),n) ), matrix( t(inner), ncol=ncol(inner), nrow=nrow(inner) * n , byrow=TRUE ) ) } } else sub <- function(n, r, v) { if(r==1) matrix(v,n,1) else if(n==1) matrix(v,1,r) else { X <- NULL for(i in 1:n) X <- rbind( X, cbind( v[i], Recall(n-1, r - 1, v[-i]))) X } } sub(n, r, v[1:n]) } gtools/R/smartbind.R0000644000176200001440000002175714261670123014106 0ustar liggesusers#' Efficient rbind of data frames, even if the column names don't match #' #' Efficient rbind of data frames, even if the column names don't match #' #' #' @param \dots Data frames to combine #' @param list List containing data frames to combine #' @param fill Value to use when 'filling' missing columns. Defaults to #' \code{NA}. #' @param sep Character string used to separate column names when pasting them #' together. #' @param verbose Logical flag indicating whether to display processing #' messages. Defaults to \code{FALSE}. #' @return The returned data frame will contain: \item{columns}{all columns #' present in any provided data frame} \item{rows}{a set of rows from each #' provided data frame, with values in columns not present in the given data #' frame filled with missing (\code{NA}) values.} The data type of columns will #' be preserved, as long as all data frames with a given column name agree on #' the data type of that column. If the data frames disagree, the column will #' be converted into a character strings. The user will need to coerce such #' character columns into an appropriate type. #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link{rbind}}, \code{\link{cbind}} #' @keywords manip #' @examples #' #' #' df1 <- data.frame(A = 1:10, B = LETTERS[1:10], C = rnorm(10)) #' df2 <- data.frame(A = 11:20, D = rnorm(10), E = letters[1:10]) #' #' # rbind would fail #' \dontrun{ #' rbind(df1, df2) #' # Error in match.names(clabs, names(xi)) : names do not match previous #' # names: #' # D, E #' } #' # but smartbind combines them, appropriately creating NA entries #' smartbind(df1, df2) #' #' # specify fill=0 to put 0 into the missing row entries #' smartbind(df1, df2, fill = 0) #' \dontshow{ #' n <- 10 # number of data frames to create #' s <- 10 # number of rows in each data frame #' #' # create a bunch of column names #' names <- LETTERS[2:5] #' #' # create a list 'Z' containing 'n' data frames, each with 3 columns #' # and 's' rows. The first column is always named 'A', but the other #' # two have a names randomly selected from 'names' #' #' Z <- list() #' for (i in 1:n) #' { #' X <- data.frame( #' A = sample(letters, s, replace = TRUE), #' B = letters[1:s], #' C = rnorm(s) #' ) #' colnames(X) <- c("A", sample(names, 2, replace = FALSE)) #' Z[[i]] <- X #' } #' #' # Error in match.names(clabs, names(xi)) : names do not match #' # previous names: E #' #' # But smartbind will 'do the right thing' #' df <- do.call("smartbind", Z) #' df #' #' # Equivalent call: #' df <- smartbind(list = Z) #' } #' #' @importFrom utils modifyList #' @export smartbind <- function(..., list, fill = NA, sep = ":", verbose = FALSE) { data <- base::list(...) if (!missing(list)) { data <- modifyList(list, data) } data <- data[!sapply(data, function(l) is.null(l) | (ncol(l) == 0) | (nrow(l) == 0))] defaultNames <- seq.int(length(data)) if (is.null(names(data))) { names(data) <- defaultNames } emptyNames <- names(data) == "" if (any(emptyNames)) { names(data)[emptyNames] <- defaultNames[emptyNames] } data <- lapply( data, function(x) { if (is.matrix(x) || is.data.frame(x)) { x } else { data.frame(as.list(x), check.names = FALSE) } } ) # retval <- new.env() retval <- base::list() rowLens <- unlist(lapply(data, nrow)) nrows <- sum(rowLens) rowNameList <- unlist(lapply( names(data), function(x) { if (rowLens[x] <= 1) { x } else { paste(x, seq(1, rowLens[x]), sep = sep) } } )) colClassList <- vector(mode = "list", length = length(data)) factorColumnList <- vector(mode = "list", length = length(data)) factorLevelList <- vector(mode = "list", length = length(data)) start <- 1 blockIndex <- 1 for (block in data) { colClassList[[blockIndex]] <- base::list() factorColumnList[[blockIndex]] <- character(length = 0) factorLevelList[[blockIndex]] <- base::list() if (verbose) print(head(block)) end <- start + nrow(block) - 1 for (col in colnames(block)) { classVec <- class(block[, col]) ## store class and factor level information for later use colClassList[[blockIndex]][[col]] <- classVec if ("factor" %in% classVec) { factorColumnList[[blockIndex]] <- c(factorColumnList[[blockIndex]], col) factorLevelList[[blockIndex]][[col]] <- levels(block[, col]) } if (verbose) { cat("Start:", start, " End:", end, " Column:", col, "\n", sep = "" ) } if ("factor" %in% classVec) { newclass <- "character" } else { newclass <- classVec[1] } ## Coerce everything that isn't a native type to character if (!(newclass %in% c( "logical", "integer", "numeric", "complex", "character", "raw" ))) { newclass <- "character" warning( "Converting non-atomic type column '", col, "' to type character." ) } if (!(col %in% names(retval))) { retval[[col]] <- as.vector(rep(fill, nrows), mode = newclass) } ## Handle case when current and previous native types differ oldclass <- class(retval[[col]]) if (oldclass != newclass) { # handle conversions in case of conflicts # numeric vs integer --> numeric # complex vs numeric or integer --> complex # anything else: --> character if (oldclass %in% c("integer", "numeric") && newclass %in% c("integer", "numeric")) { class(retval[[col]]) <- mode <- "numeric" } else if (oldclass == "complex" && newclass %in% c("integer", "numeric")) { class(retval[[col]]) <- mode <- "complex" } else if (oldclass %in% c("integer", "numeric") && newclass == "complex") { class(retval[[col]]) <- mode <- "complex" } else { class(retval[[col]]) <- mode <- "character" warning( "Column class mismatch for '", col, "'. ", "Converting column to class 'character'." ) } } else { mode <- oldclass } if (mode == "character") { vals <- as.character(block[, col]) } else { vals <- block[, col] } retval[[col]][start:end] <- as.vector(vals, mode = mode) } start <- end + 1 blockIndex <- blockIndex + 1 } all.equal.or.null <- function(x, y) { if (is.null(x) || is.null(y)) { return(TRUE) } else { return(all.equal(x, y)) } } ## Handle factors, merging levels for (col in unique(unlist(factorColumnList))) { ## Ensure column classes match across blocks colClasses <- lapply(colClassList, function(x) x[[col]]) firstNotNull <- which(!sapply(colClasses, is.null))[1] allSameOrNull <- all(sapply( colClasses[-firstNotNull], function(x) isTRUE(all.equal.or.null(colClasses[[firstNotNull]], x)) )) if (allSameOrNull) { # grab the first *non-NULL* class information colClass <- colClasses[[firstNotNull]] } else { warning( "Column class mismatch for '", col, "'. ", "Converting column to class 'character'." ) next() } ## check if factor levels are all the same colLevels <- lapply(factorLevelList, function(x) x[[col]]) firstNotNull <- which(!sapply(colLevels, is.null))[1] allSameOrNull <- all(sapply( colLevels[-firstNotNull], function(x) isTRUE(all.equal.or.null(colLevels[[firstNotNull]], x)) )) if (allSameOrNull) { if ("ordered" %in% colClass) { retval[[col]] <- ordered(retval[[col]], levels = colLevels[[firstNotNull]]) } else { retval[[col]] <- factor(retval[[col]], levels = colLevels[[firstNotNull]]) } } else { ## Check if longest set of levels is a superset of all others, ## and use that one longestIndex <- which.max(sapply(colLevels, length)) longestLevels <- colLevels[[longestIndex]] allSubset <- all(sapply( colLevels[-longestIndex], function(l) all(l %in% longestLevels) )) if (allSubset) { if ("ordered" %in% colClass) { retval[[col]] <- ordered(retval[[col]], levels = longestLevels) } else { retval[[col]] <- factor(retval[[col]], levels = longestLevels) } } else { # form superset by appending to longest level set levelSuperSet <- unique(c(longestLevels, unlist(colLevels))) retval[[col]] <- factor(retval[[col]], levels = levelSuperSet) if (length(colClass) > 1) # not just plain factor { warning( "column '", col, "' of class ", paste("'", colClass, "'", collapse = ":", sep = "'" ), " converted to class 'factor'. Check level ordering." ) } } } } attr(retval, "row.names") <- rowNameList class(retval) <- "data.frame" return(retval) } gtools/R/loadedPackages.R0000644000176200001440000000305514261670123015001 0ustar liggesusers#' Provide Name, Version, and Path of Loaded Package Namespaces #' #' Provide name, version, and path of loaded package namespaces #' #' #' @param silent Logical indicating whether the results should be printed #' @return Invisibly returns a data frame containing one row per loaded package #' namespace, with columns: \item{Package}{Package name} \item{Version}{Version #' string} \item{Path}{Path to package files} \item{SearchPath}{Either the #' index of the package namespace in the current search path, or '-' if the #' package namespace is not in the search path. '1' corresponds to the top of #' the search path (the first namespace searched for values). } #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link[base]{loadedNamespaces}}, #' \code{\link[utils]{packageVersion}}, \code{\link[base]{search}}, #' \code{\link[base]{find.package}} #' @keywords package #' @examples #' #' loadedPackages() #' @importFrom utils packageVersion #' @export loadedPackages <- function(silent = FALSE) { packageNames <- loadedNamespaces() packageVersions <- sapply(packageNames, function(package) paste(packageVersion(package), sep = ".")) packagePaths <- find.package(packageNames) inSearchPath <- match(packageNames, gsub("^package:", "", grep("^package:", search(), value = TRUE))) retval <- data.frame(Name = packageNames, Version = packageVersions, Path = packagePaths, SearchPath = inSearchPath) retval$SearchPath <- na.replace(retval$SearchPath, "-") retval <- retval[order(inSearchPath), ] if (!silent) print(retval) invisible(retval) } gtools/R/running.R0000644000176200001440000001535414261670123013577 0ustar liggesusers#' Apply a Function Over Adjacent Subsets of a Vector #' #' Applies a function over subsets of the vector(s) formed by taking a fixed #' number of previous points. #' #' \code{running} applies the specified function to a sequential windows on #' \code{X} and (optionally) \code{Y}. If \code{Y} is specified the function #' must be bivariate. #' #' @param X data vector #' @param Y data vector (optional) #' @param fun Function to apply. Default is \code{mean} #' @param width Integer giving the number of vector elements to include in the #' subsets. Defaults to the lesser of the length of the data and 20 elements. #' @param allow.fewer Boolean indicating whether the function should be #' computed for subsets with fewer than \code{width} points #' @param pad Boolean indicating whether the returned results should be #' 'padded' with NAs corresponding to sets with less than \code{width} #' elements. This only applies when when \code{allow.fewer} is FALSE. #' @param align One of "right", "center", or "left". This controls the #' relative location of `short' subsets with less then \code{width} elements: #' "right" allows short subsets only at the beginning of the sequence so that #' all of the complete subsets are at the end of the sequence (i.e. `right #' aligned'), "left" allows short subsets only at the end of the data so that #' the complete subsets are `left aligned', and "center" allows short subsets #' at both ends of the data so that complete subsets are `centered'. #' @param simplify Boolean. If FALSE the returned object will be a list #' containing one element per evaluation. If TRUE, the returned object will be #' coerced into a vector (if the computation returns a scalar) or a matrix (if #' the computation returns multiple values). Defaults to FALSE. #' @param by Integer separation between groups. If \code{by=width} will give #' non-overlapping windows. Default is missing, in which case groups will start #' at each value in the X/Y range. #' @param \dots parameters to be passed to \code{fun} #' @return List (if \code{simplify==TRUE}), vector, or matrix containing the #' results of applying the function \code{fun} to the subsets of \code{X} #' (\code{running}) or \code{X} and \code{Y}. #' #' Note that this function will create a vector or matrix even for objects #' which are not simplified by \code{sapply}. #' @author Gregory R. Warnes \email{greg@@warnes.net}, with contributions by #' Nitin Jain \email{nitin.jain@@pfizer.com}. #' @seealso \code{\link[gplots]{wapply}} to apply a function over an x-y window #' centered at each x point, \code{\link[base]{sapply}}, #' \code{\link[base]{lapply}} #' @keywords misc #' @examples #' #' #' # show effect of pad #' running(1:20, width = 5) #' running(1:20, width = 5, pad = TRUE) #' #' # show effect of align #' running(1:20, width = 5, align = "left", pad = TRUE) #' running(1:20, width = 5, align = "center", pad = TRUE) #' running(1:20, width = 5, align = "right", pad = TRUE) #' #' # show effect of simplify #' running(1:20, width = 5, fun = function(x) x) # matrix #' running(1:20, width = 5, fun = function(x) x, simplify = FALSE) # list #' #' # show effect of by #' running(1:20, width = 5) # normal #' running(1:20, width = 5, by = 5) # non-overlapping #' running(1:20, width = 5, by = 2) # starting every 2nd #' #' #' # Use 'pad' to ensure correct length of vector, also show the effect #' # of allow.fewer. #' par(mfrow = c(2, 1)) #' plot(1:20, running(1:20, width = 5, allow.fewer = FALSE, pad = TRUE), type = "b") #' plot(1:20, running(1:20, width = 5, allow.fewer = TRUE, pad = TRUE), type = "b") #' par(mfrow = c(1, 1)) #' #' # plot running mean and central 2 standard deviation range #' # estimated by *last* 40 observations #' dat <- rnorm(500, sd = 1 + (1:500) / 500) #' plot(dat) #' sdfun <- function(x, sign = 1) mean(x) + sign * sqrt(var(x)) #' lines(running(dat, width = 51, pad = TRUE, fun = mean), col = "blue") #' lines(running(dat, width = 51, pad = TRUE, fun = sdfun, sign = -1), col = "red") #' lines(running(dat, width = 51, pad = TRUE, fun = sdfun, sign = 1), col = "red") #' #' #' # plot running correlation estimated by last 40 observations (red) #' # against the true local correlation (blue) #' sd.Y <- seq(0, 1, length = 500) #' #' X <- rnorm(500, sd = 1) #' Y <- rnorm(500, sd = sd.Y) #' #' plot(running(X, X + Y, width = 20, fun = cor, pad = TRUE), col = "red", type = "s") #' #' r <- 1 / sqrt(1 + sd.Y^2) # true cor of (X,X+Y) #' lines(r, type = "l", col = "blue") #' @importFrom methods new #' @export running <- function(X, Y = NULL, fun = mean, width = min(length(X), 20), allow.fewer = FALSE, pad = FALSE, align = c("right", "center", "left"), simplify = TRUE, by, # added a parameter ...) { align <- match.arg(align) n <- length(X) if (align == "left") { from <- 1:n to <- pmin((1:n) + width - 1, n) } else if (align == "right") { from <- pmax((1:n) - width + 1, 1) to <- 1:n } else # align=="center" { from <- pmax((2 - width):n, 1) to <- pmin(1:(n + width - 1), n) if (!odd(width)) stop("width must be odd for center alignment") } elements <- apply(cbind(from, to), 1, function(x) seq(x[1], x[2])) if (is.matrix(elements)) { elements <- as.data.frame(elements) } # ensure its a list! names(elements) <- paste(from, to, sep = ":") if (!allow.fewer) { len <- sapply(elements, length) skip <- (len < width) } else { skip <- 0 } run.elements <- elements[!skip] if (!invalid(by)) { run.elements <- run.elements[seq( from = 1, to = length(run.elements), by = by )] } if (is.null(Y)) # univariate { funct.uni <- function(which, what, fun, ...) fun(what[which], ...) if (simplify) { Xvar <- sapply(run.elements, funct.uni, what = X, fun = fun, ...) } else { Xvar <- lapply(run.elements, funct.uni, what = X, fun = fun, ...) } } else # bivariate { funct.bi <- function(which, XX, YY, fun, ...) fun(XX[which], YY[which], ...) if (simplify) { Xvar <- sapply(run.elements, funct.bi, XX = X, YY = Y, fun = fun, ...) } else { Xvar <- lapply(run.elements, funct.bi, XX = X, YY = Y, fun = fun, ...) } } if (allow.fewer || !pad) { return(Xvar) } if (simplify) { if (is.matrix(Xvar)) { wholemat <- matrix(new(class(Xvar[1, 1]), NA), ncol = length(to), nrow = nrow(Xvar) ) colnames(wholemat) <- paste(from, to, sep = ":") wholemat[, -skip] <- Xvar Xvar <- wholemat } else { wholelist <- rep(new(class(Xvar[1]), NA), length(from)) names(wholelist) <- names(elements) wholelist[names(Xvar)] <- Xvar Xvar <- wholelist } } return(Xvar) } gtools/R/invalid.R0000644000176200001440000000206214261670123013535 0ustar liggesusers#' Test if a value is missing, empty, contains only NA or NULL values, or is a try-error. #' #' Test if a value is missing, empty, contains only NA or NULL values, or is a try-error. #' #' #' @param x value to be tested #' @return Logical value. #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link[base]{missing}}, \code{\link[base]{is.na}}, #' \code{\link[base]{is.null}} #' @keywords programming #' @examples #' #' #' invalid(NA) #' invalid() #' invalid(c(NA, NA, NULL, NA)) #' #' invalid(list(a = 1, b = NULL)) #' #' x <- try(log("A")) #' invalid(x) #' #' # example use in a function #' myplot <- function(x, y) { #' if (invalid(y)) { #' y <- x #' x <- 1:length(y) #' } #' plot(x, y) #' } #' myplot(1:10) #' myplot(1:10, NA) #' @importFrom methods is #' #' @export invalid <- function(x) { if (missing(x) || is.null(x) || length(x) == 0 || is(x, "try-error")) { return(TRUE) } if (is.list(x)) { return(all(sapply(x, invalid))) } else if (is.vector(x)) { return(all(is.na(x))) } else { return(FALSE) } } gtools/R/mixedsort.R0000644000176200001440000002141114322256657014136 0ustar liggesusers#' Order or Sort strings with embedded numbers so that the numbers are in the #' correct order #' #' 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. "Aspirin 50mg" will come before "Aspirin 100mg". In addition, #' case of character strings is ignored so that "a", will come before "B" and #' "C". #' #' 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}. #' #' 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}. #' #' @aliases mixedsort mixedorder #' @param x Vector to be sorted. #' @param 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}. #' @param 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. #' @param 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. #' @param 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"})? #' @param roman.case one of "upper", "lower", or "both". Are roman numerals #' represented using only capital letters ('IX') or lower-case letters ('ix') #' or both? #' @param scientific logical. Should exponential notation be allowed for numeric values. #' @return \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@@warnes.net} #' @seealso \code{\link[base]{sort}}, \code{\link[base]{order}} #' @keywords univar manip #' @examples #' #' ## compound & dose labels #' Treatment <- c( #' "Control", "Aspirin 10mg/day", "Aspirin 50mg/day", #' "Aspirin 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 #' #' ## 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) #' #' ## Control scientific notation for number matching: #' vals <- c("3E1", "2E3", "4e0") #' #' mixedsort(vals) # With scientfic notation #' mixedsort(vals, scientific = FALSE) # Without scientfic notation #' @export mixedsort <- function(x, decreasing = FALSE, na.last = TRUE, blank.last = FALSE, numeric.type = c("decimal", "roman"), roman.case = c("upper", "lower", "both"), scientific = TRUE) { ord <- mixedorder(x, decreasing = decreasing, na.last = na.last, blank.last = blank.last, numeric.type = numeric.type, roman.case = roman.case, scientific = scientific ) x[ord] } #' @rdname mixedsort #' @export mixedorder <- function(x, decreasing = FALSE, na.last = TRUE, blank.last = FALSE, numeric.type = c("decimal", "roman"), roman.case = c("upper", "lower", "both"), scientific = TRUE) { # - 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) { return(1) } if (!is.character(x)) { return(order(x, decreasing = decreasing, na.last = na.last)) } delim <- "\\$\\@\\$" if (numeric.type == "decimal") { if (scientific) { regex <- "((?:(?i)(?:[-+]?)(?:(?=[.]?[0123456789])(?:[0123456789]*)(?:(?:[.])(?:[0123456789]{0,}))?)(?:(?:[eE])(?:(?:[-+]?)(?:[0123456789]+))|)))" } # uses PERL syntax else { regex <- "((?:(?i)(?:[-+]?)(?:(?=[.]?[0123456789])(?:[0123456789]*)(?:(?:[.])(?:[0123456789]{0,}))?)))" } # 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(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(regex, paste(delim, "\\1", delim, sep = ""), x, perl = TRUE ) # separate out numbers step1 <- strsplit(delimited, delim) # remove empty elements step1 <- lapply(step1, function(x) x[x > ""]) # create numeric version of data suppressWarnings(step1.numeric <- lapply(step1, numeric)) # create non-numeric version of data suppressWarnings(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) } gtools/R/addLast.R0000644000176200001440000000023514261670123013463 0ustar liggesusers# @export addLast <- function(fun) { .Defunct( new = paste(".Last <- lastAdd(", deparse(substitute(fun)), ")", sep = ""), package = "gtools" ) } gtools/R/stat_mode.R0000644000176200001440000000514314437664036014104 0ustar liggesusers#' Most frequently occurring value #' #' @param x vector of values #' @param na.rm logical. Should \code{NA} values be removed before processing? #' @param ties character. Which value(s) should be returned in the case of ties? #' @param \dots optional additional parameters. #' #' @return vector of the same class as \code{x} #' #' @author Genei Ryodan and Gregory R. Warnes \email{greg@warnes.net}. #' #' @examples #' #' # Character vector #' chr_vec <- c("a", "d", "d", "h", "h", NA, NA) # Multiple modes #' stat_mode(x = chr_vec) #' stat_mode(x = chr_vec, na.rm = FALSE) #' stat_mode(x = chr_vec, na.rm = FALSE, ties = "first") #' stat_mode(x = chr_vec, na.rm = FALSE, ties = "last") #' #' # - # Numeric vector #' # See that it keeps the original vector type #' num_vec <- c(2, 3, 3, 4, 4, NA, NA) #' stat_mode(x = num_vec) #' stat_mode(x = num_vec, na.rm = FALSE) #' stat_mode(x = num_vec, na.rm = FALSE, ties = "first") #' stat_mode(x = num_vec, na.rm = FALSE, ties = "last") #' #' # The default option is ties="all" but it is very easy for the user to control #' # the ties without changing this parameter. #' # Select always just one mode, being that the first mode #' stat_mode(x = num_vec)[1] #' #' # Select the first and the second stat_mode #' stat_mode(x = num_vec)[c(1, 2)] #' #' # Logical Vectors #' stat_mode(x = c(TRUE, TRUE)) #' stat_mode(x = c(FALSE, FALSE, TRUE, TRUE)) #' #' # - # Single element cases #' stat_mode(x = c(NA_real_)) #' stat_mode(x = 2) #' stat_mode(x = NA) #' stat_mode(x = c("a")) #' #' # Not allowing multiple stat_mode, returning NA if that happens #' stat_mode(x = c(1, 1, 2, 2), multiple_modes = FALSE) # multiple stat_mode #' stat_mode(x = c(1, 1), multiple_modes = FALSE) # single mode #' #' # Empty vector cases #' # The ties of any empty vector will be itself (an empty vector of the same type) #' stat_mode(x = double()) #' stat_mode(x = complex()) #' stat_mode(x = vector("numeric")) #' stat_mode(x = vector("character")) #' @importFrom stats na.omit #' @export stat_mode <- function(x, na.rm = TRUE, ties = c("all", "first", "last", "missing"), ...) { ties <- match.arg(ties) if (na.rm) { uv <- unique(na.omit(x)) } else { uv <- unique(x) } tab <- tabulate(match(x, uv)) all_modes <- uv[tab == max(tab)] if (length(all_modes) > 1) { if (ties == "first") { return(all_modes[1]) } else if (ties == "last") { return(all_modes[length(all_modes)]) } else if (ties == "all") { return(all_modes) } # ties=="missing" else { return(NA) } } else { return(all_modes) } } gtools/R/split_path.R0000644000176200001440000000163014261670123014256 0ustar liggesusers#' Split a File Path into Components #' #' @description This function converts a character scalar containing a #' \emph{valid} file path into a character vector of path components #' (e.g. directories). #' #' @param x character scalar. Path to be processed. #' @param depth_first logical. Should path be returned depth first? Defaults #' to \code{TRUE}. #' #' @return Character vector of path components, depth first. #' #' @export #' split_path <- function(x, depth_first = TRUE) { if (length(x) > 1) { warning( "This function is not vectorized.", "Only processing the first element of x." ) } retval <- split_path_inner(x) if (!depth_first) { retval <- rev(retval) } retval[retval > ""] } split_path_inner <- function(path) { if (dirname(path) %in% c(".", path)) { return(basename(path)) } return(c(basename(path), split_path_inner(dirname(path)))) } gtools/R/gtools-deprecated.R0000644000176200001440000000075214261670123015520 0ustar liggesusers#' Deprecated Functions in the gtools package #' #' These functions are provided for compatibility with older versions of #' gtools, and may be defunct as soon as the next release. #' #' gtools currently contains no deprecated functions. #' #' % The original help page for these functions is often % available at #' \code{help("oldName-deprecated")} (note the quotes). % % \itemize{ % \item{} #' % } #' #' @seealso \code{\link{Deprecated}} #' @keywords misc #' @name gtools-deprecated NULL gtools/R/gtools-defunct.R0000644000176200001440000000217214261670123015046 0ustar liggesusers#' Defunct Functions in package \code{gtools} #' #' The functions or variables listed here are no longer part of package #' \code{gtools}. #' #' @param expression,collapse,x,\dots ignored #' #' @details #' #' \itemize{ #' \item \code{assert} is a defunct synonym for \code{\link[base]{stopifnot}}. #' \item \code{addLast} has been replaced by \code{lastAdd}, which has the same #' purpose but applied using different syntax. #' \item \code{capture} and \code{capture.output} have been removed in favor of #' \code{capture.output} from the \code{utils} package. #' } #' #' @aliases gtools-defunct assert addLast capture sprint #' #' @seealso #' \code{\link[base]{Defunct}}, #' \code{\link[base]{stopifnot}}, #' \code{\link[gtools]{lastAdd}}, #' \code{\link[utils]{capture.output}} #' @keywords misc #' #' @rdname gtools-defunct #' @export assert <- function(...) { .Defunct("stopifnot", "base") } #' #' @rdname gtools-defunct #' @export capture <- function(expression, collapse = "\n") { .Defunct("capture.output", "base") } #' @rdname gtools-defunct #' @export sprint <- function(x, ...) { .Defunct("capture.output", "base") } gtools/R/scat.R0000644000176200001440000000151514261670123013043 0ustar liggesusers#' Display debugging text #' #' If \code{getOption('DEBUG')==TRUE}, write text to STDOUT and flush so that #' the text is immediately displayed. Otherwise, do nothing. #' #' #' @param \dots Arguments passed to \code{cat} #' @return NULL (invisibly) #' @author Gregory R. Warnes \email{greg@@warnes.net} #' @seealso \code{\link[base]{cat}} #' @keywords print #' @examples #' #' options(DEBUG = NULL) # makee sure DEBUG isn't set #' scat("Not displayed") #' #' options(DEBUG = TRUE) #' scat("This will be displayed immediately (even in R BATCH output \n") #' scat("files), provided options()$DEBUG is TRUE.") #' @export scat <- function(...) { DEBUG <- options()$DEBUG if (!is.null(DEBUG) && DEBUG) { cat("### ", file = stderr()) cat(..., file = stderr()) cat(" ###\n", file = stderr()) flush(stderr()) } invisible(NULL) } gtools/NEWS.md0000644000176200001440000002742514526256036012702 0ustar liggesusersgtools 3.9.5 - 2023-11-20 -------------------------- - make `checkRVersion()` robust to internet failure/CRAN outages gtools 3.9.4 - 2022-11-27 ------------------------- - correct `stars.pval` code/doc mismatch (GH #13) - remove spurious `browser()` call in `lastAdd` gtools 3.9.3 - 2022-07-08 ------------------------- - maintainer switch to Ben Bolker - removed `assignEdgewise`/`unByteCodeAssign` (uses CRAN-deprecated `unlockBindings()` call) gtools 3.9.2 - 2021-06-03 ------------------------- Bug fixes: - Fix missing man page and export for `combinations` and `permutations`. Behind the scenes: - Fixed more spelling/typographical errors, mostly in `NEWS.md`. - Speed up `checkRVersion` by removing checks for versions 2.x and 3.x. gtools 3.9.1 - 2021-06-01 ------------------------- Bug fixes: - Use valid HTTP request for example in `setTCPNoDelay` to prevent errors when running tests. Behind the scenes: - Fixed numerous spelling/typographical errors. - Update obsolete http URLs to https gtools 3.9.0 - 2021-05-31 ------------------------- New functions: - New `script_file` and `script_path` functions to obtain the directory or full path to the currently executing script. - New 'stat_mode` function to calculate the statistical mode (most frequently occurring value). - New `capwords` function to apply title capitalization rules to a character vector. - Move `baseOf` from `gplots` as requested by Steffen Möller. #2 New parameters: - Add `scientific` parameter to `mixedsort` and `mixedorder` to control whether numbers in scientific notation are recognized. Resolved #7. - Enhance `invalid` to detect `try-error` objects. #6 Bug fixes: - Add support for R version 4 to `checkRVersion`. Resolved #5. - Correct bug in `lastAdd` by explicitly checking for a `.Last` of mode function. Behind the scenes: - Modernize package code by using `roxygen2` for documentation and managing the NAMESPACE. - Modernize C function registration. - Replace http URLs with `https` and resolve broken links. - Add github actions to automated testing - Use pkgdown to generate HTML documentation. - Use `styler` package to standardize R code formatting. gtools 3.8.2 - 2020-03-23 ------------------------- Minor changes to support R 4.0 gtools 3.8.1 - 2018-06-21 ------------------------- Behind the scenes: - Remove softlinks per request from Uwe Ligges gtools 3.8.0 - 2018-06-20 ------------------------- New functions: - spit_path(): converts a file path into a vector of path components - baseOf(): Transform an integer to an array of base-n digits Behind the scenes: - Update C calls to use correct 'PACKAGE=' parameter. - Explicitly register C routines used by the package - Update link for taxise::taxize_capwords in gtools::capwords man page - Corrections to typographical errors gtools 3.7.0 - 2017-06-14 ------------------------- New functions: - Add capwords() function to apply standard capitalization rules to a character string. Enhancements: - Add 'con' argument to ask() to allow specification of the connection to query for input. For use under RStudio, use ask(..., con=file('stdin')). - R/na.replace.R, man/na.replace.Rd: na.replace() now accepts a function to provide the replacement value. - smartbind() has a new argument 'list' to pass a list of data frames, /instead of/in addition to/ data frames as arguments. - Internal changes to bring code up to current CRAN guidelines. Bug Fixes: - smartbind() now works properly with empty column names - Correct error in smartbind() when column types don't match. - Fix bug in smartbind's handling of factor levels. - Improve assignment of default names in smartbind(). - loadedPackages() to return data silently so that the results don't get printed twice. gtools 3.5.0 - 2015-04-28 ------------------------- New Functions: - New roman2int() function 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 function to an interpreted code function. - New assignEdgewise() function for making assignments into locked environments. (Used by unByteCodeAssign().) Enhancements: - mixedsort() and mixedorder() now have arguments 'decreasing', 'na.last', and 'blank.last' arguments to control sort ordering. - mixedsort() and mixedorder() 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.) Bug fixes: - 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. gtools 3.4.2 - 2015-04-06 ------------------------- New features: - New function loadedPackages() to display name, version, and path of loaded packages (package namespaces). - New function: na.replace() to replace missing values within a vector with a specified value.` Bug fixes: - Modify keywords() to work properly in R 3.4.X and later. gtools 3.4.1 - 2014-05-27 ------------------------- Bug fixes: - smartbind() now converts all non-atomic type columns (except factor) to type character instead of generating an opaque error message. Other changes: - the argument to ASCIIfy() is now named 'x' instead of 'string'. - minor formatting changes to ASCIIfy() man page. gtools 3.4.0 - 2014-04-14 ------------------------- New features: - New ASCIIfy() function to converts character vectors to ASCII representation by escaping them as \x00 or \u0000 codes. Contributed by Arni Magnusson. gtools 3.3.1 - 2014-03-01 ------------------------- Bug fixes: - 'mixedorder' (and hence 'mixedsort') not properly handling single-character strings between numbers, so that '1a2' was being handled as a single string rather than being properly handled as c('1', 'a', '2'). gtools 3.3.0 - 2014-02-11 ------------------------- New features: - Add the getDependencies() function to return a list of dependencies for the specified package(s). Includes arguments to control whether these dependencies should be constructed using information from locally installed packages ('installed', default is TRUE), available CRAN packages ('available', default is TRUE) and whether to include base ('base', default=FALSE) and recommended ('recommended', default is FALSE) packages. Bug fixes: - binsearch() was returning the wrong endpoint & value when the found value was at the upper endpoint. gtools 3.2.1 - 2014-01-13 ------------------------- Bug fixes: - Resolve circular dependency with gdata gtools 3.2.0 - 2014-01-11 ------------------------- New features: - The keywords() function now accepts a function or function name as an argument and will return the list of keywords associated with the named function. - New function stars.pval() which will generate p-value significance symbols ('***', '**', etc.) Bug fixes: - R/mixedsort.R: mixedorder() was failing to correctly handle numbers including decimals due to a faulty regular expression. Other changes: - capture() and sprint() are now defunct. gtools 3.1.1 - 2013-11-06 ------------------------- Bug fixes: - Fix problem with mixedorder/mixedsort when there is zero or one elements in the argument vector. gtools 3.1.0 - 2013-09-22 ------------------------- Major changes: - The function 'addLast()' (deprecated since gtools 3.0.0) is no longer available, and has been marked defunct. Bug fixes: - Modified 'mixedorder()' to use Use 'suppressWarnings() instead of 'options(warn=-1)'. This will avoid egregious warning messages when called from within a nested environment, such as when run from within 'knitr' gtools 3.0.0 - 2013-07-06 ------------------------- Major changes: - The function 'addLast()' has been deprecated because it directly manipulates the global environment, which is expressly prohibited by the CRAN policies. - A new function, 'lastAdd()' has been created to replace 'addLast()'. The name has been changed because the two functions require different syntax. 'addLast()' was used like this: byeWorld <- function() cat("\nGoodbye World!\n") addLast(byeWorld) The new 'lastAdd()' function is used like this: byeWorld <- function() cat("\nGoodbye World!\n") .Last <- lastAdd(byeWorld) Bug fixes: - Update checkRVersion() to work with R version 3.0.0 and later. Other changes: - Remove cross-reference to (obsolete?) `moc` package - The function 'assert()' (deprecated since gtools 2.5.0) is no longer available and has been marked defunct. gtools 2.7.1 - 2013-03-17 ------------------------- Bug fixes: - smartbind() was not properly handling factor columns when the first data frame did not include the relevant column. gtools 2.7.0 - 2012-06-19 ------------------------- New features: - smartbind() has a new 'sep' argument to allow specification of the character(s) used to separate components of constructed column names - smartbind() has a new 'verbose' argument to provide details on how columns are being processed Bug fixes: - smartbind() has been enhanced to improve handling of factor and ordered factor columns. gtools 2.6.2 - 2011-09-28 ------------------------- New features: - Add 'fill' argument to smartbind() to specify a value to use for missing entries. gtools 2.6.1 ------------ New features: - Add newVersionAvailable() function to compare running and latest available R versions. - Add keywords() function to show $RHOME/doc/KEYWORDS file Bug fixes: - Correct windows make flags as suggested by Brian Ripley. - Update Greg's email address and fix Rd syntax errors gtools 2.5.0 ------------ New features: - Add checkRVersion() function to determine if a newer version of R is available. - Deprecated assert() in favor of base::stopifnot Bug fixes: - Fix bug in binsearch() identified by 2.6.0 R CMD CHECK Other changes: - Improve text explanation of how defmacro() and strmacro() differ from function(). - Update definitions of odd() and even() to use modulus operator instead of division. gtools 2.4.0 ------------ - Add binsearch() function, previously in the genetics() package. gtools 2.3.1 ------------ - Add ask() function to prompt the user and collect a single response. gtools 2.3.0 ------------ - Update email address for Greg - Add new 'smartbind' function, which combines data frames efficiently, even if they have different column names. gtools 2.2.3 ------------ - setTCPNoDelay now compiles & works properly on Windows gtools 2.2.2 ------------ - src/setTCPNoDelay.c: Add C source code for setTCPNoDelay. - NAMESPACE: Add UseDynLib to NAMESPACE so the shared library gets properly loaded. - Updated Greg's email address. gtools 2.2.1 ------------ - New function 'addLast' that adds functions to R's .Last() so that they will be executed when R is terminating. - New function setTCPNoDelay() that allows the TCP_NODELAY flag to be changed on socket objects. gtools 2.1.0 ------------ - Added assert.R (and documentation) - Added 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/} - Added DESCRIPTION and removed DESCRIPTION.in gtools/MD50000644000176200001440000001175214526673315012113 0ustar liggesusers75c40aa58ce61c005172af9dad043d5a *ChangeLog 92dfaa94b9429bd00f91509f727fac2d *DESCRIPTION e85fcfb5185a7bc0eb4d69f81b87ec8d *NAMESPACE fd4868aa0b9f9379750ab324582d7cf4 *NEWS.md 53b46bd25ac12b764f1042c52e2236e0 *R/ASCIIfy.R cb7b52260993b006a114f44f52b4de58 *R/ELISA.R c7439880e04ec478796740ff3c879863 *R/addLast.R b72995481bbbee81d0316b8d682ebcf6 *R/asc.R 60f9991ec41a1a89c34b0a9e567badce *R/ask.R 108488408a6591c42b775a491a5c6563 *R/badDend.R 593b68f8aff8a5c1e059d6b0c54f85ac *R/baseOf.R 478f08804741b62f983f817345a59969 *R/binsearch.R e2f2c071d3199dc102d3345f3096f9e8 *R/capwords.R d1ac1f01626ef796d3329cee5757d738 *R/checkRVersion.R 2a9186215cfc458bfd3b13ce6a624a17 *R/clean_up_dependencies2.R aa43a886428c4378762f6d807448fdbb *R/combinations.R 642c945c10dfd68cfc8dbaee456ad9c8 *R/defmacro.R 56443735530dfdffd1efd78ec3faf55e *R/dirichlet.R ff2d83ae32aa475a16ebcb443b50548f *R/foldchange.R 350c8ce7901074fd544269ae4ea1bf62 *R/getDependencies.R 1e7eed23f1240834044724358762a30f *R/gtools-defunct.R e7adbcb8e561ba767dedb21a69d24bde *R/gtools-deprecated.R ae4caf75e4901ab9a5ec826364f0843f *R/gtools-package.R cb5e5ff1d841c0b7708c6a6f4771a98e *R/invalid.R 807b91bbd5b29aede82105762883665e *R/keywords.R 2313cb4a687105d4ca1bfdd2ad9475a7 *R/lastAdd.R 6bead577f11ffba9fb4dbe9fa838f993 *R/loadedPackages.R 02eac79e6b7196829742bc3ae83ed449 *R/logit.R 561628bfd8601835a6ef8cd9970a688a *R/melt_array.R b017b589ab7c5c6ebf7dcc2ffcf5be99 *R/mixedsort.R fe4f7eae7e5f5ff7ba4cb4beff4b56c9 *R/na.replace.R d4bd2b4016ef6417be583d6001b56ca9 *R/oddeven.R 66bc43cfa714e92a3bbbf7be21b92e99 *R/permute.R a4fab10d237b887bb3e7a247e066b134 *R/quantcut.R 5895bb5adcb7575d4357a8459be12e72 *R/roman2int.R 395b8463e911903874e330c9d095f63a *R/running.R 72bc045f01547290830538c1f8d04bbc *R/scat.R 73d91db27fa4c6cffb3e002f52ae0b25 *R/script_file.R e76eac621168004ca4f698e2c15c9856 *R/setTCPNoDelay.R 9ec5a5f406808b6932422bf56468331f *R/smartbind.R a3743f470337f1eeb3591664e0e50225 *R/split_path.R 143e02bdb03679971fd6bb161da80949 *R/stars.pval.R eca2cb9d1ed74061571d3cff57cf0dca *R/stat_mode.R a83bdb26482767035bdf55004add710f *R/strmacro.R 09b934c80549bd2f0eb15d9fa7651f0b *R/trimws.R e461d6106988201e61ca0b8bb8debc67 *R/unByteCode.R cc1b25f8dadb5738a50bc51a6ac9fd74 *README.md d2d2d0444a049d74694203974624835c *data/ELISA.rda 273aa9cfc8e947fe6059a11a4813be57 *data/badDend.rda 75c40aa58ce61c005172af9dad043d5a *inst/ChangeLog fd4868aa0b9f9379750ab324582d7cf4 *inst/NEWS.md e0eb4deecd0ac0986738655ea569075e *inst/WORDLIST 78dac7f2bace279c5dd343b34f2a5537 *man/ASCIIfy.Rd 901bcaef0293d6b874565172d1a19817 *man/ELISA.Rd 2b74b475cce7ef6658085199c11d37b8 *man/asc.Rd 6a1d84494e9d205dc6df0957cf8f7cd8 *man/ask.Rd 09e1120667854c67b543d997511b71e4 *man/badDend.Rd 3e0cdeb6731f6a94308690a786c77a7b *man/baseOf.Rd 2697c0764ba99ee77a1ddd7f71d973d3 *man/binsearch.Rd 45c3e8bc0ac9132957be58b4339ebdff *man/capwords.Rd fed0afac557a8e1dada1ece13a21186e *man/checkRVersion.Rd b6386537169bb097aff8600e0e4c0185 *man/combinations.Rd 2325b364a896514afaa2608cc3808cd6 *man/defmacro.Rd b5b4b5ca7d96c258b2603c8ebf837848 *man/dirichlet.Rd 32cb276b6dcaf4f2afe9e06868a42cfa *man/figures/README-pressure-1.png 4859f05a86e798ef67c76777b8d8e095 *man/foldchange.Rd b88a3bfa444683b009e909734dabacba *man/getDependencies.Rd 2ece8718c568441156f05669480679f9 *man/gtools-defunct.Rd af5ac6f8457c506913d1a4d15639f01d *man/gtools-deprecated.Rd 7efcce4784bcc32e4dd39684e8cf7f01 *man/gtools.Rd f5caa360a891b80c457924d1dda98b20 *man/invalid.Rd 4e4638c76eb049ab821bfd12a520e056 *man/keywords.Rd 60c3c8c75b9db95cacc1b4d502a72955 *man/lastAdd.Rd c2d4132657ce5cc0a377730f69a1774b *man/loadedPackages.Rd af75ba3ea7171fb2102e940d00475bd2 *man/logit.Rd 07dd3c6979b0414ab0af8bec63ce1180 *man/mixedsort.Rd 693f09ac92944af6e8192ae075e451b9 *man/na.replace.Rd 814f55c4844c47535ccfba225320ae63 *man/oddeven.Rd 25a73e998fbfc3cad155be629c1342c1 *man/permute.Rd f665e4e612c6f3e70f45e46159f3faff *man/quantcut.Rd 516520cc41c6956ee1dc1c45a3b5754e *man/roman2int.Rd f7b6c728283731f0a54304b151dbed67 *man/running.Rd 47b4eb5d96c9eff644b7b2f6a2c20afe *man/scat.Rd 1cb4ffb1447fab6cab5d2305440b1ea9 *man/script_file.Rd e623097d49440e92ca8dc6a4feb25d8c *man/setTCPNoDelay.Rd 30046ea847d3d0573e995a3a56094a69 *man/smartbind.Rd df1285c2d8ac320dd13d96081b6cec6a *man/split_path.Rd 6df621bf3e99c04a9eba0e32c56f7784 *man/stars.pval.Rd 98b7fbc0a680a6c0c43aa4e9232bf8b9 *man/stat_mode.Rd 472a858f36a222fc4e271482abeb28aa *man/unByteCode.Rd 8d4158b8eb92153e2d3f581682b2a3c1 *src/Makevars.win 54ef02be1184693da326356b62931083 *src/gtools.h bc88a80217b2641835ed5c09dc7679f0 *src/init.c 165f7394028ce7e5fad92e9f3a14c074 *src/roman2int.c ab21c759bfa25fc8768293d41a0d976e *src/setTCPNoDelay.c 5795eeecf6c27da3e236afb6ad3663c3 *tests/smartbind_Dates.R 01cca7a0cfa026295b8228e30d91eb91 *tests/smartbind_emptynames.R 995e2ecdf37b65281bba05291eea33bb *tests/test_binsearch.R 83eb930e1eeb4e7efb1f33ff5f567aa6 *tests/test_ddirichlet.R 5c88de8837393d66922beae97d2792c8 *tests/test_mixedorder.R 18554c65a8424b195470cd8a1f061642 *tests/test_script_file.R c1413df4905d3f7df66788fc418428d4 *tests/test_setTCPNoDelay.R gtools/inst/0000755000176200001440000000000014526256036012547 5ustar liggesusersgtools/inst/ChangeLog0000644000176200001440000007261214261670123014322 0ustar liggesusers2018-06-19 16:48 warnes * DESCRIPTION, NAMESPACE: Update DESCRIPTION and NAMESPACE for gtools 3.8.0. 2018-06-19 16:43 warnes * R/split_path.R, man/split_path.Rd: Add spit_path() function. 2018-06-19 16:43 warnes * R/baseOf.R, man/baseOf.Rd: Improvements to baseOf() function. 2017-08-23 23:03 warnes * R/baseOf.R, man/baseOf.Rd: Add `baseOf` function and documentation to support updated `gplots::venn` function. (Provided by Steffen Möller.) 2017-08-23 22:59 warnes * R/roman2int.R, R/setTCPNoDelay.R: Use correct 'PACKAGE=' parameter to '.C' calls. 2017-06-14 19:44 warnes * inst/ChangeLog, inst/NEWS: Update NEWS and ChangeLog 2017-06-14 19:42 warnes * DESCRIPTION, NAMESPACE, R/checkRVersion.R, R/newVersionAvailable.R, R/roman2int.R, R/setTCPNoDelay.R, man/combinations.Rd, man/defmacro.Rd, src/gtools.h, src/gtools_load.c, src/setTCPNoDelay.c, tests/test_setTCPNoDelay.R: Explicitly register C routines used by gtools 2017-06-13 00:16 warnes * man/combinations.Rd, man/defmacro.Rd: Update R News URLS 2017-06-12 23:30 warnes * man/capwords.Rd: Update link for taxise::taxize_capwords in gtools::capwords man page 2017-06-12 23:28 warnes * inst/ChangeLog: Fix typos 2017-06-12 23:28 warnes * man/capwords.Rd: Update link for taxise::taxize_capwords in gtools::capwords man page 2017-06-12 23:21 warnes * DESCRIPTION, NAMESPACE, inst/ChangeLog, inst/NEWS: Update meta files for gtools 3.7.0 2017-06-12 22:53 warnes * tests/smartbind_emptynames.R: Fix test for smartbind with empty column names 2017-06-12 22:52 warnes * man/setTCPNoDelay.Rd, tests/test_setTCPNoDelay.R: Add improved example to man page for setTCPnoDelat() and fix test function. 2017-06-12 22:51 warnes * man/ask.Rd: Add 'con' argument to ask() to allow specification of the connection to query for input. 2017-06-12 22:49 warnes * R/capwords.R, man/capwords.Rd: Add capwords() function to apply standard capitalization rules to a scharacter string. 2017-05-23 15:55 warnes * R/ask.R, R/quantcut.R, R/smartbind.R: - Integrate changes made by Mango Solutions at https://github.com/MangoTheCat/SASxport. - Remove functions duplicated from the Hmisc package. - Minor code cleanup. 2016-08-24 19:48 warnes * tests/test_setTCPNoDelay.R: Add more testing code. 2016-08-15 19:17 warnes * inst/ChangeLog: Update ChangeLog 2016-08-15 19:16 warnes * DESCRIPTION: Update version number and date 2016-08-15 19:14 warnes * tests/test_setTCPNoDelay.R: Add test code for setTCPNoDelay 2016-08-15 19:14 warnes * R/setTCPNoDelay.R: Modify setTCPNoDelay to work with current socket objects 2016-08-15 19:13 warnes * src/setTCPNoDelay.c: checkStatus() was not correctly getting the error message. 2016-04-22 16:10 warnes * NAMESPACE, R/capwords.R, man/capwords.Rd: Add capwords() function to properly capatilize strings for use in titles 2016-04-22 16:08 warnes * R/na.replace.R, man/na.replace.Rd: na.replace() now accepts a function providing the replcement value. 2015-11-24 17:58 warnes * R/smartbind.R: Correct error when column types don't match (reported by 2015-10-15 21:15 warnes * R/smartbind.R: smartbind() was not properly handling columsn that were numeric on one df and character in the other and other similar ctype conflicts. Fixed. 2015-08-08 05:01 warnes * tests/smartbind_emptynames.R: Add half-hearted test file 2015-08-08 03:14 warnes * R/smartbind.R: - Improve assignment of default names in smartbind. - Disambiguate 'list' into an object named 'list' and the function base::list() in smartbind(). 2015-08-08 01:47 warnes * DESCRIPTION, man/smartbind.Rd: Add example of using 'list' argument to smartbind() man page. 2015-08-08 01:44 warnes * R/smartbind.R, man/smartbind.Rd: - smartbind() gets a new argument 'list' to pass a list of data frames, instead of/in addition to data frames as arguments. - Fix bug in smartbind's handling of factor levels. 2015-07-14 21:19 warnes * R/loadedPackages.R, man/loadedPackages.Rd: Modify loadedPackages() to return data silently so that the results don't get printed twice. 2015-05-27 17:01 warnes * data/badDend.rda, man/badDend.Rd, man/unByteCode.Rd: Create local dataset to use in the example code for unByteCode instead of relying on web access. 2015-05-27 16:38 warnes * R/trimws.R: Fix missing closing paren. 2015-05-27 16:36 warnes * R/keywords.R, R/roman2int.R, R/trim.R, R/trimws.R: Two functions in gtools need to use either gdata::trim() or base::trimws() (added in R 3.2.0). The previous solution was to include gdata/R/gdata/R/trim.R in gtools using a symbolic link. Unfortunately, Rforge doesn't seem to like the symbolic link when building packages, and generates an error. So, instead, create the file trimws.R, which creates trimws() if it isn't already available (e.g. via base::trimws), and modify keywords() and roman2int() to use trimws() instead of gdata::trim(). 2015-05-27 02:48 warnes * man/roman2int.Rd: Add man page for roman2int(). 2015-05-27 02:29 warnes * man/mixedsort.Rd: Remove extraneous closing paren. 2015-05-27 02:26 warnes * NAMESPACE: Add roman2int() to exported function list. 2015-05-27 02:26 warnes * R/asc.R: Looks like we also lost the change of argument name to chr(). Fixed. 2015-05-27 02:23 warnes * R/asc.R: Somehow lost 'simplify=TRUE' argument to asc. Fixed. 2015-05-27 02:19 warnes * DESCRIPTION: Update gtools version number to 3.5.0 2015-05-27 02:17 warnes * DESCRIPTION, inst/ChangeLog, inst/NEWS: Update DESCRIPTION, ChangeLog, NEWS 2015-05-27 01:37 warnes * R/mixedsort.R, man/mixedsort.Rd: Add roman numeral support to mixedorder() and mixedsort(). 2015-05-27 00:21 warnes * man/asc.Rd: Add asc() and chr() functions for converting between characters and ASCII codes 2015-05-27 00:20 warnes * R/roman2int.R: roman2int() now returns NA for invalid roman numeral strings instead of generating an error. 2015-05-27 00:19 warnes * NAMESPACE: Add asc(), chr(), assignEdgewise(), unByteCode(), and unByteCodeAssign() to package NAMESPACE. 2015-05-27 00:17 warnes * R/asc.R: Add asc() and chr() functions for converting between characters and ASCII codes 2015-05-26 16:22 warnes * inst/ChangeLog: Add changelog to svn repository 2015-05-25 14:30 warnes * tests/test_ddirichlet.R: Add library call. 2015-05-25 14:29 warnes * man/unByteCode.Rd: Fix typo and add documentation for argument 'name'. 2015-05-25 14:29 warnes * man/mixedsort.Rd: Fix typo. 2015-05-25 14:16 warnes * man/mixedsort.Rd: Add description of blanklast argument, fix typo. 2015-05-25 14:13 warnes * man/quantcut.Rd: Change usage to match actual definition. 2015-05-25 14:10 warnes * man/mixedsort.Rd: Note characters sorting ignores case. 2015-05-25 14:08 warnes * man/mixedsort.Rd: Remove '...' from arglist to match source code. 2015-05-25 14:05 warnes * man/mixedsort.Rd: Replace unicode quotes with \code{..}. 2015-05-23 22:21 warnes * 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. 2015-05-23 22:12 warnes * 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 22:49 warnes * R/mixedsort.R: Summary: Speed up mixedorder by moving suppressWarnings outside of lapply loops. (Suggestion by Henrik Bengtsson.) 2015-05-02 17:38 warnes * Rename 'trunk' to 'pkg' for compatibility with R-forge 2015-05-02 13:50 warnes * Minor layout change. 2015-05-02 13:48 warnes * Remove stray 'svn' that was inserted into the code. 2015-05-02 13:47 warnes * Add man page for unByteCode(), assignEdgeWise(), and unByteCodeAssign() 2015-04-28 04:27 warnes * Changes to mixedsort(): - Hands off objects that are not character vectors to the default sort. - Add 'decreasing', 'na.last', and 'blank.last' arguments. 2015-04-28 04:16 warnes * Add private function 'checkReverseDependencies'. 2015-04-23 21:53 warnes * Update NEWS and ChangeLog 2015-04-23 21:47 warnes * - 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.) 2015-04-23 21:10 warnes * Revers accidental text deletion: 2015-04-23 21:09 warnes * Update for gtools 3.4.3 2015-04-23 21:06 warnes * Remove debugging code and stray browser() call 2015-04-14 19:39 warnes * Fix typo 2015-04-09 19:46 warnes * Update gtools ChangeLog 2015-04-09 19:45 warnes * Move first()/last()/left()/right() to gdata. Add new functions na.replace() and loadedPackages(). Add more text to package description. 2015-04-08 19:55 warnes * Move first/last/left/right to from gtools to gdata 2015-04-06 22:09 warnes * Correct URL 2015-04-06 22:04 warnes * Update NEWS and ChangeLog for gtools 3.5.0 2015-04-06 21:52 warnes * Add ChangeLog files to repository 2015-04-06 21:44 warnes * Implement fix to keywords() needed for R-3.4.1, as suggested by Kurt Hornik. 2015-04-06 21:40 warnes * - Export S3 methods for first(), last(), left() and right(). - Ensure code matches man page for first(), last(), left(), and right(). 2014-10-09 18:56 warnes * Update for 3.5.0 release of gtools 2014-10-09 18:52 warnes * Make right() and left() S3 methods for classes data.frame and matrix 2014-08-27 00:44 warnes * Fix man page 2014-08-27 00:36 warnes * Finish adding first(), last(), left(), and right(). 2014-08-27 00:12 warnes * Add functions first(), last(), left(), and right(). 2014-05-28 00:24 warnes * Update for gtools 3.4.1 2014-05-28 00:18 warnes * Add test to ensure smartbind() properly handles Date columns. 2014-05-28 00:14 warnes * smartbind: Convert non-native type columns (except factor) to character. 2014-04-18 18:11 arnima * Main arg is 'x' like showNonASCII(x), preformatted notes instead of verb 2014-04-17 17:33 warnes * Update ASCIIfy man page to match source code and add keywords 2014-04-17 17:25 warnes * Update NEWS for gtools 3.4.0 2014-04-17 16:56 warnes * Add ASCIIfy function posted to RDevel by Arni Magnusson 2014-03-01 20:15 warnes * Fix cut-and-paste error. 2014-03-01 20:12 warnes * Update files for gtools 3.3.1 release 2014-03-01 20:02 warnes * Fix bug in gtools::mixedorder regular expression for regognizing numbers. (Periods weren't escaped). 2014-02-11 17:44 warnes * Create and use locate copy of tools:::.split_op_version. 2014-02-11 17:25 warnes * Update for gtools 3.3.0. 2014-02-11 17:19 warnes * Fix arguments 2014-02-11 17:17 warnes * Update arguments to match code. 2014-02-11 17:14 warnes * Add getDependencies() function to return a list of package dependencies. 2014-01-14 19:43 warnes * Update for bug-fix release 2014-01-14 19:37 warnes * Add test file for binsearch() function. 2014-01-14 15:56 warnes * Fixed bug where binsearch() returned the wrong endpoint & value when the found value was at the upper endpoint. 2014-01-13 18:16 warnes * Fix typo 2014-01-11 23:39 warnes * Update for gtools release 3.2.0 2014-01-11 23:38 warnes * fixes for R CMD check 2014-01-11 23:24 warnes * Fixes for gtools release 3.2.0 2013-12-23 18:48 warnes * Extend the keywords() function to return keywords associated with a specified topic via 'keywords(topic)'. 2013-12-23 16:08 warnes * Add keyword. 2013-12-23 16:04 warnes * Add stars.pval() function to convert p-values into significance symbols. 2013-11-26 14:38 warnes * 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 16:06 warnes * Use ".Deprecated" instead of warning. 2013-11-06 14:53 warnes * Update files for gtools 3.1.1 2013-11-06 14:51 warnes * Fix problem with mixedorder/mixedsort when there is only zero or one elements in the vector. 2013-09-23 15:46 warnes * Comment out empty sections in gtools-deprecated.Rd 2013-09-23 15:41 warnes * Update files for gtools 3.1.0 release 2013-09-23 15:37 warnes * Make 'addLast()' defunct. 2013-09-23 15:29 warnes * Mark 'addLast()' as defunct and move 'lastAdd()' function to a separate file. 2013-09-23 15:23 warnes * Update for gtools 3.0.1 release 2013-09-23 15:19 warnes * Use 'suppressWarnings() instead of 'options(warn=-1)' in 'mixedorder()'. 2013-07-07 00:11 warnes * Fix typo. 2013-07-06 23:55 warnes * Fix Rd warning. 2013-07-06 23:49 warnes * Include lastAdd in NAMESPACE 2013-07-06 23:46 warnes * Change assert from deprecated to defunct. 2013-07-06 23:45 warnes * Improve deprecation message 2013-07-06 23:43 warnes * Update for gtools 3.0.0 2013-07-06 23:26 warnes * Create new function lastAdd to replace addLast and mark addLast as deprecated. 2013-07-05 23:48 warnes * Point out that addLast() modifies the value of .Last in the global environment. 2013-07-05 23:47 warnes * Point out that addLast() modifies the value of .Last in the global environment. 2013-07-05 23:34 warnes * Update for gtools 2.7.2 mark 2 2013-07-05 23:33 warnes * Remove cross-reference to (obsolete?) moc package 2013-07-05 17:31 warnes * Update for gtools 2.7.2 2013-07-05 17:29 warnes * Update for R version 3.0.0 and later 2013-03-17 02:21 warnes * 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 19:00 warnes * Update for gtools 2.7.0. 2012-06-19 14:00 warnes * Document new 'verbose' argument to smartbind(). 2012-06-19 13:56 warnes * Clean up R CMD check warnings. 2012-05-04 16:06 warnes * smartbind(): Improve handling of factors and ordered factors. 2011-10-05 17:05 warnes * Update version number for release 2011-10-05 16:53 warnes * Add 'sep' argument to smartbind() to allow specification of character used to separate components of constructed names 2011-09-28 22:56 warnes * smartbind(): Prevent coersion to data frame from mangling column names. 2011-09-28 22:53 warnes * Add 'fill' argument to smartbind() to specify a value to use for missing entries. 2011-09-28 22:53 warnes * Add 'fill' argument to smartbind() to specify a value to use for missing entries. 2010-08-14 19:28 warnes * 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 22:14 warnes * Update version number for new release 2010-05-01 22:03 warnes * Change Greg's email address to greg@warnes.net 2010-05-01 21:59 warnes * Fix error in checkRVersion() 2010-04-28 17:23 ggrothendieck2 * fixed problems with R CMD CHECK 2009-05-09 03:35 warnes * Escape $ in .Rd file to avoid latex issues 2009-05-09 03:26 warnes * Update NEWS and create softlinks for NEWS and ChangeLog in top level directory 2009-05-09 03:15 warnes * Move actual NEWS file into inst. 2009-05-09 03:13 warnes * Update Greg's email address and fix Rd syntax errors 2009-02-16 15:34 warnes * Correct windows make flags as suggested by Brian Ripley. 2008-08-15 13:15 warnes * Add keywords() function to show /doc/KEYWORDS file 2008-05-29 23:19 warnes * Add newVersionAvailable() function to compare running and latest available R versions 2008-05-26 19:15 warnes * Update license specification 2008-05-26 15:04 warnes * Remove 'assert' man page 2008-05-22 16:40 warnes * Finish rename of assert.R to assert-depricated.Rd 2008-05-22 16:35 warnes * Add checkRVersion.R file 2008-05-22 16:34 warnes * Rename again to get correct extension! 2008-05-22 16:30 warnes * Update NEWS for 2.5.0 2008-05-22 16:17 warnes * Add man page for checkRVersion 2008-05-22 16:16 warnes * Rename assert-deprecated.R to assert.R to meet R file name requirements. 2008-05-22 16:15 warnes * Add checkRVersion to NAMESPACE, and increment version in DESCRIPTION. 2008-05-22 16:14 warnes * Remove broken SEE LSO reference 2008-04-12 19:42 warnes * Improve text explanation of how defmacro() and strmacro() differ from function(). 2008-04-12 19:19 warnes * assert() is now deprecated in favor of base::stopifnot() 2008-04-12 19:19 warnes * Rename 'assert.R' to 'deprecated.R'. 2008-04-12 19:14 warnes * Assert is now deprecated in favor of base::stopifnot(), so add call to .Deprecated() to inform the user. 2007-11-30 18:05 warnes * Update defnitions of odd() and even() to use modulus operator instead of division. Prettier, I think, :-D 2007-08-08 13:52 warnes * Fix bug identified by R-2.6's check routings in binsearch() 2007-08-08 13:48 warnes * Add the binsearch(), previously in the genetics package. 2007-07-18 11:48 ggorjan * typo fixed 2007-04-12 21:16 warnes * Add ask() function to prompt the user and collect a single response. 2007-04-07 13:41 warnes * Fix improper escapes in regexp detected by R 2.5.0 package check. 2007-03-23 22:53 warnes * Allow permutations for r>n provided repeats.allowed=TRUE 2006-11-28 00:53 warnes * Replace F with FALSE in smartbind example. 2006-11-27 22:42 warnes * Replace T with TRUE in smartbind example 2006-11-27 21:40 warnes * Temprary remove to reset binary flag 2006-11-27 21:40 warnes * Temprary remove to reset binary flag 2006-11-27 21:34 warnes * Add smartbind() to list of exported functions, and add corresponding documentation file. 2006-11-27 20:52 warnes * Update my email address 2006-11-14 22:25 ggorjan * Removed executable property 2006-08-02 22:21 warnes * Update my email address 2006-05-05 18:13 nj7w * Fixed minor typo - in {value} - n was replaced by r 2006-05-05 16:55 nj7w * Fixed minor typos 2006-03-01 19:12 warnes * Add smartbind function 2006-01-18 16:28 warnes * Add concept tags to make mixedsort easier to locate. 2005-12-21 15:23 warnes * Update version number and date 2005-12-21 06:11 warnes * Note changes for 2.2.3 2005-12-21 06:08 warnes * Should now work on Windows 2005-12-20 20:25 warnes * Temporary fix to allow setTCPNoDelay.c to compile on Windows. If compiled on windows calling setTCPNoDelay will just raise an error. 2005-12-14 15:48 warnes * Change C++ comment to standard comment 2005-12-13 16:19 nj7w * *** empty log message *** 2005-12-13 16:18 nj7w * Updated NEWS and removed ChangeLog 2005-12-12 22:10 nj7w * Updated version for CRAN release 2005-12-08 20:21 warnes * Add C source code for setTCPNoDelay. 2005-12-01 16:54 nj7w * Updated Greg's email address 2005-11-29 22:30 warnes * Add UseDynLib to NAMESPACE so the shared library gets properly loaded. 2005-11-29 22:25 warnes * - Remove debugging comments - Change return value on success to "Success". 2005-11-22 22:54 warnes * NAMESPACE 2005-11-22 22:54 warnes * Update news for 2.2.1 release. 2005-11-22 22:51 warnes * Fixes for R CMD check 2005-11-22 22:31 warnes * Add setTCPNoDelay() function and documentation 2005-11-22 15:46 warnes * New function 'addLast' that adds functions to R's .Last() so that they will be executed when R is terminating. 2005-09-22 18:12 warnes * More changes for strmacro(), also changes for 2.1.1 release 2005-09-22 17:26 warnes * Add strmaco() which defines functions that use strings for macro definition 2005-09-21 18:51 warnes * Add support for DOTS/... arguments to defmacro 2005-09-12 15:44 nj7w * Updated Greg's email 2005-09-02 22:53 nj7w * Exported assert 2005-09-02 22:53 nj7w * Updated the version number 2005-09-02 22:52 nj7w * Added NEWS 2005-09-02 22:52 nj7w * Added ChangeLog 2005-09-02 22:51 nj7w * Fixed syntax errors 2005-09-02 16:43 warnes * Add assert() and documentation 2005-09-02 16:28 warnes * Fix problem in defmacro.Rd file: don't use \code{} in the example section. 2005-08-31 20:00 warnes * 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/} 2005-08-31 16:18 warnes * Add stand-alone DESCRIPTION file and remove old DESCRIPTION.in file. 2005-06-13 17:08 nj7w * Fixed a bug in mixedsort - check if "which.na" and "which.blank" is numeric(0) before subsetting the datasets. 2005-06-09 14:20 nj7w * Updating the version number, and various help files to synchronize splitting of gregmisc bundle in 4 individual components. 2005-05-10 22:05 warnes * 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 00:28 warnes * - 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 04:19 warnes * Move drop.levels() from gtools to gdata. 2005-04-02 04:17 warnes * Minor reordering of functions in file 2005-04-02 04:14 warnes * Move frameApply() to gdata package. 2005-04-02 03:28 warnes * Fix error if only one value passed to mixedorder. 2005-04-02 02:37 warnes * Add proper handling where more than one quantile obtains the same value 2005-04-01 23:00 warnes * Add CVS ID tag to file headers. 2005-04-01 23:00 warnes * Fixes from Jim Rogers for R CMD check problems in frameApply 2005-03-31 19:03 warnes * Updates to drop.levels() and frameApply() from Jim Rogers 2005-03-31 19:01 warnes * Add ELISA data set used by frameApply and drop.levels examples 2005-02-25 23:02 warnes * Replace 'T' with TRUE. 2005-02-25 22:54 warnes * Remove dependency on ELISA data set for the example. 2005-02-25 21:00 warnes * Add drop.levels, frameApply to namespace export. 2005-02-15 00:41 warnes * Add frameApply and drop.levels contributed by Jim Rogers. 2005-01-12 20:50 warnes * 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 21:01 warneg * Updated to pass R CMD check. 2004-09-03 17:27 warneg * initial bundle checkin 2004-09-02 17:14 warneg * Initial revision 2004-08-27 21:57 warnes * Fixed bug in mixedsort, and modified reorder.factor to use mixedsort. 2004-08-26 20:08 warnes * - 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 15:49 warnes * Nitin Jain added by= parameter to allow specifying separation between groups. 2004-05-26 13:40 warnes * Escape underscores in email addresses so Latex is happy. 2004-05-26 13:18 warnes * Replace 'T' with 'TRUE' to pass R CMD check. 2004-05-25 17:11 warnes * Remove extraneous comments. 2004-05-25 17:08 warnes * 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 17:36 warnes * Check if argument is a vector before doing is.na to avoid generating a warning. 2004-05-24 17:17 warnes * Add invalid() function for testing if a parameter value is non-missing, non-NA, non-NULL. 2004-04-27 14:33 warnes * Replaced argument `as.list' with `simplify'. Updated documentation, and updated examples appropriately. 2004-04-26 16:37 warnes * Added as.list argument to return one list element per evaluation. 2004-03-26 22:21 warnes * Uncomment and fix large 'n' example. 2004-03-26 22:19 warnes * - Update to match changes in running() - Add examples to illustrate new arguments. - Modify running correlation plot example to be more clear. 2004-03-26 22:12 warnes * More of the same. 2004-03-26 15:34 warnes * 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 04:31 warnes * - 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 02:46 warnes * - match function argument defaults with 'usage' 2003-11-21 23:00 warnes * Removed 'deqn' call that was confusing things. 2003-11-21 20:54 warnes * Add email address to author field 2003-11-21 20:35 warnes * - new files 2003-11-21 19:54 warnes * - Change 'T' to 'TRUE' in mixedsort.R - Add missing brace in mixedsort.Rd 2003-11-20 15:56 warnes * - Move 'odd' and 'even' functions to a separate file & provide documentation 2003-11-18 22:47 warnes * - Renamed smartsort to mixedsort and added documentation. 2003-11-10 22:11 warnes * - Add files contributed by Arni Magnusson . As well as some of my own. 2003-05-23 18:14 warnes * - 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 16:00 warnes * - Fixed tpyo in example that allowed combinations(500,2) to run when it should have been ignred for testing.. 2003-04-10 16:22 warnes * - 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 19:37 warnes * - 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 00:51 warneg * Checkin for version 0.5.3 2002-03-26 14:49 warneg * Initial Checkin 2002-03-26 14:29 warneg * Initial checkin. 2002-03-20 03:44 warneg * - Added definition of is.R function. - Added boxplot.formula 2002-03-07 23:39 warneg * - Added documentation and example for running2 2002-03-07 23:38 warneg * - Added "running2", which handles both univariate and bivariate cases - Modified "running" to call "running2" 2002-02-05 02:20 warneg * - Fix typo that caused code meant to run only under S-Plus to run under R, causing problems. 2001-12-19 22:45 warneg * - Added code for %in%. 2001-09-18 14:15 warneg * Release 0.3.2 2001-09-01 19:19 warneg * Initial checkin. 2001-09-01 00:01 warneg * Release 0.3.0 2001-08-25 05:53 warneg * Initial CVS checkin. 2001-08-25 05:50 warneg * Fixed a typo and a syntax error. 2001-08-25 03:59 warneg * Initial Checkin 2001-06-29 13:24 warneg * Initial revision. gtools/inst/NEWS.md0000644000176200001440000002742514526256036013657 0ustar liggesusersgtools 3.9.5 - 2023-11-20 -------------------------- - make `checkRVersion()` robust to internet failure/CRAN outages gtools 3.9.4 - 2022-11-27 ------------------------- - correct `stars.pval` code/doc mismatch (GH #13) - remove spurious `browser()` call in `lastAdd` gtools 3.9.3 - 2022-07-08 ------------------------- - maintainer switch to Ben Bolker - removed `assignEdgewise`/`unByteCodeAssign` (uses CRAN-deprecated `unlockBindings()` call) gtools 3.9.2 - 2021-06-03 ------------------------- Bug fixes: - Fix missing man page and export for `combinations` and `permutations`. Behind the scenes: - Fixed more spelling/typographical errors, mostly in `NEWS.md`. - Speed up `checkRVersion` by removing checks for versions 2.x and 3.x. gtools 3.9.1 - 2021-06-01 ------------------------- Bug fixes: - Use valid HTTP request for example in `setTCPNoDelay` to prevent errors when running tests. Behind the scenes: - Fixed numerous spelling/typographical errors. - Update obsolete http URLs to https gtools 3.9.0 - 2021-05-31 ------------------------- New functions: - New `script_file` and `script_path` functions to obtain the directory or full path to the currently executing script. - New 'stat_mode` function to calculate the statistical mode (most frequently occurring value). - New `capwords` function to apply title capitalization rules to a character vector. - Move `baseOf` from `gplots` as requested by Steffen Möller. #2 New parameters: - Add `scientific` parameter to `mixedsort` and `mixedorder` to control whether numbers in scientific notation are recognized. Resolved #7. - Enhance `invalid` to detect `try-error` objects. #6 Bug fixes: - Add support for R version 4 to `checkRVersion`. Resolved #5. - Correct bug in `lastAdd` by explicitly checking for a `.Last` of mode function. Behind the scenes: - Modernize package code by using `roxygen2` for documentation and managing the NAMESPACE. - Modernize C function registration. - Replace http URLs with `https` and resolve broken links. - Add github actions to automated testing - Use pkgdown to generate HTML documentation. - Use `styler` package to standardize R code formatting. gtools 3.8.2 - 2020-03-23 ------------------------- Minor changes to support R 4.0 gtools 3.8.1 - 2018-06-21 ------------------------- Behind the scenes: - Remove softlinks per request from Uwe Ligges gtools 3.8.0 - 2018-06-20 ------------------------- New functions: - spit_path(): converts a file path into a vector of path components - baseOf(): Transform an integer to an array of base-n digits Behind the scenes: - Update C calls to use correct 'PACKAGE=' parameter. - Explicitly register C routines used by the package - Update link for taxise::taxize_capwords in gtools::capwords man page - Corrections to typographical errors gtools 3.7.0 - 2017-06-14 ------------------------- New functions: - Add capwords() function to apply standard capitalization rules to a character string. Enhancements: - Add 'con' argument to ask() to allow specification of the connection to query for input. For use under RStudio, use ask(..., con=file('stdin')). - R/na.replace.R, man/na.replace.Rd: na.replace() now accepts a function to provide the replacement value. - smartbind() has a new argument 'list' to pass a list of data frames, /instead of/in addition to/ data frames as arguments. - Internal changes to bring code up to current CRAN guidelines. Bug Fixes: - smartbind() now works properly with empty column names - Correct error in smartbind() when column types don't match. - Fix bug in smartbind's handling of factor levels. - Improve assignment of default names in smartbind(). - loadedPackages() to return data silently so that the results don't get printed twice. gtools 3.5.0 - 2015-04-28 ------------------------- New Functions: - New roman2int() function 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 function to an interpreted code function. - New assignEdgewise() function for making assignments into locked environments. (Used by unByteCodeAssign().) Enhancements: - mixedsort() and mixedorder() now have arguments 'decreasing', 'na.last', and 'blank.last' arguments to control sort ordering. - mixedsort() and mixedorder() 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.) Bug fixes: - 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. gtools 3.4.2 - 2015-04-06 ------------------------- New features: - New function loadedPackages() to display name, version, and path of loaded packages (package namespaces). - New function: na.replace() to replace missing values within a vector with a specified value.` Bug fixes: - Modify keywords() to work properly in R 3.4.X and later. gtools 3.4.1 - 2014-05-27 ------------------------- Bug fixes: - smartbind() now converts all non-atomic type columns (except factor) to type character instead of generating an opaque error message. Other changes: - the argument to ASCIIfy() is now named 'x' instead of 'string'. - minor formatting changes to ASCIIfy() man page. gtools 3.4.0 - 2014-04-14 ------------------------- New features: - New ASCIIfy() function to converts character vectors to ASCII representation by escaping them as \x00 or \u0000 codes. Contributed by Arni Magnusson. gtools 3.3.1 - 2014-03-01 ------------------------- Bug fixes: - 'mixedorder' (and hence 'mixedsort') not properly handling single-character strings between numbers, so that '1a2' was being handled as a single string rather than being properly handled as c('1', 'a', '2'). gtools 3.3.0 - 2014-02-11 ------------------------- New features: - Add the getDependencies() function to return a list of dependencies for the specified package(s). Includes arguments to control whether these dependencies should be constructed using information from locally installed packages ('installed', default is TRUE), available CRAN packages ('available', default is TRUE) and whether to include base ('base', default=FALSE) and recommended ('recommended', default is FALSE) packages. Bug fixes: - binsearch() was returning the wrong endpoint & value when the found value was at the upper endpoint. gtools 3.2.1 - 2014-01-13 ------------------------- Bug fixes: - Resolve circular dependency with gdata gtools 3.2.0 - 2014-01-11 ------------------------- New features: - The keywords() function now accepts a function or function name as an argument and will return the list of keywords associated with the named function. - New function stars.pval() which will generate p-value significance symbols ('***', '**', etc.) Bug fixes: - R/mixedsort.R: mixedorder() was failing to correctly handle numbers including decimals due to a faulty regular expression. Other changes: - capture() and sprint() are now defunct. gtools 3.1.1 - 2013-11-06 ------------------------- Bug fixes: - Fix problem with mixedorder/mixedsort when there is zero or one elements in the argument vector. gtools 3.1.0 - 2013-09-22 ------------------------- Major changes: - The function 'addLast()' (deprecated since gtools 3.0.0) is no longer available, and has been marked defunct. Bug fixes: - Modified 'mixedorder()' to use Use 'suppressWarnings() instead of 'options(warn=-1)'. This will avoid egregious warning messages when called from within a nested environment, such as when run from within 'knitr' gtools 3.0.0 - 2013-07-06 ------------------------- Major changes: - The function 'addLast()' has been deprecated because it directly manipulates the global environment, which is expressly prohibited by the CRAN policies. - A new function, 'lastAdd()' has been created to replace 'addLast()'. The name has been changed because the two functions require different syntax. 'addLast()' was used like this: byeWorld <- function() cat("\nGoodbye World!\n") addLast(byeWorld) The new 'lastAdd()' function is used like this: byeWorld <- function() cat("\nGoodbye World!\n") .Last <- lastAdd(byeWorld) Bug fixes: - Update checkRVersion() to work with R version 3.0.0 and later. Other changes: - Remove cross-reference to (obsolete?) `moc` package - The function 'assert()' (deprecated since gtools 2.5.0) is no longer available and has been marked defunct. gtools 2.7.1 - 2013-03-17 ------------------------- Bug fixes: - smartbind() was not properly handling factor columns when the first data frame did not include the relevant column. gtools 2.7.0 - 2012-06-19 ------------------------- New features: - smartbind() has a new 'sep' argument to allow specification of the character(s) used to separate components of constructed column names - smartbind() has a new 'verbose' argument to provide details on how columns are being processed Bug fixes: - smartbind() has been enhanced to improve handling of factor and ordered factor columns. gtools 2.6.2 - 2011-09-28 ------------------------- New features: - Add 'fill' argument to smartbind() to specify a value to use for missing entries. gtools 2.6.1 ------------ New features: - Add newVersionAvailable() function to compare running and latest available R versions. - Add keywords() function to show $RHOME/doc/KEYWORDS file Bug fixes: - Correct windows make flags as suggested by Brian Ripley. - Update Greg's email address and fix Rd syntax errors gtools 2.5.0 ------------ New features: - Add checkRVersion() function to determine if a newer version of R is available. - Deprecated assert() in favor of base::stopifnot Bug fixes: - Fix bug in binsearch() identified by 2.6.0 R CMD CHECK Other changes: - Improve text explanation of how defmacro() and strmacro() differ from function(). - Update definitions of odd() and even() to use modulus operator instead of division. gtools 2.4.0 ------------ - Add binsearch() function, previously in the genetics() package. gtools 2.3.1 ------------ - Add ask() function to prompt the user and collect a single response. gtools 2.3.0 ------------ - Update email address for Greg - Add new 'smartbind' function, which combines data frames efficiently, even if they have different column names. gtools 2.2.3 ------------ - setTCPNoDelay now compiles & works properly on Windows gtools 2.2.2 ------------ - src/setTCPNoDelay.c: Add C source code for setTCPNoDelay. - NAMESPACE: Add UseDynLib to NAMESPACE so the shared library gets properly loaded. - Updated Greg's email address. gtools 2.2.1 ------------ - New function 'addLast' that adds functions to R's .Last() so that they will be executed when R is terminating. - New function setTCPNoDelay() that allows the TCP_NODELAY flag to be changed on socket objects. gtools 2.1.0 ------------ - Added assert.R (and documentation) - Added 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/} - Added DESCRIPTION and removed DESCRIPTION.in gtools/inst/WORDLIST0000644000176200001440000000143614261670123013736 0ustar liggesusersASCIIfy Ahgarin Anonymized Arni Bengtsson Bolker CMD Dendogram Fogarty IETF Internetworks Ligges LinkingTo Lumley's Magnusson Mignon Moeller Möller NODELAY Nagle Nagle's Nagling Nitin PlateDay RHOME RStudio STDOUT Steffen UseDynLib Uwe Venables Warnes Winsemius addLast aliquoted asc assignEdgewise attr baseOf binsearch byeWorld capwords checkRVersion chr colorimetric datamanagement ddirichlet de defmacro dirichlet foldchange gdata getDependencies github http https iDevice inv jerry knitr lapply lastAdd loadedPackages logratio mixedorder mixedsort nGoodbye na newVersionAvailable num pkgdown preprocessor pval quantcut rdirichlet ripley sep setTCPNoDelay smartbind smartbind's softlinks src stdin stopifnot strmacro suppressWarnings taxise taxize tcpNoDelay uk un unByteCode unByteCodeAssign