gdata/0000755000176200001440000000000014513307506011336 5ustar liggesusersgdata/NAMESPACE0000644000176200001440000000654114510771613012564 0ustar liggesusersexport(.onAttach, ans, Args, bindData, case, cbindX, centerText, combine, ConvertMedUnits, drop.levels, duplicated2, env, first, "first<-", frameApply, interleave, is.what, keep, last, "last<-", left, ll, ls.funs, lowerTriangle, "lowerTriangle<-", matchcols, nobs, n_obs, nPairs, mv, rename.vars, remove.vars, reorder.factor, resample, right, startsWith, starts_with, trim, trimSum, unmatrix, update.list, update.data.frame, upperTriangle, "upperTriangle<-", wideByFactor, write.fwf, ## Object size stuff object_size, as.object_sizes, is.object_sizes, humanReadable, object.size, ## getDateTime stuff getYear, getMonth, getDay, getHour, getMin, getSec, ## mapLevels stuff mapLevels, as.levelsMap, as.listLevelsMap, is.levelsMap, is.listLevelsMap, "mapLevels<-", ## unknown stuff isUnknown, unknownToNA, NAToUnknown ) importFrom(stats, reorder) importFrom(stats, nobs) importFrom(gtools, mixedsort) importFrom(methods, is, slot, slotNames) importFrom(utils, data, head, read.table, tail, write.table) S3method(reorder, factor) S3method(summary, nPairs) ## drop.levels stuff S3method(drop.levels, default) S3method(drop.levels, factor) S3method(drop.levels, list) S3method(drop.levels, data.frame) ## getDateTime stuff S3method(getYear, default) S3method(getYear, Date) S3method(getYear, POSIXct) S3method(getYear, POSIXlt) S3method(getMonth, default) S3method(getMonth, Date) S3method(getMonth, POSIXct) S3method(getMonth, POSIXlt) S3method(getDay, default) S3method(getDay, Date) S3method(getDay, POSIXct) S3method(getDay, POSIXlt) S3method(getHour, default) S3method(getMin, default) S3method(getSec, default) ## mapLevels stuff S3method(mapLevels, default) S3method(mapLevels, character) S3method(mapLevels, factor) S3method(mapLevels, list) S3method(mapLevels, data.frame) S3method("mapLevels<-", default) S3method("mapLevels<-", list) S3method("mapLevels<-", data.frame) S3method(print, levelsMap) S3method(print, listLevelsMap) S3method("[", levelsMap) S3method("[", listLevelsMap) S3method(c, levelsMap) S3method(c, listLevelsMap) S3method(unique, levelsMap) S3method(sort, levelsMap) ## nobs stuff S3method(nobs, data.frame) S3method(nobs, default) S3method(nobs, lm) ## Object size stuff S3method(c, object_sizes) S3method(format, object_sizes) S3method(print, object_sizes) ## unknown stuff S3method(isUnknown, default) S3method(isUnknown, POSIXlt) S3method(isUnknown, list) S3method(isUnknown, data.frame) S3method(isUnknown, matrix) S3method(unknownToNA, default) S3method(unknownToNA, factor) S3method(unknownToNA, list) S3method(unknownToNA, data.frame) S3method(NAToUnknown, default) S3method(NAToUnknown, factor) S3method(NAToUnknown, list) S3method(NAToUnknown, data.frame) ## trim stuff S3method(trim, character) S3method(trim, default) S3method(trim, factor) S3method(trim, list) S3method(trim, data.frame) ## left, right S3method(left, data.frame) S3method(left, matrix) S3method(right, data.frame) S3method(right, matrix) # update methods for list, data.frame S3method(update, list) S3method(update, data.frame) gdata/ChangeLog0000644000176200001440000012401614510771613013115 0ustar liggesusers2017-06-05 warnes * [r2154] DESCRIPTION: Fix type in DESCRIPTION date field. * [r2153] .Rbuildignore: Specify which file patterns to ignore when building R package file. * [r2152] DESCRIPTION, tests/test.humanReadable.Rout.save, tests/test.read.xls.Rout.save, tests/test.reorder.factor.Rout.save, tests/tests.write.fwf.Rout.save, vignettes/mapLevels.Rnw: Update package version and stored test output. * [r2151] inst/doc/Rnews.sty: Remove obsolete Rnews.sty file from inst/doc. * [r2150] R/startsWith.R: gdata::startsWith() now uses base::startsWith() to do the actual comparison, after hanlding ignore.case and trim arguments. * [r2149] man/trim.Rd: Add reference to 'new' base function 'trimws'. * [r2148] NAMESPACE, R/update.data.frame.R, R/update.list.R, man/update.list.Rd: Drop 'update.data.frame' until there is time to work on it. 2016-08-12 warnes * [r2130] NAMESPACE: Add mv to exported namespace 2016-05-31 warnes * [r2128] R/humanReadable.R: Fix typo that forced users of humanReadable() to provide two elements to the 'justify' argument. The correction allows a single value to be provided which will be expanded to two internally. 2016-02-05 warnes * [r2077] man/update.list.Rd: Add documentation for update() data.frame method. * [r2076] R/mv.R, man/mv.Rd: Add mv() function to rename an object. 2016-02-03 warnes * [r2075] NAMESPACE: - Add update() methods list and data.frame - Add 'first<-' and 'last<-' assignment methods * [r2074] R/update.data.frame.R, R/update.list.R, man/update.list.Rd: Add update() methods for lists and data frames * [r2073] R/first.R, man/first.Rd: Add assignment versions of first() and last() * [r2072] R/rename.vars.R: Improve logging and error reporting for remove.vars() 2015-10-15 warnes * [r2068] R/installXLSXsupport.R: Remove unused call to tempdir(). 2015-07-22 warnes * [r2062] DESCRIPTION, NAMESPACE, tests/test.humanReadable.Rout.save, tests/test.read.xls.R, tests/test.read.xls.Rout.save, tests/test.reorder.factor.Rout.save, tests/tests.write.fwf.Rout.save: Renamed 'test' directory to 'tests', commented out tests for lme4 which has a changed API 2015-07-03 warnes * [r2056] DESCRIPTION, inst/ChangeLog, inst/NEWS: Update for gdata 2.17.0 2015-06-29 warnes * [r2055] inst/ChangeLog: Update ChangeLog * [r2054] tests/test.humanReadable.Rout.save, tests/test.read.xls.R, tests/test.read.xls.Rout.save, tests/test.reorder.factor.Rout.save, tests/tests.write.fwf.Rout.save: Add note for R CMD check to help reviewers not freak out when diffs occur because of absence of a PERL library needed to support XLSX files. * [r2053] R/upperTriangle.R, man/upperTriangle.Rd: Add 'byrow' argument to lowerTriangle()/upperTriangle() functions. 2015-05-02 warnes * [r2018] Rename 'trunk' to 'pkg' for compatibility with R-forge 2015-04-29 warnes * [r1993] Update ChangeLog and NEWS again. * [r1992] Apparentely read.csv() needs different combination of "fileEncoding=`latin1`" and "encoding=`latin1`" on unix and windows platforms. * [r1991] In mapLevels(), use sapply() instead of lapply() to avoid warning message. * [r1990] Displaying all the latin1 characters for diff isn't reliable across platforms. Simply summarize the latin1 data instead. * [r1989] Display read latin1 data so that diff can catch changes. 2015-04-28 warnes * [r1988] Update ChangeLog for gdata 2.16.1 * [r1987] Update NEWS for gdata 2.16.1 * [r1986] Remove no-longer defined methods. * [r1985] Summary: Minor formatting changes, use rnorm() for X in example, and use set.seed() for consistent results. * [r1984] Summary: Replace unicode single-quote characters with ASCII ones. * [r1983] Summary: Call base::sort instead of sort, which has been redefined by arguments. * [r1982] Update NEWS and ChangeLog. * [r1981] Bump version number. * [r1980] Remove CVS header tag. * [r1979] Update version requirement for R (>= 2.3.0) and perl (5.10.0). * [r1978] - first() and last() are now simply wrappers to utils::head() and utils::tail() with a default 'n=1' instead of 'n=6'. - Move code for left() and right() into a separate file. * [r1977] If arguments 'X' or 'FUN' is supplied to reorder.factor(), mimic the behavior of stats::reorder.default() rather than trying to call it via NextMethod. 2015-04-25 warnes * [r1974] List needs a conjuction * [r1973] Fix spelling errors & typos * [r1972] Fix typographical errors * [r1971] Update NEWS and ChangeLog (again) * [r1970] Remove aggregate.table() entirely * [r1969] 'test.humanReadable.R' needed set.seed() to make the results consistent. * [r1968] Update .save files * [r1967] Missed on commit. * [r1966] Modfy write.fwf() to properly handle matrix argument, avoiding conversion to data frame unless rownames=TRUE. Add corresponding unit tests. * [r1965] Installing PERL modules was failing. Adding CPAN configuration option fixed the problem. * [r1964] Error message about executable name was missing one alternative * [r1963] Better describe gdata contents * [r1962] is.* and as.* aren't generics * [r1961] Add 'justify' argument to print and format object_sizes methods * [r1960] Add 'justify' argument to print and format object_sizes methods * [r1959] Remove stray call to 'browser' * [r1958] Update DESCRIPTION, ChangeLog, and NEWS * [r1957] Complete work on object.size(), object_sizes methods, and humanReadable. * [r1956] Add error message if Excel file format is too old 2015-04-23 warnes * [r1953] Update NEWS and ChangeLog * [r1952] - write.fwf() now properly supports matrix objects, including matrix objects wihtout column names. (Reported by Carl Witthoft.) * [r1951] Remove 'use POSIX' from xls2csv.pl since it is no longer needed * [r1939] Update NEWS and ChangeLog * [r1938] reorder.factor() now hands off processing to stats:::reorder.default() when either 'X' or 'FUN' is specified. 2015-04-22 warnes * [r1937] Update NEWS and ChangeLog for changes to humanReadable() * [r1936] Fix 'units' argument of humanReadable() * [r1935] Update object.size() man page to reflect change in class of return value from 'object_size' to 'object_sizes' * [r1934] Update NEWS and ChangeLog for gdata 2.16.0 * [r1933] Modify gdaata:object.size to generate S3 objects of class 'object_sizes' (note the final 's') to avoid conflicts with methods in utils for object_size. * [r1932] Correct behavior of reorder.factor() when argument 'X' is supplied by delgating to stats:::reorder.default() 2015-04-14 warnes * [r1929] Update ChangeLog * [r1928] Remove editorializing * [r1927] Update NEWS and ChangeLog for gdata 2.15.0 * [r1926] Add 'scientific' argument to write.fwf to allow control of whether numeric values can be displated using scientific notation. * [r1925] Replace depricated PERL function POSIX::isnumeric with equivalent regexp * [r1924] Add gdata ChangeLog to SVN 2015-04-10 warnes * [r1922] Update files for gdata 2.15.0 2015-04-08 warnes * [r1919] Move first/last/left/right to from gtools to gdata 2014-08-28 warnes * [r1883] Everything works now! * [r1882] Suppress annoying warnings in Spreadsheet::ParseXLS::FmtDefalt. * [r1881] Add tests and corresponding test files for 1900 and 1904 based XLX/XLSX files * [r1880] Complete transition from Spreadsheet::XLSX to Spreadsheet::ParseXLSX * [r1879] Handle Excel files created on the Mac, where by default Excel uses 1904-01-01 as the baseline for dates, rather than the usual 1900-01-01. * [r1878] Remove dotfiles * [r1877] Update for release * [r1876] Add test for handling fo very wide xls and xlsx files. * [r1875] Add test for handling fo very wide xls and xlsx files. * [r1874] Modify code to use latest version of Spreadsheet::ParseExcel and to replace Spreadsheet::XLSX woth Spreadsheet::ParseXLSX * [r1873] Update Spreadsheet::ParseExcel, add Spreadsheet:ParseXLSX, add dependencies 2014-04-05 warnes * [r1801] Apply same changes to NAToUnknown that were previously applied to unknownToNA for POSIXlt. * [r1800] Update NEWS with latest changes * [r1799] Call stats::nobs instead of stats:::nobs.default within gdata::nobs.default. This avoids R CMD check warning. * [r1798] Don't compare optional POSIXlt field. Explicitly compare POSIXlt, with special handling of '-1' unknown value. * [r1797] Don't use gdata::: prefix to access gdata function * [r1796] Fix syntax error in DESCRIPTION file. * [r1795] Package name needs to be defined outside of if test. * [r1794] Style file needed * [r1793] The issue Brian pointed out was an error in the isUnknown() code, not an error in the unit tests! * [r1792] Apply changes Brian recommned to NAtoUnknown as well as unknownToNA. * [r1791] Update NEWS file * [r1790] Don't need latex .dtx source file * [r1789] Move vignettes from inst/doc/ to vignettes/ * [r1788] Change 'aggregate.table' from deprecated to defunct. * [r1787] Complete changes so that the unit tests are run as part of R CMD check * [r1786] Update NEWS for gdata 2.13.4 * [r1785] Update NAMESPACE file to remove deleted function * [r1784] Move unit test files back to inst/unitTests. Fix up runRUnitTests.R to work properly in the new location * [r1783] - For unit tests, don't check for equality of optional POSIXlt components. (Bug reported by Brian Ripley). * [r1782] Move unit test code into the (now) standard location 2014-03-19 arnima * [r1777] change warning message to R standards 2013-12-18 arnima * [r1758] Retain original list order unless sort=FALSE; also stop if unnamed list 2013-12-16 warnes * [r1757] Trim will now remove all types of leading/trailing whitespace by using the [:blank:] character class. 2013-06-29 warnes * [r1692] Update NEWS for second try for gdata 2.13.2 * [r1691] Simplify ll() by stuffing list arguments into an environment, avoiding the need to use attach/detach. 2013-06-28 warnes * [r1685] Update NEWS for gdata 2.13.2 * [r1684] Minor update to tests/*.Rout.save * [r1683] Add on.exit() handler to ensure a matching detach occurs when attach is used in ll() * [r1682] Update for gdata 2.13.2 * [r1681] Improve deprecated message 2013-03-24 warnes * [r1645] Update test files for code changes * [r1644] Fix formatting in NEWS * [r1643] Replaced calls to depreciated function ".path.package" with the new public function "path.package". 2013-01-14 warnes * [r1639] Replace (obsolete) '.path.package' with 'find.package' function. 2012-09-20 warnes * [r1622] Correct .Rd file errors detected by 'R CMD check'. * [r1621] Add duplicated() and ans() to the NAMESPACE. * [r1620] Update for gdata 2.13.0. * [r1619] Fix typographic error. * [r1618] Add 'ans()' and 'duplicated()' contributed by Liviu Andronic. 2012-09-19 warnes * [r1617] Correct column names. Unit columns were reversed and misspelled. * [r1616] Add ignore.stderr to system command in sheetCmd() to prevent stderr messages from being included in the captured output from the perl script. 2012-09-12 warnes * [r1606] Update for gdata 2.12.0 * [r1605] 'stats::aggregate' was made into a generic on 27-Jan-2010, so that attempting to call 'aggregate' on a 'table' object will now incorrectly call 'aggregate.table'. Since 'aggregate.table' can be replaced by a call to tapply using two index vectors, e.g. aggregate.table(x, by1=a, by2=b, mean) can be replaced by tapply(x, INDEX=list(a, b), FUN=mean), the 'aggregate.table' function will now display a warning that it is depreciated and recommending the equivalent call to tapply. It will be removed entirely in a future version of gdata. * [r1604] Don't ignore .Rnw files, but do ignore .svn files. 2012-09-11 warnes * [r1603] Clarify workding of DROP argument to interleave(). * [r1602] Replace call to aggregate.table() with equivalent tapply() call since aggregate.table() is being depreciated. 2012-08-22 warnes * [r1601] Update DESCRIPTION and NEWS for gdate 2.11.1. * [r1600] Add example for read.xls() that shows how to use the fileEncoding argument to read in latin-1 encoded data. * [r1599] Add XLSX test for latin-1 characters, and look for them in their new location in inst/xls/. * [r1598] add XLSX version of latin-1.xls * [r1597] Add test file and code to ensure that read.xls() can properly handle files with alternative encodings. latin-1.xls contains each of the non-ascii latin-1 special characters in both the column headings and the body of the file. * [r1596] Change code to have R read the csv/tab data from the file rather than from the connetion we made, so that file encodings can be properly handled. * [r1595] Always close the connection. 2012-08-13 warnes * [r1594] Remove trailing space from output line. 2012-06-18 warnes * [r1567] Update NEWS for 2.11.0 release. * [r1566] Bump version number and add SystemRequirements for perl. * [r1565] read.xls() and supporting functions now allow blank lines to be preserved, rather than skipped, by supplying the argument "blank.lines.skip=FALSE". The underlying perl function has been extended to suppor this via an optional "-s" argument which, when present, *preserves* blank lines during the conversion. 2012-06-13 warnes * [r1564] - nobs.default needs to handle logical vectors in addition to numeric vectors. - update DESCRIPTION and NEWS for 2.10.6. * [r1563] nobs.default needs to handle logical as well as numeric vectors. 2012-06-08 warnes * [r1562] Update DESCRIPTION and tests * [r1561] fix incorrect function name * [r1560] Mark example for installXLSXsupport() to not be executed durin R CMD check. * [r1559] stats:::nobs.default and stats::nobs.lm require R > 2.13.0, so add this as a dependency. 2012-06-06 warnes * [r1552] Update for release 2.10.2 * [r1551] Fix bugs in nobs.default. * [r1550] Update to reflect warning on startup that 'nobs' hides 'stats::nobs'. * [r1549] Remove stray non-ASCII characters. * [r1548] The nobs() dispatch method must be defined in the gdata namespace to pick up the definition of gdata::nobs.default. * [r1547] Update DESCRIPTION and NEWS for 2.10.1 release. * [r1546] Define aliases for 'nobs' and 'nobs.lm' to support backward compatibility for packages depending on gdata. * [r1545] Update DESCRIPTION and NEWS for 2.10.0 release * [r1544] - Add manual page and NAMESPACE entry for startsWith(). - Add 'ignore.case' argument to startsWith(). * [r1543] Update to match new code. * [r1542] Replace non-ASCII characters. * [r1541] Add na.strings to read.xls call to convert "#DIV/0!" to NA. 2012-06-05 warnes * [r1540] Remove nobs method dispatch and lm methods since these are now provided by the stats package. * [r1539] Spell out arguments to ls() to avoid R CMD check warnings. * [r1538] Add .Rinstignore file to omit latex style and source files from distributed inst/doc directory. * [r1537] - Add NULL definition of MedUnits to avoid R CMD check warning. - Specify local environment when calling data() so that MedUnits gets defined in the function's environment rather than the global environment. * [r1536] Fix error in ls.funs() that occurs when there are no objects in the environment. * [r1535] Avoid warning by calling utils::object.size rather than Internal(object.size(x)) 2012-05-31 warnes * [r1534] - Remove dispatch function 'nobs' and method 'nobs.lm' since these are now provided by the R 'stats' package. 2012-05-04 warnes * [r1532] Update for next release * [r1531] Add ls.funs() to show functions defined in the specified environment. * [r1530] Fix enumerate syntax. 2012-04-03 warnes * [r1522] Add startsWith() function. 2011-10-05 warnes * [r1516] Fix typo 2011-09-30 warnes * [r1515] Update DESCRIPTION and README for 2.9.0 release. * [r1514] Update DESCRIPTION and README for 2.9.0 release. 2011-09-20 warnes * [r1508] Improve xls2csv() man page * [r1507] Add case() function, a vector equivalent of the switch() function * [r1506] Add case() function, a vector equivalent of the switch() function 2011-09-02 warnes * [r1500] Add 'centerText' function to center text strings for a specified width. * [r1499] Add 'centerText' function to center text strings for a specified width. 2011-04-16 warnes * [r1469] Update for release 2.8.2 2011-04-15 warnes * [r1468] Fix errors on windows when R or Perl install path includes spaces by properly quoting the path. * [r1467] Fix error in xlsFormat() on windows when R or Perl install path includes spaces by quoting the path. 2011-01-15 ggorjan * [r1465] Adding summary method for nPairs 2010-11-12 warnes * [r1462] Update NEWS for gdata 2.8.1 * [r1461] Update DEScription file for 2.8.1 release * [r1460] Update test output to match latest code * [r1459] Modify write.fwf() to capture and pass on additional arguments for write.table(). This resolves a bug reported by Jan Wijffels. 2010-11-01 arnima * [r1453] Minor improvement in Args.Rd help page 2010-10-19 warnes * [r1452] Avoid use of file.access() which is unreliable on Windows network shares. 2010-07-08 ggrothendieck2 * [r1448] findPerl call added to xls2sep 2010-07-07 ggrothendieck2 * [r1447] small improvements to read.xls.Rd 2010-05-03 warnes * [r1439] Rename installXLSXModules() to installXLSXsupport() and provide documentation for it. * [r1438] Update news for gdata 2.8.0 * [r1437] Add .onAttach function to check & inform user if perl is available, to check whether XLS and XLSX formats are avaiable, and to run the (new) installXLSXModules() functon to attempt to install the necessar libraries if not. Added installXLSXModules() function. 2010-05-02 warnes * [r1436] Correct error in xlsFormat example * [r1435] Update perl code to work (but generate warnings) when Zlib or SpreadSheet::XLXS is not instaled. Also update Greg's email address 2010-02-21 ggrothendieck2 * [r1423] isOpen problems fixed (isOpen must have changed in R since this worked in earlier versions). Also nba.xls link in read.xls.Rd disappeared. Replaced with similar link. 2010-02-20 ggrothendieck2 * [r1422] improved INSTALL file 2010-02-19 ggrothendieck2 * [r1421] added findPerl to locate ActiveState Perl on Windows if perl= not specified and Rtools perl would have otherwise been used. Also added INSTALL file. 2010-01-28 warnes * [r1419] Update for release 2.7.1 * [r1418] xls2sep(): Show output of perl call when verbose=T * [r1417] More Win32 fixes * [r1416] More work on Win32 building * [r1415] Support building Compress::Raw::Zlib perl package under windows. 2010-01-26 warnes * [r1413] Fix typos * [r1412] Show more details in sheetCount() when verbose=TRUE 2010-01-24 warnes * [r1411] Replace two calls to 'dQuote', to 'dQuote.ascii' * [r1408] Remove auto-generated pdf files from svn * [r1407] create 'distclean' to remove perl binary dir, currently mac-only * [r1406] Make read.xls() and xls2sep() quieter when verbose=FALSE * [r1405] Add tests for read.xls, sheetCount, and sheetNames * [r1404] Modify makefile to 1) clean up after build, 2) make tar non-verbose * [r1403] Close connections when done. * [r1402] Fix typo * [r1401] Fix R CMD CHECK errors * [r1400] Use the original gz file for Compress::Raw::Zlib to avoid issues with 'non-platform-independent' filename error in R CMD CHECK * [r1399] Rename files to remove R CMD check error * [r1398] Update for 2.7.0 release * [r1397] Add new functions to NAMESPACE * [r1396] Add Compress::Raw::Zlib code * [r1395] Add/Update documentation * [r1394] Minor formatting change * [r1393] Add additional example files * [r1392] Combine sheetCount.pl and sheetNames.pl and modify to support Excel 2007 'xlsx' format * [r1391] Complete changes to handle Excel 2007 'xlsx' files * [r1390] Add additional Perl modules to support Excel 2007 'xlsx' files 2010-01-24 ggrothendieck2 * [r1389] added sheetNames.Rd (documenting sheetNames/sheetCount) and updated NAMESPACE file. * [r1388] fixed spacing problem in NEWS 2010-01-23 warnes * [r1387] Check if parsing the xls file succeeds... Current code doesn't handle new XML-based format * [r1386] Remove perl 'Spreadsheet:XLSX' module since it depends on Compress-Raw-Zlib, which probably won't be available on most machines, and I don't have time to figure out how to get R to build it properly when gdata is installed. * [r1385] Add perl 'Spreadsheet:XLSX' module to support new Excel XML format files * [r1384] Add xls2tsv() convenience wrapper to xls2sep() * [r1383] Update to match new xls2csv.pl code, allow specification of sheets by name, support CSV and TAB delimited files using the same code, other minor changes. * [r1382] Add sheetNames() function to extract the names from XLS files * [r1381] Fix xls2csv.bat * [r1380] If only one sheet is present in the file, don't insert the sheet name into the filename * [r1379] Add additional test/example Excel files * [r1378] Modify xls2csv.pl script to: - Use tab-delimiter and .tsv or .tab extension if called with the name xls2tsv.pl or xls2tab.pl, respectively. This allows a single source file and two symlinks to be used intstead of maintaining several almost-identical files. - Allow selection of sheets by name - Provide better error checking - Other code improvements * [r1377] Add perl scripts to extract worksheet names and sheet count from Excel files 2010-01-22 warnes * [r1376] Upgrade Perl OLE::StorageLight module to version 0.19 * [r1375] Upgrade perl Spreadsheet::ParseExcel to version 0.56 * [r1374] Add complete list of contributors 2010-01-22 arnima * [r1373] Minor improvement in help page * [r1371] Many small improvements to documentation of Arni's five functions 2010-01-22 warnes * [r1370] - Move xls2csv(), xls2tab(), xls2sep() to a separate file - Move qQuote.ascii to a separate file - Bug Fix: xls2csv(), xls2tab() failed to pass the provided 'perl' parameter to xls2sep() - New Feature: xls2sep() (and hence xls2csv, xls2tab, and read.xls) now supports ftp URLs. 2009-12-06 arnima * [r1369] Minor improvements of Args(). * [r1368] Improved ll() so user can limit output to specified classes 2009-11-16 arnima * [r1366] ll(.GlobalEnv) does not crash anymore 2009-08-20 warnes * [r1357] Replace \ldots with \dots to make the new R CMD CHECK happy. 2009-08-19 warnes * [r1355] Update for 2.6.1 release * [r1354] Modify unit tests to avoid issues related to zime zones. 2009-08-05 warnes * [r1353] Update vignettes for 2.6.0 release * [r1352] Fix formatting warning in frameApply man page 2009-07-16 ggorjan * [r1350] Reverting recent change and clarifying the meaning. 2009-07-16 warnes * [r1349] Add contents of \value section for resample() man page * [r1348] Update test output to remove R CMD check warning * [r1347] Update ChangeLog and NEWS for gdata 2.6.0 release * [r1346] Update DESCRIPTION file for gdata 2.6.0 * [r1345] Correct Greg's email address * [r1344] Correct minor typos in write.fwf() man page * [r1343] Correct page for resample() * [r1342] Add support for using tab for field separator during translation from xls format in read.xls 2009-04-19 arnima * [r1314] Changed object.size(object) to unclass(object.size(object)). 2008-12-31 ggorjan * [r1312] Documenting changes and exporting the functions. * [r1311] Enhanced function object.size that returns the size of multiple objects. There is also a handy print method that can print size of an object in "human readable" format when options(humanReadable=TRUE) or print(object.size(x), humanReadable=TRUE). * [r1310] New function wideByFactor that reshapes given dataset by a given factor - it creates a "multivariate" data.frame. * [r1309] New function nPairs that gives the number of variable pairs in a data.frame or a matrix. * [r1308] New functions getYear, getMonth, getDay, getHour, getMin, and getSec for extracting the date/time parts from objects of a date/time class. * [r1307] New function bindData that binds two data frames into a multivariate data frame in a different way than merge. * [r1306] New function .runRUnitTestsGdata that enables run of all RUnit tests during the R CMD check as well as directly from within R. 2008-12-20 ggorjan * [r1305] * [r1304] To remove some output in the R CMD check 2008-08-05 ggorjan * [r1300] - Increased version to 2.5.0 - New function cbindX that can bind objects with different number of rows. - write.fwf gains width argument. Unknown values can increase or decrease the width of the columns. Additional tests and documentation fixes. 2008-06-30 arnima * [r1299] Simplified default 'unit' argument from c("KB","MB","bytes") to "KB". 2008-05-13 warnes * [r1270] Update NEWS file for 2.4.2 * [r1269] Use path.expand() to give proper full path to xls file to be translated by read.xls() * [r1268] Modifed read.xls() failed to return the converted data... fixed. * [r1267] Correct broken patch for open-office support * [r1266] For read.xls() and xls2csv(): - Implement more informative log messages when verbose=TRUE - Quote temporary file name to avoid errors when calling perl to do the work. - Add better error messages, particularly when perl fails to generate an output .csv file. Update version number in DESCRIPTION. 2008-05-12 warnes * [r1265] Patch to correct issue with OpenOffice-created XLS files. Thanks to Robert Burns for pointing out the patch at http://rt.cpan.org/Public/Bug/Display.html?id=7206 2008-03-25 warnes * [r1250] Update for version 2.4.1 * [r1249] Example iris.xls file didn't complete & properly formatted iris data set. Fixed. * [r1248] Update perl modules to latest versions 2008-03-24 warnes * [r1247] Fix typo in win32 example for read.xls() 2008-03-11 warnes * [r1246] Add xls2csv to exported function list 2008-01-30 warnes * [r1241] Update DESCRIPTION and NEWS for release 2.4.0 2008-01-29 arnima * [r1240] Added argument 'all'. * [r1239] Added argument 'all'. 2007-10-22 warnes * [r1196] Clarify GPL version 2007-09-10 ggorjan * [r1169] removed unmatched brace * [r1168] adding alias 2007-09-06 ggorjan * [r1162] keyword 2007-08-21 ggorjan * [r1154] package help page * [r1153] move * [r1152] move 2007-08-20 ggorjan * [r1151] clean * [r1150] a real vignette * [r1149] a real vignette * [r1148] additional keyword for searchig 2007-08-17 ggorjan * [r1147] keyword 2007-07-22 arnima * [r1103] Reverted back to as.character(substitute(x)), so user can run keep(x), keep("x"), Args(x), and Args("x"). 2007-07-21 arnima * [r1102] Changed as.character(substitute()) to deparse(substitute()), following help(substitute) recommendation. * [r1101] Changed as.character(substitute()) to deparse(substitute()), following help(substitute) recommendation. 2007-07-10 warnes * [r1099] Update read.xls() code and docs with enhacements by Gabor Grothendieck 2007-06-06 ggorjan * [r1097] last edits from newsletter * [r1096] drop levels as suggested by Brian Ripley * [r1095] better integration of unit tests * [r1094] making codetools happy 2007-01-28 arnima * [r1042] Throw warnings rather than errors 2007-01-27 arnima * [r1041] Meaningful error message is given when requested object does not exist * [r1040] is.* tests that return NA are not reported is.what recursion is avoided 2006-11-30 ggorjan * [r1035] minor commet to the code * [r1034] description of mapLevels methods * [r1033] description of unknown methods 2006-11-16 ggorjan * [r1013] seems that c.factor was not a good idea and there were better examples posted on r-devel list 2006-11-14 ggorjan * [r1012] Removed executable property 2006-11-10 ggorjan * [r1004] just formatting 2006-11-02 ggorjan * [r1002] typos 2006-10-30 ggorjan * [r1001] some more examples for use of read.fwf after write.fwf * [r1000] ignore for report files * [r999] Id tag from source * [r998] removing unused import * [r997] Id tag * [r996] write.fwf * [r995] Id tag * [r994] added unit tests for reorder.factor * [r993] mapply keeps names in R 2.4; POSIX unit tests solved; $ should work now 2006-10-29 ggorjan * [r992] fixed problem in tests; added unknown methods and tests for matrices * [r991] sort is generic now; mapply keeps names in R 2.4.0; some codetools suggestions fixed * [r990] sort is generic from R 2.4.0 * [r989] trim() gains ... argument; version bump * [r988] Fixed collision bug with stats version of reorder.factor 2006-10-27 warnes * [r987] Add c() method for factor objects, submitted by Gregor Gorjanc 2006-09-19 warnes * [r986] Update NEWS file for 2.3.0 release * [r985] Explicitly set the local in runit.trim.R to one where leading spaces affect sort order so that the unit test works properly. 2006-09-18 warnes * [r984] Update Rnews.sty to the latest version * [r983] Integrate fixes for trim() from Gregor and myself. * [r982] Remove unneeded files. 2006-09-13 warnes * [r981] Add unknown() and unit test files * [r980] More fixes from Gregor Gorjanc * [r979] Add mapLevels functions from Gregor Gorjanc, along with associated unit tests. 2006-08-03 warnes * [r978] Add Gregor Gorjanc's mapFactor() and combineLevels() functions. 2006-08-02 warnes * [r977] Update my email address * [r976] Remove MedUnits.rda to convert to binary format * [r975] Remove MedUnits.rda to convert to binary format * [r974] Update version number * [r973] Integrate changes suggested by Gregor Gorjanc 2006-03-14 nj7w * [r940] Fixed R CMD check errors and added trim.default to NAMESPACE 2006-03-13 nj7w * [r939] Added trim.character and trim.factor as per Gregor's suggestions 2006-01-03 warnes * [r839] Add resample() function, which generates a random sample or permutation from the elements of the supplied vector, even if the vector has length 1. This avoide the problems caused by base::sample()'s special case for vectors of length 1, where it attempts to sample from 1:x. 2005-12-13 nj7w * [r806] Updated news and removed changelog 2005-12-12 nj7w * [r798] Updated version number for CRAN release 2005-12-08 warnes * [r789] Andrew Burgess reported that interleave() converts 1-column matrixes to vectors and provided a patch. A slight modification of his patch has been applied. There is now a 'drop' argument, which controls whether 'unnecessary' dimensions are dropped. The default is FALSE. 2005-12-04 warnes * [r779] Andrew Burgess reported that interleave() converts 1-column matrixes to vectors and provided a patch. A slight modification of his patch has been applied. There is now a 'drop' argument, which controls whether 'unnecessary' dimensions are dropped. The default is FALSE. 2005-12-01 nj7w * [r775] Updated Greg's email address * [r774] Updated Jim's email address 2005-11-21 arnima * [r744] Suppressed warning message in attach() call. 2005-10-27 warnes * [r716] Bump version number again to show that I fixed a bug. * [r715] Update version number * [r714] Remove explicit loading of gtools in examples, so that failure to import functions from gtools gets properly caught by running the examples. * [r713] Add missing close-bracket * [r712] Add upperTriangle and friends * [r711] Add functions for extracting, modifying upper and lower trianglular components of matrices. 2005-10-19 arnima * [r695] Replaced the "not.using" vector with a more robust try(get(test)) to find out whether a particular is.* function returns a logical of length one. 2005-09-12 nj7w * [r671] Updated Greg's email 2005-09-06 nj7w * [r661] Added library(gtools) in the example * [r660] Removed gtools dependency from NAMESPACE, as it was being used only in an example, and was giving warning * [r659] Added Suggests field 2005-09-02 nj7w * [r658] Updated the example in frameApply * [r656] Added NEWS * [r654] ChangeLog 2005-08-31 nj7w * [r644] Added DESCRIPTION file * [r643] removed DESCRIPTION.in 2005-07-20 nj7w * [r631] updated documentation * [r630] ## Args() was using a different search path from args(), e.g. rep <- function(local) return(NULL) args() Args() ## Fixed * [r629] ## is.what() was giving needless warnings for functions, e.g. is.what(plot) ## Fixed * [r628] ## ll() was crashing if argument was a list of length zero, e.g. x <- list() ll(x) ## Fixed, and added sort.elements (see new help page) 2005-06-09 nj7w * [r625] Updating the version number, and various help files to synchronize splitting of gregmisc bundle in 4 individual components. 2005-06-07 nj7w * [r622] Reverting to the previous version of drop.levels.R by replacing sapply(...) with as.data.frame(lapply(...)) because sapply has the undesirable effect of converting the object to a matrix, which in turn coerces the factors to numeric. 2005-05-13 nj7w * [r621] 1) Using dQuote.ascii function in read.xls as the new version of dQuote doesn't work proprly with UTF-8 locale. 2) Modified CrossTable.Rd usage in gmodels 3) Modified heatmap.2 usage in gplots. 2005-04-02 warnes * [r600] Move drop.levels() from gtools to gdata. * [r598] Move frameApply() to gdata package. 2005-03-31 warnes * [r586] Comment out example to avoid R CMD check warnings 2005-03-22 warnes * [r578] Fixes to pass `R CMD check'. * [r577] Integrated fixes from Arni. * [r576] Improve documentation of 'perl' argument and give examples. 2005-03-09 warnes * [r573] - Add ConvertMedUnits() plus documentation - Add documentation for MedUnits data set. * [r572] Update MedUnits data file. * [r571] Don't need both .Rda and .tab forms of the data. * [r570] Add MedUnits data set, which provides conversions between American 'Conventional' and Standard Intertional (SI) medical units. 2005-03-01 warnes * [r566] - Remove 'elem' call from ll example. - Add note to 'elem' man page that it is depreciated and 'll' should be used instead. 2005-02-26 nj7w * [r565] *** empty log message *** 2005-02-25 warnes * [r564] Remove ll methods since the base function now handles lists and data frames. * [r563] Integrate changes submitted by Arni Magnusson 2005-01-31 warnes * [r529] Add ability to specify the perl executable and path. 2005-01-28 warnes * [r526] Add dependency on stats. 2005-01-12 warnes * [r515] Add dependency on R 1.9.0+ to prevent poeple from installing on old versions of R which don't support namespaces. 2004-12-27 warnes * [r509] Update usage to match code. * [r508] Replace 'F' with 'FALSE'. 2004-10-12 warneg * [r465] Add unmatrix() function 2004-09-27 warneg * [r461] Updated to pass R CMD check. 2004-09-03 warneg * [r455] added to cvs. * [r454] Checkin xls2csv.pl. Should have been in long ago, must have been an oversight * [r451] Need to look for files using the new package name. * [r449] Need to use the new package name when looking for iris.xls. * [r448] Add ll.list to the to the list of functions described * [r447] Add ll and friends to the namespace * [r446] initial bundle checkin 2004-09-02 warneg * [r442] Initial revision 2004-08-27 warnes * [r441] Fixed bug in mixedsort, and modified reorder.factor to use mixedsort. 2004-07-29 warnes * [r427] Add perl modules to CVS. 2004-07-27 warnes * [r425] Fix typos/spelling. * [r424] Add note that Perl is required for read.xls to work properly. 2004-07-16 warnes * [r420] Remove the temporary csv file if reading it in fails. 2004-06-22 warnes * [r377] Add S3 methods for data frames and lists. 2004-06-08 warnes * [r371] Moved from gregmisc/src/. * [r370] Remove the files in src, instead provide "pre-installed" perl packages in inst/perl. 2004-06-05 warnes * [r365] Fix typo. * [r364] Fix Unix makefile so that it works when invoked directly. * [r363] Fixes for Windows * [r362] Minor enhancment to read.xls example. * [r361] - Merge Makefile.win into Makefile. Makefile.win now just redirects to Makefile. - Update xls2csv.bat and xls2csv shell script to correctly obtain thier installion path and infer the location of the perl code and libraries. - The xls2csv.pl script now assumes that the libraries it needs are installed into the same directory where it is. 2004-06-04 warnes * [r360] More changes, indended to improve installation reliabilty and to make Makefile and Makefile.win as similar as possible. 2004-05-27 warnes * [r358] Clean should remove scripts from source directory. * [r357] Moved to xls2csv.pl.in. * [r354] More fixes. * [r353] Fix missing brace. * [r352] Add explicit package name to see also links. * [r351] More xls2csv perl module support changes. * [r350] More changes to fix local installation of perl modules. 2004-05-26 warnes * [r345] Escape underscores in email addresses so Latex is happy. 2004-05-25 warnes * [r339] More changes to xls2csv code. * [r337] Add Args() function contributed by Arni Magnusson . * [r335] - Change to call perl directly rather than depending on the installed shell script. This should make the code more portable to MS-Windows systes. - Add additional commants.. * [r332] Makefile now modifies xls2csv.bat xls2csv.pl and xls2csv to contain an explicit path to the perl script/libraries. * [r330] R CMD build calls the clean target to purge build files from the source tree when packaging. To get use this behavior correctly, I've renamed the clean target to cleanup and distclean target to clean. * [r329] Add read.xls(), a function to read Microsoft Excel files by translating them to csv files via the xls2csv.pl script. * [r326] More fixes. Seems to work now. 2004-05-24 warnes * [r325] Add files to enable inclusion and installation of xls2csv.pl as part of the package. 2004-04-01 warnes * [r312] Add function remove.vars(). 2004-03-26 warnes * [r307] Contents of package 'mva' moveed to 'stats'. * [r298] - Fix is.what() for use under R 1.9.0 - is.what() now uses is.* functions found in any attached frame 2004-01-21 warnes * [r282] - Add ... argument to match generic provided in mva. 2004-01-19 warnes * [r275] - Integrated (partial) patch submitted by Arni Magnusson to clarify help text. - Modifed code to use match.arg(). 2003-12-15 warnes * [r271] - Applied patch from Arni that fixed a bug that caused env() to crash if any environment was completely empty 2003-12-03 warnes * [r253] - match function argument defaults with 'usage' 2003-12-02 warnes * [r249] Add one argument, to match code. 2003-12-01 warnes * [r244] - Apply changes submitted by Arni Magnusson 2003-11-19 warnes * [r229] Changes to pass R CMD check. 2003-11-18 warnes * [r224] - Convert from MS-Dos to Unix line endings. - Reformat to 80 columns. 2003-11-17 warnes * [r223] Replace 'T' with 'TRUE' to remove R CMD check error. * [r222] Fix syntax error. 2003-11-10 warnes * [r220] - Add files contributed by Arni Magnusson . As well as some of my own. 2003-06-07 warnes * [r198] - Fixed error in examples. Had sqrt(var(x)/(n-1)) for the standard error of the mean instead of sqrt(var(x)/n). 2003-05-23 warnes * [r197] - Fixed typos * [r196] - library() backported from 1.7-devel. This version of the function adds the "pos=" argument to specify where in the search path the library should be placed. - updated .First.lib to use library(...pos=3) for MASS to avoid the 'genotype' data set in MASS from masking the genotype funciton in genetics when it loads gregmisc - Added logit() inv.logit() matchcols() function and corresponding docs 2003-05-20 warnes * [r195] - Omit NULL variables. * [r194] - Added function trim() and assocated docs. 2003-04-22 warnes * [r188] - The mva package (which is part of recommended) now provides a generic 'reorder' function. Consequently, the 'reorder' function here has been renamed to 'reorder.factor'. - Removed check of whether the argument is a factor object. 2003-03-03 warnes * [r165] - Updated to match reorder.Rd which was exetended to handle factor label names in addition to numeric indices. * [r164] - Added handling of factor level names in addition to numeric indexes. 2002-09-23 warnes * [r118] Added inst/doc directory and contents to CVS. * [r117] - Modified all files to include CVS Id and Log tags. 2002-08-01 warnes * [r112] Added reorder() function to reorder the levels of a factor. 2002-04-09 warneg * [r109] Checkin for version 0.5.3 * [r108] - Properly handle case when some or all arguments are vectors. 2002-03-26 warneg * [r104] - Changed methods to include '...' to match the generic. - Updated for version 0.5.1 * [r102] Added ... to methods. * [r101] Updated to add ... parameter to function calls. * [r98] Initial checkin. * [r95] - Added CVS tags 2002-02-21 warneg * [r87] - Fixed bug where row and column labels didn't always correspond to the contents. This only occured when a factor was used for by1 or by2 and the factors levels weren't in the default sort order. 2002-02-20 warneg * [r86] New function. * [r85] Initial checkin. * [r84] Initial checkin. * [r83] Noted that specialized methods exist. * [r82] Incorrectly had contents of nobs.R here instead of help text. Corrected. * [r81] Minor changes, typo and formatting fixes. * [r79] - initial checkin. 2001-12-12 warneg * [r53] Added omitted documentaton for 'info' parameter. Changed example code not to use 'Orthodont' data set so that the nlme package is not required. 2001-12-08 warneg * [r47] Changed 'T' to 'TRUE' in parameter list. 2001-12-07 warneg * [r45] - Fixed see also link. Mis-typed 'data.frame' as 'dataframe'. * [r44] Added attribution. * [r43] Added proper attribution to Don MacQueen. * [r39] Initial checkin. Unfortunately, I've lost the email of the person who sent this to me. I'll credit him/her when I find out who it was! * [r38] Initial checkin 2001-12-05 warneg * [r34] - Renamed 'concat' function to 'combine' to avoid name conflict with an existing S-Plus function. * [r32] - Changed function name 'concat' to 'combine' and renamed concat.Rd to combine.Rd gdata/data/0000755000176200001440000000000014441446535012255 5ustar liggesusersgdata/data/MedUnits.rda0000644000176200001440000000714114511013460014461 0ustar ligg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'I6߸hc=A?Pc>2:2J4?oaƏ` __}e'x}Ki;%~{c?n}=_xz){5mV2 }+ྌԺ9ty%)ӧյN"7# k>,`WUYOC3ds٣3ɮ}cw{frϵR7w 33qFq#)S 'sgjl#¾N\\ 7D[fl>g|t|)", "Overall Model: Moderate: Pr(>|t|)", "Overall Model: Marked: Pr(>|t|)", "Overall Model: Severe: Pr(>|t|)") # Get the columns which give estimates or p-values # only for marked and severe groups matchcols(x, with=c("Pr", "Std. Error"), without=c("Intercept","Moderate"), method="or") # Get just the column which give the p-value for the intercept matchcols(x, with=c("Intercept", "Pr")) } \keyword{manip} gdata/man/rename.vars.Rd0000644000176200001440000000233614440625622014626 0ustar liggesusers\name{rename.vars} \alias{rename.vars} \alias{remove.vars} \title{Remove or rename variables in a data frame} \description{ Remove or rename a variables in a data frame. } \usage{ rename.vars(data, from="", to="", info=TRUE) remove.vars(data, names="", info=TRUE) } \arguments{ \item{data}{data frame to be modified.} \item{from}{character vector containing the current name of each variable to be renamed.} \item{to}{character vector containing the new name of each variable to be renamed.} \item{names}{character vector containing the names of variables to be removed.} \item{info}{boolean value indicating whether to print details of the removal/renaming. Defaults to TRUE.} } \value{ The updated data frame with variables listed in \code{from} renamed to the corresponding element of \code{to}. } \author{Code by Don MacQueen \email{macq@llnl.gov}. Documentation by Gregory R. Warnes \email{greg@warnes.net}.} \seealso{ \code{\link{names}}, \code{\link{colnames}}, \code{\link{data.frame}} } \examples{ data <- data.frame(x=1:10,y=1:10,z=1:10) names(data) data <- rename.vars(data, c("x","y","z"), c("first","second","third")) names(data) data <- remove.vars(data, "second") names(data) } \keyword{manip} gdata/man/trimSum.Rd0000644000176200001440000000173414440625622014046 0ustar liggesusers\name{trimSum} \alias{trimSum} \title{Trim a vector such that the last/first value represents the sum of trimmed values} \description{ Trim (shorten) a vector in such a way that the last or first value represents the sum of trimmed values. User needs to specify the desired length of a trimmed vector. } \usage{trimSum(x, n, right=TRUE, na.rm=FALSE, \dots)} \arguments{ \item{x}{numeric, a vector of numeric values} \item{n}{numeric, desired length of the output} \item{right}{logical, trim on the right/bottom or the left/top side} \item{na.rm}{logical, remove \code{NA} values when applying a function} \item{\dots}{arguments passed to other methods - currently not used} } \value{ Trimmed vector with a last/first value representing the sum of trimmed values } \author{Gregor Gorjanc} \seealso{\code{\link[gdata]{trim}}} \examples{ x <- 1:10 trimSum(x, n=5) trimSum(x, n=5, right=FALSE) x[9] <- NA trimSum(x, n=5) trimSum(x, n=5, na.rm=TRUE) } \keyword{manip} gdata/man/unmatrix.Rd0000644000176200001440000000171714510771613014256 0ustar liggesusers\name{unmatrix} \alias{unmatrix} \title{Convert a matrix into a vector, with appropriate names} \description{ Convert a matrix into a vector, with element names constructed from the row and column names of the matrix. } \usage{ unmatrix(x, byrow=FALSE) } \arguments{ \item{x}{matrix} \item{byrow}{Logical. If \code{FALSE}, the elements within columns will be adjacent in the resulting vector, otherwise elements within rows will be adjacent.} } \value{ A vector with names constructed from the row and column names from the matrix. If the row or column names are missing, ('r1', 'r2', \ldots,) or ('c1', 'c2', \ldots) will be used as appropriate. } \author{Gregory R. Warnes \email{greg@warnes.net}} \seealso{\code{\link[base]{as.vector}}} \examples{ # Simple example m <- matrix(letters[1:10], ncol=5) m unmatrix(m) # Unroll model output x <- rnorm(100) y <- rnorm(100, mean=3+5*x, sd=0.25) m <- coef(summary(lm(y ~ x))) unmatrix(m) } \keyword{manip} gdata/man/left.Rd0000644000176200001440000000345314440625622013340 0ustar liggesusers\name{left} \alias{right} \alias{left} \alias{right.data.frame} \alias{left.data.frame} \alias{right.matrix} \alias{left.matrix} \title{Return the leftmost or rightmost columns of a matrix or data frame} \description{ Return the leftmost or rightmost or columns of a matrix or data frame } \usage{ right(x, n = 6L, \dots) left(x, n=6L, \dots) \method{right}{matrix}(x, n=6L, add.col.nums=TRUE, \dots) \method{left}{matrix}(x, n=6L, add.col.nums=TRUE, \dots) \method{right}{data.frame}(x, n=6L, add.col.nums=TRUE, \dots) \method{left}{data.frame}(x, n=6L, add.col.nums=TRUE, \dots) } \arguments{ \item{x}{Matrix or data frame} \item{n}{If positive, number of columns to return. If negative, number of columns to omit. See examples.} \item{add.col.nums}{Logical. If no column names are present, add names giving original column number. (See example below.)} \item{\dots}{Additional arguments used by methods} } \value{ An object consisting of the leftmost or rightmost \code{n} columns of \code{x}. } \author{ Gregory R. Warnes \email{greg@warnes.net} } \seealso{ \code{\link{first}}, \code{\link{last}}, \code{\link[utils]{head}}, \code{\link[utils]{tail}} } \examples{ m <- matrix(1:100, ncol=10) colnames(m) <- paste("Col",1:10, sep="_") left(m) right(m) # When no column names are present, they are added by default colnames(m) <- NULL left(m) colnames(left(m)) right(m) colnames(right(m)) # Prevent addition of column numbers left(m, add.col.nums = FALSE) colnames(left(m, add.col.nums = FALSE)) right(m, add.col.nums = FALSE) # columns are labeled 1:6 colnames(right(m, add.col.nums = FALSE)) # instead of 5:10 # Works for data frames too! d <- data.frame(m) left(d) right(d) # Use negative n to specify number of columns to omit left(d, -3) right(d, -3) } \keyword{manip} gdata/man/write.fwf.Rd0000644000176200001440000002210314510771615014314 0ustar liggesusers\name{write.fwf} \alias{write.fwf} \concept{data output} \concept{data export} \title{Write object to file in fixed width format} \description{ Write object to file in fixed width (fwf) format. } \usage{ write.fwf(x, file="", append=FALSE, quote=FALSE, sep=" ", na="", rownames=FALSE, colnames=TRUE, rowCol=NULL, justify="left", formatInfo=FALSE, quoteInfo=TRUE, width=NULL, eol="\n", qmethod=c("escape", "double"), scientific=TRUE, \dots) } \arguments{ \item{x}{data.frame or matrix, the object to be written.} \item{file}{character, name of file or connection, look in \code{\link{write.table}} for more.} \item{append}{logical, append to existing data in \code{file}.} \item{quote}{logical, quote data in output.} \item{na}{character, the string to use for missing values (\code{NA}) in the output.} \item{sep}{character, separator between columns in output.} \item{rownames}{logical, print row names.} \item{colnames}{logical, print column names.} \item{rowCol}{character, rownames column name.} \item{justify}{character, alignment of character columns, see \code{\link{format}}.} \item{formatInfo}{logical, return information on number of levels, widths and format.} \item{quoteInfo}{logical, should \code{formatInfo} account for quotes.} \item{width}{numeric, width of the columns in the output.} \item{eol}{the character(s) to print at the end of each line (row). For example, \code{eol="\\r\\n"} will produce Windows line endings on a Unix-alike OS, and \code{eol="\\r"} will produce files as expected by Mac OS Excel 2004.} \item{qmethod}{a character string specifying how to deal with embedded double quote characters when quoting strings. Must be one of \code{"escape"} (default), in which case the quote character is escaped in C style by a backslash, or \code{"double"}, in which case it is doubled. You can specify just the initial letter.} \item{scientific}{logical, allow numeric values to be formatted using scientific notation.} \item{\dots}{further arguments to \code{\link{format.info}} and \code{\link{format}}.} } \details{ Output is similar to \code{print(x)} or \code{format(x)}. Formatting is done completely by \code{\link{format}} on a column basis. Columns in the output are by default separated with a space i.e. empty column with a width of one character, but that can be changed with \code{sep} argument as passed to \code{\link{write.table}} via \dots. As mentioned formatting is done completely by \code{\link{format}}. Arguments can be passed to \code{format} via \code{\dots} to further modify the output. However, note that the returned \code{formatInfo} might not properly account for this, since \code{\link{format.info}} (which is used to collect information about formatting) lacks the arguments of \code{\link{format}}. \code{quote} can be used to quote fields in the output. Since all columns of \code{x} are converted to character (via \code{\link{format}}) during the output, all columns will be quoted! If quotes are used, \code{\link{read.table}} can be easily used to read the data back into \R. Check examples. Do read the details about \code{quoteInfo} argument. Use only true characters, i.e., avoid use of tabs, i.e., \code{"\\t"} or similar separators via argument \code{sep}. Width of the separator is taken as the number of characters evaluated via \code{\link{nchar}(sep)}. Use argument \code{na} to convert missing/unknown values. Only single value can be specified. Use \code{\link{NAToUnknown}} prior to export if you need greater flexibility. If \code{rowCol} is not \code{NULL} and \code{rownames=TRUE}, rownames will also have column name with \code{rowCol} value. This is mainly for flexibility with tools outside \R. Note that it may not be easy to import data back to \R with \code{\link{read.fwf}} if you also export rownames. This is the reason, that default is \code{rownames=FALSE}. Information about format of output will be returned if \code{formatInfo=TRUE}. Returned value is described in value section. This information is gathered by \code{\link{format.info}} and care was taken to handle numeric properly. If output contains rownames, values account for this. Additionally, if \code{rowCol} is not \code{NULL} returned values contain also information about format of rownames. If \code{quote=TRUE}, the output is of course wider due to quotes. Return value (with \code{formatInfo=TRUE}) can account for this in two ways; controlled with argument \code{quoteInfo}. However, note that there is no way to properly read the data back to \R if \code{quote=TRUE} and \code{quoteInfo=FALSE} arguments were used for export. \code{quoteInfo} applies only when \code{quote=TRUE}. Assume that there is a file with quoted data as shown below (column numbers in first three lines are only for demonstration of the values in the output). \preformatted{ 123456789 12345678 # for position 123 1234567 123456 # for width with quoteInfo=TRUE 1 12345 1234 # for width with quoteInfo=FALSE "a" "hsgdh" " 9" " " " bb" " 123" } With \code{quoteInfo=TRUE} \code{write.fwf} will return \preformatted{ colname position width V1 1 3 V2 5 7 V3 13 6 } or (with \code{quoteInfo=FALSE}) \preformatted{ colname position width V1 2 1 V2 6 5 V3 14 4 } Argument \code{width} can be used to increase the width of the columns in the output. This argument is passed to the width argument of \code{\link{format}} function. Values in \code{width} are recycled if there is less values than the number of columns. If the specified width is too short in comparison to the "width" of the data in particular column, error is issued. } \value{ Besides its effect to write/export data \code{write.fwf} can provide information on format and width. If \code{formatInfo = FALSE}, then a data frame is returned with the following columns: \item{colname}{name of the column} \item{nlevels}{number of unique values (unused levels of factors are dropped), 0 for numeric column} \item{position}{starting column number in the output} \item{width}{width of the column} \item{digits}{number of digits after the decimal point} \item{exp}{width of exponent in exponential representation; 0 means there is no exponential representation, while 1 represents exponent of length one i.e. \code{1e+6} and 2 \code{1e+06} or \code{1e+16}} } \author{Gregor Gorjanc.} \seealso{ \code{\link{format.info}}, \code{\link{format}}, \code{\link{NAToUnknown}}, \code{\link{write.table}}, \code{\link{read.fwf}}, \code{\link{read.table}} and \code{\link{trim}}. } \examples{ ## Some data num <- round(c(733070.345678, 1214213.78765456, 553823.798765678, 1085022.8876545678, 571063.88765456, 606718.3876545678, 1053686.6, 971024.187656, 631193.398765456, 879431.1), digits=3) testData <- data.frame(num1=c(1:10, NA), num2=c(NA, seq(from=1, to=5.5, by=0.5)), num3=c(NA, num), int1=c(as.integer(1:4), NA, as.integer(4:9)), fac1=factor(c(NA, letters[1:9], "hjh")), fac2=factor(c(letters[6:15], NA)), cha1=c(letters[17:26], NA), cha2=c(NA, "longer", letters[25:17]), stringsAsFactors=FALSE) levels(testData$fac1) <- c(levels(testData$fac1), "unusedLevel") testData$Date <- as.Date("1900-1-1") testData$Date[2] <- NA testData$POSIXt <- as.POSIXct(strptime("1900-1-1 01:01:01", format="\%Y-\%m-\%d \%H:\%M:\%S")) testData$POSIXt[5] <- NA ## Default write.fwf(x=testData) ## NA should be - write.fwf(x=testData, na="-") ## NA should be -NA- write.fwf(x=testData, na="-NA-") ## Some other separator than space write.fwf(x=testData[, 1:4], sep="-mySep-") ## Force wider columns write.fwf(x=testData[, 1:5], width=20) ## Show effect of 'scientific' option testData$num3 <- testData$num3 * 1e8 write.fwf(testData, scientific=TRUE) write.fwf(testData, scientific=FALSE) testData$num3 <- testData$num3 / 1e8 ## Write to file and report format and fixed width information file <- tempfile() formatInfo <- write.fwf(x=testData, file=file, formatInfo=TRUE) formatInfo ## Read exported data back to R (note +1 due to separator) ## - without header read.fwf(file=file, widths=formatInfo$width + 1, header=FALSE, skip=1, strip.white=TRUE) ## - with header, via postimport modfication tmp <- read.fwf(file=file, widths=formatInfo$width + 1, skip=1, strip.white=TRUE) colnames(tmp) <- read.table(file=file, nrow=1, as.is=TRUE) tmp ## - with header, persuading read.fwf to accept header properly ## (thanks to Marc Schwartz) read.fwf(file=file, widths=formatInfo$width + 1, strip.white=TRUE, skip=1, col.names=read.table(file=file, nrow=1, as.is=TRUE)) ## - with header, using quotes write.fwf(x=testData, file=file, quote=TRUE) read.table(file=file, header=TRUE, strip.white=TRUE) ## Tidy up unlink(file) } \keyword{print} \keyword{file} gdata/man/startsWith.Rd0000644000176200001440000000403514510771613014557 0ustar liggesusers\name{startsWith} \alias{startsWith} \alias{starts_with} \title{Does String Start or End With Another String?} \description{ Determines if entries of \code{x} start with a string \code{prefix}, where strings are recycled to common lengths. } \usage{ startsWith(x, prefix, trim=FALSE, ignore.case=FALSE) } \arguments{ \item{x}{character vector whose \dQuote{starts} are considered.} \item{prefix}{character vector, typicall of length one, i.e., a string.} \item{trim}{whether leading and trailing spaces should be removed from \code{x} before testing for a match.} \item{ignore.case}{whether case should be ignored when testing for a match.} } \value{ A logical vector, of \dQuote{common length} of \code{x} and \code{prefix}, i.e., of the longer of the two lengths unless one of them is zero when the result is also of zero length. A shorter input is recycled to the output length. } \note{ The \code{base} package provides the underlying \code{startsWith} function that performs the string comparison. The \code{gdata} package adds the \code{trim} and \code{ignore.case} features. An alias function \code{starts_with} is also provided, equivalent to \code{gdata::startsWith}. Using \code{starts_with} in scripts makes it explicitly clear that the \code{gdata} implementation is being used. } \author{ Gregory R. Warnes \email{greg@warnes.net} } \seealso{ \code{\link[base]{startsWith}} for the 'base' package implementation, \code{\link[base]{grepl}}, \code{\link{substring}} } \examples{ ## Simple example startsWith("Testing", "Test") ## Vector examples s <- c("Testing", " Testing", "testing", "Texting") names(s) <- s startsWith(s, "Test") # " Testing", "testing", and "Texting" do not match startsWith(s, "Test", trim=TRUE) # Now " Testing" matches startsWith(s, "Test", ignore.case=TRUE) # Now "testing" matches # Comparison # gdata startsWith(s, "Test", trim=TRUE) startsWith(s, "Test", ignore.case=TRUE) # base startsWith(trimws(s), "Test") startsWith(tolower(s), tolower("Test")) } \keyword{character} gdata/man/unknown.Rd0000644000176200001440000001252314440625622014103 0ustar liggesusers\name{unknownToNA} \alias{isUnknown} \alias{isUnknown.default} \alias{isUnknown.POSIXlt} \alias{isUnknown.list} \alias{isUnknown.data.frame} \alias{isUnknown.matrix} \alias{unknownToNA} \alias{unknownToNA.default} \alias{unknownToNA.factor} \alias{unknownToNA.list} \alias{unknownToNA.data.frame} \alias{NAToUnknown} \alias{NAToUnknown.default} \alias{NAToUnknown.factor} \alias{NAToUnknown.list} \alias{NAToUnknown.data.frame} \concept{missing} \title{Change unknown values to NA and vice versa} \description{ Unknown or missing values (\code{NA} in \R) can be represented in various ways (as 0, 999, etc.) in different programs. \code{isUnknown}, \code{unknownToNA}, and \code{NAToUnknown} can help to change unknown values to \code{NA} and vice versa. } \usage{ isUnknown(x, unknown=NA, \dots) unknownToNA(x, unknown, warning=FALSE, \dots) NAToUnknown(x, unknown, force=FALSE, call.=FALSE, \dots) } \arguments{ \item{x}{generic, object with unknown value(s)} \item{unknown}{generic, value used instead of \code{NA}} \item{warning}{logical, issue warning if \code{x} already has \code{NA}} \item{force}{logical, force to apply already existing value in \code{x}} \item{\dots}{arguments pased to other methods (as.character for POSIXlt in case of isUnknown)} \item{call.}{logical, look in \code{\link{warning}}} } \details{ This functions were written to handle different variants of \dQuote{other \code{NA}} like representations that are usually used in various external data sources. \code{unknownToNA} can help to change unknown values to \code{NA} for work in \R, while \code{NAToUnknown} is meant for the opposite and would usually be used prior to export of data from \R. \code{isUnknown} is a utility function for testing for unknown values. All functions are generic and the following classes were tested to work with latest version: \dQuote{integer}, \dQuote{numeric}, \dQuote{character}, \dQuote{factor}, \dQuote{Date}, \dQuote{POSIXct}, \dQuote{POSIXlt}, \dQuote{list}, \dQuote{data.frame} and \dQuote{matrix}. For others default method might work just fine. \code{unknownToNA} and \code{isUnknown} can cope with multiple values in \code{unknown}, but those should be given as a \dQuote{vector}. If not, coercing to vector is applied. Argument \code{unknown} can be feed also with \dQuote{list} in \dQuote{list} and \dQuote{data.frame} methods. If named \dQuote{list} or \dQuote{vector} is passed to argument \code{unknown} and \code{x} is also named, matching of names will occur. Recycling occurs in all \dQuote{list} and \dQuote{data.frame} methods, when \code{unknown} argument is not of the same length as \code{x} and \code{unknown} is not named. Argument \code{unknown} in \code{NAToUnknown} should hold value that is not already present in \code{x}. If it does, error is produced and one can bypass that with \code{force=TRUE}, but be warned that there is no way to distinguish values after this action. Use at your own risk! Anyway, warning is issued about new value in \code{x}. Additionally, caution should be taken when using \code{NAToUnknown} on factors as additional level (value of \code{unknown}) is introduced. Then, as expected, \code{unknownToNA} removes defined level in \code{unknown}. If \code{unknown="NA"}, then \code{"NA"} is removed from factor levels in \code{unknownToNA} due to consistency with conversions back and forth. Unknown representation in \code{unknown} should have the same class as \code{x} in \code{NAToUnknown}, except in factors, where \code{unknown} value is coerced to character anyway. Silent coercing is also applied, when \dQuote{integer} and \dQuote{numeric} are in question. Otherwise warning is issued and coercing is tried. If that fails, \R introduces \code{NA} and the goal of \code{NAToUnknown} is not reached. \code{NAToUnknown} accepts only single value in \code{unknown} if \code{x} is atomic, while \dQuote{list} and \dQuote{data.frame} methods accept also \dQuote{vector} and \dQuote{list}. \dQuote{list/data.frame} methods can work on many components/columns. To reduce the number of needed specifications in \code{unknown} argument, default unknown value can be specified with component ".default". This matches component/column ".default" as well as all other undefined components/columns! Look in examples. } \value{ \code{unknownToNA} and \code{NAToUnknown} return modified \code{x}. \code{isUnknown} returns logical values for object \code{x}. } \author{Gregor Gorjanc} \seealso{\code{\link{is.na}}} \examples{ xInt <- c(0, 1, 0, 5, 6, 7, 8, 9, NA) isUnknown(x=xInt, unknown=0) isUnknown(x=xInt, unknown=c(0, NA)) (xInt <- unknownToNA(x=xInt, unknown=0)) (xInt <- NAToUnknown(x=xInt, unknown=0)) xFac <- factor(c("0", 1, 2, 3, NA, "NA")) isUnknown(x=xFac, unknown=0) isUnknown(x=xFac, unknown=c(0, NA)) isUnknown(x=xFac, unknown=c(0, "NA")) isUnknown(x=xFac, unknown=c(0, "NA", NA)) (xFac <- unknownToNA(x=xFac, unknown="NA")) (xFac <- NAToUnknown(x=xFac, unknown="NA")) xList <- list(xFac=xFac, xInt=xInt) isUnknown(xList, unknown=c("NA", 0)) isUnknown(xList, unknown=list("NA", 0)) tmp <- c(0, "NA") names(tmp) <- c(".default", "xFac") isUnknown(xList, unknown=tmp) tmp <- list(.default=0, xFac="NA") isUnknown(xList, unknown=tmp) (xList <- unknownToNA(xList, unknown=tmp)) (xList <- NAToUnknown(xList, unknown=999)) } \keyword{manip} \keyword{NA} gdata/man/first.Rd0000644000176200001440000000277014440625622013536 0ustar liggesusers\name{first} \alias{first} \alias{last} \alias{first<-} \alias{last<-} \title{Return first or last element of an object} \description{ Return first or last element of an object. These functions are convenience wrappers for \code{head(x, n=1, \dots)} and \code{tail(x, n=1, \dots)}. } \usage{ first(x, n=1, \dots) last(x, n=1, \dots) first(x, n=1, \dots) <- value last(x, n=1, \dots) <- value } \arguments{ \item{x}{data object} \item{n}{a single integer. If positive, size for the resulting object: number of elements for a vector (including lists), rows for a matrix or data frame or lines for a function. If negative, all but the 'n' last/first number of elements of 'x'.} \item{\dots}{arguments to be passed to or from other methods.} \item{value}{a vector of values to be assigned (should be of length \code{n})} } \value{ An object (usually) like 'x' but generally smaller. } \author{ Gregory R. Warnes \email{greg@warnes.net} } \seealso{ \code{\link[utils]{head}}, \code{\link[utils]{tail}}, \code{\link{left}}, \code{\link{right}} } \examples{ ## Vector v <- 1:10 first(v) last(v) first(v) <- 9 v last(v) <- 20 v ## List l <- list(a=1, b=2, c=3) first(l) last(l) first(l) <- "apple" last(l) <- "banana" l ## Data frame df <- data.frame(a=1:2, b=3:4, c=5:6) first(df) last(df) first(df) <- factor(c("red","green")) last(df) <- list(c(20,30)) # note the enclosing list! df ## Matrix m <- as.matrix(df) first(m) last(m) first(m) <- "z" last(m) <- "q" m } \keyword{manip} gdata/man/Args.Rd0000644000176200001440000000161314440625622013276 0ustar liggesusers\name{Args} \alias{Args} \title{Describe Function Arguments} \description{ Display function argument names and corresponding default values, formatted in two columns for easy reading. } \usage{ Args(name, sort=FALSE) } \arguments{ \item{name}{a function or function name.} \item{sort}{whether arguments should be sorted.} } \value{ A data frame with named rows and a single column called \code{value}, containing the default value of each argument. } \note{ Primitive functions like \code{sum} and \code{all} have no formal arguments. See the \code{\link{formals}} help page. } \author{Arni Magnusson} \seealso{ \code{Args} is a verbose alternative to \code{\link{args}}, based on \code{\link{formals}}. \code{\link{help}} also describes function arguments. } \examples{ Args(glm) Args(scan) Args(legend, sort=TRUE) } \keyword{programming} \keyword{utilities} \keyword{documentation} gdata/man/humanReadable.Rd0000644000176200001440000001364414440625622015141 0ustar liggesusers\name{humanReadable} \alias{humanReadable} \title{Print Byte Size in Human Readable Format} \description{ Convert integer byte sizes to a human readable units such as kB, MB, GB, etc. } \usage{ humanReadable(x, units="auto", standard=c("IEC", "SI", "Unix"), digits=1, width=NULL, sep=" ", justify=c("right", "left")) } \arguments{ \item{x}{integer, byte size} \item{standard}{character, "IEC" for powers of 1024 ('MiB'), "SI" for powers of 1000 ('MB'), or "Unix" for powers of 1024 ('M'). See details.} \item{units}{character, unit to use for all values (optional), one of "auto", "bytes", or an appropriate unit corresponding to \code{standard}.} \item{digits}{integer, number of digits after decimal point} \item{width}{integer, width of number string} \item{sep}{character, separator between number and unit} \item{justify}{two-element vector specifiy the alignment for the number and unit components of the size. Each element should be one of "none", "left", "right", or "center"} } \details{ The basic unit used to store information in computers is a bit. Bits are represented as zeroes and ones - binary number system. Although, the binary number system is not the same as the decimal number system, decimal prefixes for binary multiples such as kilo and mega are often used. In the decimal system kilo represent 1000, which is close to \eqn{1024 = 2^{10}} in the binary system. This sometimes causes problems as it is not clear which powers (2 or 10) are used in a notation like 1 kB. To overcome this problem International Electrotechnical Commission (IEC) has provided the following solution to this problem: \tabular{lrcll}{ Name \tab System \tab Symbol \tab Size \tab Conversion \cr byte \tab binary \tab B \tab \eqn{2^3} \tab 8 bits \cr kilobyte \tab decimal \tab kB \tab \eqn{10^3} \tab 1000 bytes \cr kibibyte \tab binary \tab KiB \tab \eqn{2^{10}} \tab 1024 bytes \cr megabyte \tab decimal \tab MB \tab \eqn{(10^3)^2} \tab 1000 kilobytes\cr mebibyte \tab binary \tab MiB \tab \eqn{(2^{10})^2} \tab 1024 kibibytes\cr gigabyte \tab decimal \tab GB \tab \eqn{(10^3)^3} \tab 1000 megabytes\cr gibibyte \tab binary \tab GiB \tab \eqn{(2^{10})^3} \tab 1024 mebibytes\cr terabyte \tab decimal \tab TB \tab \eqn{(10^3)^4} \tab 1000 gigabytes\cr tebibyte \tab binary \tab TiB \tab \eqn{(2^{10})^4} \tab 1024 gibibytes\cr petabyte \tab decimal \tab PB \tab \eqn{(10^3)^5} \tab 1000 terabytes\cr pebibyte \tab binary \tab PiB \tab \eqn{(2^{10})^5} \tab 1024 tebibytes\cr exabyte \tab decimal \tab EB \tab \eqn{(10^3)^6} \tab 1000 petabytes\cr exbibyte \tab binary \tab EiB \tab \eqn{(2^{10})^6} \tab 1024 pebibytes\cr zettabyte \tab decimal \tab ZB \tab \eqn{(10^3)^7} \tab 1000 exabytes\cr zebibyte \tab binary \tab ZiB \tab \eqn{(2^{10})^7} \tab 1024 exbibytes\cr yottabyte \tab decimal \tab YB \tab \eqn{(10^3)^8} \tab 1000 zettabytes\cr yebibyte \tab binary \tab YiB \tab \eqn{(2^{10})^8} \tab 1024 zebibytes\cr } where Zi and Yi are GNU extensions to IEC. To get the output in the decimal system (powers of 1000) use \code{standard="SI"}. To obtain IEC standard (powers of 1024) use \code{standard="IEC"}. In addition, single-character units are provided that follow (and extend) the Unix pattern (use \code{standard="Unix"}): \tabular{lrcll}{ Name \tab System \tab Symbol \tab Size \tab Conversion \cr byte \tab binary \tab B \tab \eqn{2^3} \tab 8 bits \cr kibibyte \tab binary \tab K \tab \eqn{2^{10}} \tab 1024 bytes \cr mebibyte \tab binary \tab M \tab \eqn{(2^{10})^2} \tab 1024 kibibytes\cr gibibyte \tab binary \tab G \tab \eqn{(2^{10})^3} \tab 1024 mebibytes\cr tebibyte \tab binary \tab T \tab \eqn{(2^{10})^4} \tab 1024 gibibytes\cr pebibyte \tab binary \tab P \tab \eqn{(2^{10})^5} \tab 1024 tebibytes\cr exbibyte \tab binary \tab E \tab \eqn{(2^{10})^6} \tab 1024 pebibytes\cr zebibyte \tab binary \tab Z \tab \eqn{(2^{10})^7} \tab 1024 exbibytes\cr yottabyte \tab binary \tab Y \tab \eqn{(2^{10})^8} \tab 1024 zebibytes\cr } For printout both \code{digits} and \code{width} can be specified. If \code{width} is \code{NULL}, all values have given number of digits. If \code{width} is not \code{NULL}, output is rounded to a given width and formated similar to human readable format of the Unix \code{ls}, \code{df} or \code{du} shell commands. } \references{ Wikipedia: \url{https://en.wikipedia.org/wiki/Byte} \url{https://en.wikipedia.org/wiki/SI_prefix} \url{https://en.wikipedia.org/wiki/Binary_prefix} GNU manual for coreutils: \url{https://www.gnu.org/software/coreutils/manual/html_node/Block-size.html} } \value{ Byte size in human readable format as character with proper unit symbols added at the end of the string. } \author{Ales Korosec, Gregor Gorjanc, and Gregory R. Warnes \email{greg@warnes.net}} \seealso{ \code{\link{object.size}} in package 'gdata', \code{\link[utils]{object.size}} in package 'utils', \code{\link[gdata]{ll}} } \examples{ # Simple example: maximum addressible size of 32 bit pointer humanReadable(2^32-1) humanReadable(2^32-1, standard="IEC") humanReadable(2^32-1, standard="SI") humanReadable(2^32-1, standard="Unix") humanReadable(2^32-1, unit="MiB") humanReadable(2^32-1, standard="IEC", unit="MiB") humanReadable(2^32-1, standard="SI", unit="MB") humanReadable(2^32-1, standard="Unix", unit="M") # Vector of sizes matrix(humanReadable(c(60810, 124141, 124, 13412513), width=4)) matrix(humanReadable(c(60810, 124141, 124, 13412513), width=4, unit="KiB")) # Specify digits rather than width matrix(humanReadable(c(60810, 124141, 124, 13412513), width=NULL, digits=2)) # Change the justification matrix(humanReadable(c(60810, 124141, 124, 13412513), width=NULL, justify=c("right", "right"))) } \keyword{misc} gdata/man/trim.Rd0000644000176200001440000000334414440625622013360 0ustar liggesusers\name{trim} \alias{trim} \title{Remove leading and trailing spaces from character strings} \description{ Remove leading and trailing spaces from character strings and other related objects. } \usage{ trim(s, recode.factor=TRUE, \dots) } \arguments{ \item{s}{object to be processed} \item{recode.factor}{should levels of a factor be recoded, see below} \item{\dots}{arguments passed to other methods, currently only to \code{\link{reorder.factor}} for factors} } \details{ \code{trim} is a generic function, where default method does nothing, while method for character \code{s} trims its elements and method for factor \code{s} trims \code{\link{levels}}. There are also methods for \code{list} and \code{data.frame}. Trimming character strings can change the sort order in some locales. For factors, this can affect the coding of levels. By default, factor levels are recoded to match the trimmed sort order, but this can be disabled by setting \code{recode.factor=FALSE}. Recoding is done with \code{\link{reorder.factor}}. } \value{ \code{s} with all leading and trailing spaces removed in its elements. } \author{ Gregory R. Warnes \email{greg@warnes.net} with contributions by Gregor Gorjanc } \seealso{\code{\link[base]{trimws}}, \code{\link[base]{sub}}, \code{\link[base]{gsub}} as well as argument \code{strip.white} in \code{\link{read.table}} and \code{\link{reorder.factor}} } \examples{ s <- " this is an example string " trim(s) f <- factor(c(s, s, " A", " B ", " C ", "D ")) levels(f) trim(f) levels(trim(f)) trim(f, recode.factor=FALSE) levels(trim(f, recode.factor=FALSE)) l <- list(s=rep(s, times=6), f=f, i=1:6) trim(l) df <- as.data.frame(l) trim(df) } \keyword{manip} \keyword{character} gdata/man/env.Rd0000644000176200001440000000164014440625622013172 0ustar liggesusers\name{env} \alias{env} \title{Describe All Loaded Environments} \description{ Display name, number of objects, and size of all loaded environments. } \usage{ env(unit="KB", digits=0) } \arguments{ \item{unit}{unit for displaying environment size: "bytes", "KB", "MB", or first letter.} \item{digits}{number of decimals to display when rounding environment size.} } \value{ A data frame with the following columns: \item{Environment}{environment name.} \item{Objects}{number of objects in environment.} \item{KB}{environment size \emph{(see notes)}.} } \note{ The name of the environment size column is the same as the unit used. } \author{Arni Magnusson} \seealso{ \code{env} is a verbose alternative to \code{\link{search}}. \code{\link{ll}} is a related function that describes objects in an environment. } \examples{ \dontrun{ env() } } \keyword{data} \keyword{environment} \keyword{utilities} gdata/man/interleave.Rd0000644000176200001440000000414114440625622014537 0ustar liggesusers\name{interleave} \alias{interleave} \title{Interleave Rows of Data Frames or Matrices} \description{ Interleave rows of data frames or matrices. } \usage{ interleave(\dots, append.source=TRUE, sep=": ", drop=FALSE) } \arguments{ \item{\dots}{objects to be interleaved.} \item{append.source}{boolean flag. When \code{TRUE} (the default) the argument name will be appended to the row names to show the source of each row.} \item{sep}{separator between the original row name and the object name.} \item{drop}{boolean flag - when TRUE, matrices containing one column will be converted to vectors.} } \details{ This function creates a new matrix or data frame from its arguments. The new object will have all of the rows from the source objects interleaved. Starting with row 1 of object 1, followed by row 1 of object 2, \ldots, row 1 of object 'n', row 2 of object 1, row 2 of object 2, \ldots, row 2 of object 'n', etc. } \value{ Matrix containing the interleaved rows of the function arguments. } \author{Gregory R. Warnes \email{greg@warnes.net}} \seealso{\code{\link{cbind}}, \code{\link{rbind}}, \code{\link{combine}}} \examples{ # Simple example a <- matrix(1:10,ncol=2,byrow=TRUE) b <- matrix(letters[1:10],ncol=2,byrow=TRUE) c <- matrix(LETTERS[1:10],ncol=2,byrow=TRUE) interleave(a,b,c) # Create a 2-way table of means, standard errors, and nobs g1 <- sample(letters[1:5], 1000, replace=TRUE) g2 <- sample(LETTERS[1:3], 1000, replace=TRUE) dat <- rnorm(1000) stderr <- function(x) sqrt(var(x,na.rm=TRUE) / nobs(x)) means <- tapply(dat, list(g1, g2), mean) stderrs <- tapply(dat, list(g1, g2), stderr) ns <- tapply(dat, list(g1, g2), nobs) blanks <- matrix(" ", nrow=5, ncol=3) tab <- interleave("Mean"=round(means,2), "Std Err"=round(stderrs,2), "N"=ns, " "=blanks, sep=" ") print(tab, quote=FALSE) # Using drop to control coercion to a lower dimensions m1 <- matrix(1:4) m2 <- matrix(5:8) interleave(m1, m2, drop=TRUE) # this will be coerced to a vector interleave(m1, m2, drop=FALSE) # this will remain a matrix } \keyword{category} \keyword{array} gdata/man/is.what.Rd0000644000176200001440000000220614440625622013756 0ustar liggesusers\name{is.what} \alias{is.what} \title{Run Multiple is.* Tests on a Given Object} \description{ Run multiple \code{is.*} tests on a given object: \code{is.na}, \code{is.numeric}, and many others. } \usage{ is.what(object, verbose=FALSE) } \arguments{ \item{object}{any \R object.} \item{verbose}{whether negative tests should be included in output.} } \value{ A character vector containing positive tests, or when \code{verbose} is \code{TRUE}, a data frame showing all test results. } \author{Arni Magnusson, inspired by \code{demo(is.things)}.} \note{ The following procedure is used to look for valid tests: \enumerate{ \item{}{Find all objects named \code{is.*} in all loaded environments.} \item{}{Discard objects that are not functions.} \item{}{Include test result only if it is of class \code{"logical"}, not an \code{NA}, and of length 1.} } } \seealso{ \code{\link{is.na}} and \code{\link{is.numeric}} are commonly used tests. } \examples{ is.what(pi) is.what(NA, verbose=TRUE) is.what(lm(1~1)) is.what(is.what) } \keyword{classes} \keyword{NA} \keyword{programming} \keyword{error} \keyword{utilities} gdata/man/duplicated2.Rd0000644000176200001440000000356714440625622014614 0ustar liggesusers\name{duplicated2} \alias{duplicated2} \title{Determine Duplicate Elements} \description{ \code{duplicated2()} determines which elements of a vector or data frame are duplicates, and returns a logical vector indicating which elements (rows) are duplicates. } \usage{ duplicated2(x, bothWays=TRUE, \dots) } \arguments{ \item{x}{a vector or a data frame or an array or \code{NULL}.} \item{bothWays}{if \code{TRUE} (the default), duplication should be considered from both sides. For more information see the argument \code{fromLast} to the function \code{\link{duplicated}}.} \item{\dots}{further arguments passed down to \code{duplicated()} and its methods.} } \details{ The standard \code{\link{duplicated}} function (in \code{package:base}) only returns \code{TRUE} for the second and following copies of each duplicated value (second-to-last and earlier when \code{fromLast=TRUE}). This function returns all duplicated elements, including the first (last) value. When \code{bothWays} is \code{FALSE}, \code{duplicated2()} defaults to a \code{\link{duplicated}} call. When \code{bothWays} is \code{TRUE}, the following call is being executed: \code{duplicated(x, \dots) | duplicated(x, fromLast=TRUE, \dots)} } \value{ For a vector input, a logical vector of the same length as \code{x}. For a data frame, a logical vector with one element for each row. For a matrix or array, and when \code{MARGIN = 0}, a logical array with the same dimensions and dimnames. For more details see \code{\link{duplicated}}. } \seealso{ \code{\link[base]{duplicated}}, \code{\link[base]{unique}} } \author{Liviu Andronic} \examples{ iris[duplicated(iris), ] # 2nd duplicated value iris[duplicated(iris, fromLast=TRUE), ] # 1st duplicated value iris[duplicated2(iris), ] # both duplicated values } \keyword{logic} \keyword{manip} gdata/man/wideByFactor.Rd0000644000176200001440000000315214440625622014764 0ustar liggesusers\name{wideByFactor} \alias{wideByFactor} \title{Create multivariate data by a given factor} \description{ Modify data frame in such a way that variables are \dQuote{separated} into several columns by factor levels. } \usage{ wideByFactor(x, factor, common, sort=TRUE, keepFactor=TRUE) } \arguments{ \item{x}{data frame} \item{factor}{character, column name of a factor by which variables will be divided} \item{common}{character, column names of (common) columns that should not be divided} \item{sort}{logical, sort resulting data frame by factor levels} \item{keepFactor}{logical, keep the \sQuote{factor} column} } \details{ Given data frame is modified so that the output represents a data frame with \eqn{c + f + n * v} columns, where \eqn{c} is a number of common columns for all levels of a factor, \eqn{f} is a factor column, \eqn{n} is a number of levels in factor \eqn{f} and \eqn{v} is a number of variables that should be divided for each level of a factor. Number of rows stays the same. } \value{ A data frame where divided variables have sort of \dQuote{diagonalized} structure. } \author{Gregor Gorjanc} \seealso{ \code{\link[stats]{reshape}} in the \pkg{stats} package. } \examples{ n <- 10 f <- 2 tmp <- data.frame(y1=rnorm(n=n), y2=rnorm(n=n), f1=factor(rep(letters[1:f], n/2)), f2=factor(c(rep("M", n/2), rep("F", n/2))), c1=1:n, c2=2*(1:n)) wideByFactor(x=tmp, factor="f1", common=c("c1", "c2", "f2")) wideByFactor(x=tmp, factor="f1", common=c("c1", "c2")) } \keyword{manip} \keyword{misc} gdata/man/update.list.Rd0000644000176200001440000000531114440625622014635 0ustar liggesusers\name{update.list} \alias{update.list} \alias{update.data.frame} \title{Update the elements of a list, or rows of a data frame} \description{ For a list, update the elements of a list to contain all of the named elements of a new list, overwriting elements with the same name, and (optionally) copying unnamed elements. For a data frame, replace the rows of a data frame by corresponding rows in 'new' with the same value for 'by'. } \usage{ \method{update}{list}(object, new, unnamed=FALSE, \dots) \method{update}{data.frame}(object, new, by, by.x=by, by.y=by, append=TRUE, verbose=FALSE, \dots) } \arguments{ \item{object}{List or data frame to be updated.} \item{new}{List or data frame containing new elements/rows.} \item{unnamed}{Logical. If \code{TRUE}, unnamed list elements of \code{new} will be appended to \code{object}.} \item{by, by.x, by.y}{Character. Name of column to use for matching data frame rows.} \item{append}{Logical. If \code{TRUE}, items in \code{new} with no match in \code{object} will be appended to the data frame.} \item{verbose}{Logical. If \code{TRUE} progress messages will be displayed.} \item{\dots}{optional method arguments (ignored).} } \note{ These methods can be called directly or as via the S3 base method for \code{update}. } \value{ \item{update.list}{a list a constructed from the elements of \code{object}, with named elements of \code{new} replacing corresponding named elements from \code{object}, and non-corresponding elements of \code{new} appended. If \code{unnamed=TRUE}, unnamed elements of \code{new} will be appended.} \item{update.data.frame}{a data frame constructed from the rows of \code{object} with rows where values in \code{by.x} equal the values in \code{by.y} replaced by the corresponding row in \code{new}. If \code{append=TRUE}, any elements of \code{new} without no matching rows in \code{object} will be appended.} } \author{Gregory R. Warnes \email{greg@warnes.net}} \seealso{ \code{\link[stats]{update}}, \code{\link[base]{merge}} } \examples{ # Update list old <- list(a=1,b="red",c=1.37) new <- list(b="green",c=2.4) update(old, new) update.list(old,new) # equivalent older <- list(a=0, b="orange", 4, 5, 6) newer <- list(b="purple", 7, 8, 9) update(older, newer) # ignores unnamed elements of newer update(older, newer, unnamed=TRUE) # appends unnamed elements of newer # Update data frame old <- data.frame(letter=letters[1:5], number=1:5) new <- data.frame(letter=letters[c(5, 1, 7)], number=c(-5, -1, -7)) update(old, new, by="letter") # default is append=TRUE update(old, new, by="letter", append=FALSE) update(old, new, by="letter", verbose=FALSE) } \keyword{data} \keyword{manip} gdata/man/cbindX.Rd0000644000176200001440000000162314440625622013612 0ustar liggesusers\name{cbindX} \alias{cbindX} \title{Column-bind objects with different number of rows} \description{ \code{cbindX} column-binds objects with different number of rows. } \usage{cbindX(\dots)} \arguments{ \item{\dots}{matrix and data.frame objects} } \details{ First the object with maximal number of rows is found. Other objects that have less rows get (via \code{\link{rbind}}) additional rows with \code{NA} values. Finally, all objects are column-binded (via \code{\link{cbind}}). } \value{See details.} \author{Gregor Gorjanc} \seealso{Regular \code{\link{cbind}} and \code{\link{rbind}}} \examples{ df1 <- data.frame(a=1:3, b=c("A", "B", "C")) df2 <- data.frame(c=as.character(1:5), a=5:1) ma1 <- matrix(as.character(1:4), nrow=2, ncol=2) ma2 <- matrix(1:6, nrow=3, ncol=2) cbindX(df1, df2) cbindX(ma1, ma2) cbindX(df1, ma1) cbindX(df1, df2, ma1, ma2) cbindX(ma1, ma2, df1, df2) } \keyword{misc} gdata/man/ls.funs.Rd0000644000176200001440000000143014440625622013767 0ustar liggesusers\name{ls.funs} \alias{ls.funs} \title{List function objects} \description{ Return a character vector giving the names of function objects in the specified environment. } \usage{ ls.funs(\dots) } \arguments{ \item{\dots}{Arguments passed to \code{ls}. See the help for \code{\link[base]{ls}} for details.} } \details{ This function calls \code{ls} and then returns a character vector containing only the names of only function objects. } \value{ character vector } \author{ Gregory R. Warnes \email{greg@warnes.net} } \seealso{ \code{\link[base]{ls}}, \code{\link[base]{is.function}} } \examples{ ## List functions defined in the global environment: ls.funs() ## List functions available in the base package: ls.funs("package:base") } \keyword{misc} \keyword{environment} gdata/man/upperTriangle.Rd0000644000176200001440000000425314440625622015226 0ustar liggesusers\name{upperTriangle} \alias{upperTriangle} \alias{upperTriangle<-} \alias{lowerTriangle} \alias{lowerTriangle<-} \title{Extract or replace the upper/lower triangular portion of a matrix} \description{ Extract or replace the upper/lower triangular portion of a matrix. } \usage{ upperTriangle(x, diag=FALSE, byrow=FALSE) upperTriangle(x, diag=FALSE, byrow=FALSE) <- value lowerTriangle(x, diag=FALSE, byrow=FALSE) lowerTriangle(x, diag=FALSE, byrow=FALSE) <- value } \arguments{ \item{x}{Matrix} \item{diag}{Logical. If \code{TRUE}, include the matrix diagonal.} \item{byrow}{Logical. If \code{FALSE}, return/replace elements in column-wise order. If \code{TRUE}, return/replace elements in row-wise order.} \item{value}{Either a single value or a vector of length equal to that of the current upper/lower triangular. Should be of a mode which can be coerced to that of \code{x}.} } \value{ \code{upperTriangle(x)} and \code{lowerTriangle(x)} return the upper or lower triangle of matrix x, respectively. The assignment forms replace the upper or lower triangular area of the matrix with the provided value(s). } \note{ By default, the elements are returned/replaced in R's default column-wise order. Thus \preformatted{lowerTriangle(x) <- upperTriangle(x)} will not yield a symmetric matrix. Instead use: \preformatted{lowerTriangle(x) <- upperTriangle(x, byrow=TRUE)} or equivalently: \preformatted{lowerTriangle(x, byrow=TRUE) <- upperTriangle(x)} } \author{Gregory R. Warnes \email{greg@warnes.net}} \seealso{ \code{\link[base]{diag}}, \code{\link[base]{lower.tri}}, \code{\link[base]{upper.tri}} } \examples{ x <- matrix(1:25, nrow=5, ncol=5) x upperTriangle(x) upperTriangle(x, diag=TRUE) upperTriangle(x, diag=TRUE, byrow=TRUE) lowerTriangle(x) lowerTriangle(x, diag=TRUE) lowerTriangle(x, diag=TRUE, byrow=TRUE) upperTriangle(x) <- NA x upperTriangle(x, diag=TRUE) <- 1:15 x lowerTriangle(x) <- NA x lowerTriangle(x, diag=TRUE) <- 1:15 x ## Copy lower triangle into upper triangle to make ## the matrix (diagonally) symmetric x <- matrix(LETTERS[1:25], nrow=5, ncol=5, byrow=TRUE) x lowerTriangle(x) = upperTriangle(x, byrow=TRUE) x } \keyword{array} gdata/man/combine.Rd0000644000176200001440000000336414440625622014023 0ustar liggesusers\name{combine} \alias{combine} \title{Combine R Objects With a Column Labeling the Source} \description{ Take a sequence of vector, matrix or data frames and combine into rows of a common data frame with an additional column \code{source} indicating the source object. } \usage{ combine(\dots, names=NULL) } \arguments{ \item{\dots}{vectors or matrices to combine.} \item{names}{character vector of names to use when creating source column.} } \details{ If there are several matrix arguments, they must all have the same number of columns. The number of columns in the result will be one larger than the number of columns in the component matrixes. If all of the arguments are vectors, these are treated as single column matrixes. In this case, the column containing the combineinated vector data is labeled \code{data}. When the arguments consist of a mix of matrices and vectors the number of columns of the result is determined by the number of columns of the matrix arguments. Vectors are considered row vectors and have their values recycled or subsetted (if necessary) to achieve this length. The \code{source} column is created as a factor with levels corresponding to the name of the object from which the each row was obtained. When the \code{names} argument is ommitted, the name of each object is obtained from the specified argument name in the call (if present) or from the name of the object. See below for examples. } \author{Gregory R. Warnes \email{greg@warnes.net}} \seealso{\code{\link{rbind}}, \code{\link{merge}}} \examples{ a <- matrix(rnorm(12),ncol=4,nrow=3) b <- 1:4 combine(a,b) combine(x=a,b) combine(x=a,y=b) combine(a,b,names=c("one","two")) c <- 1:6 combine(b,c) } \keyword{array} \keyword{manip} gdata/man/ConvertMedUnits.Rd0000644000176200001440000000423514440625622015476 0ustar liggesusers\name{ConvertMedUnits} \alias{ConvertMedUnits} \title{Convert medical measurements between International Standard (SI) and US 'Conventional' Units.} \description{ Convert Medical measurements between International Standard (SI) and US 'Conventional' Units. } \usage{ ConvertMedUnits(x, measurement, abbreviation, to = c("Conventional", "SI", "US"), exact = !missing(abbreviation)) } \arguments{ \item{x}{Vector of measurement values} \item{measurement}{Name of the measurement} \item{abbreviation}{Measurement abbreviation} \item{to}{Target units} \item{exact}{Logicial indicating whether matching should be exact} } \details{ Medical laboratories and practitioners in the United States use one set of units (the so-called 'Conventional' units) for reporting the results of clinical laboratory measurements, while the rest of the world uses the International Standard (SI) units. It often becomes necessary to translate between these units when participating in international collaborations. This function converts between SI and US 'Conventional' units. If \code{exact=FALSE}, \code{grep} will be used to do a case-insensitive sub-string search for matching measurement names. If more than one match is found, an error will be generated, along with a list of the matching entries. } \value{ Returns a vector of converted values. The attribute 'units' will contain the target units converted. } \seealso{ The data set \code{\link{MedUnits}} provides the conversion factors. } \references{ \url{https://globalrph.com/medical/conventional-units-international-units/} } \author{Gregory R. Warnes \email{greg@warnes.net}} \examples{ data(MedUnits) # Show available conversions MedUnits$Measurement # Convert SI Glucose measurement to 'Conventional' units GlucoseSI <- c(5, 5.4, 5, 5.1, 5.6, 5.1, 4.9, 5.2, 5.5) # in SI Units GlucoseUS <- ConvertMedUnits(GlucoseSI, "Glucose", to="US") cbind(GlucoseSI, GlucoseUS) \dontrun{ # See what happens when there is more than one match ConvertMedUnits(27.5, "Creatin", to="US") } # To solve the problem do: ConvertMedUnits(27.5, "Creatinine", to="US", exact=TRUE) } \keyword{manip} gdata/man/MedUnits.Rd0000644000176200001440000000410414440625622014130 0ustar liggesusers\name{MedUnits} \alias{MedUnits} \docType{data} \title{ Table of conversions between Intertional Standard (SI) and US 'Conventional' Units for common medical measurements. } \description{ Table of conversions between Intertional Standard (SI) and US 'Conventional' Units for common medical measurements. } \usage{data(MedUnits)} \format{ A data frame with the following 5 variables. \describe{ \item{Abbreviation}{Common Abbreviation (mostly missing)} \item{Measurement}{Measurement Name} \item{ConventionalUnit}{Conventional Unit} \item{Conversion}{Conversion factor} \item{SIUnit}{SI Unit} } } \details{ Medical laboratories and practitioners in the United States use one set of units (the so-called 'Conventional' units) for reporting the results of clinical laboratory measurements, while the rest of the world uses the International Standard (SI) units. It often becomes necessary to translate between these units when participating in international collaborations. This data set provides constants for converting between SI and US 'Conventional' units. To perform the conversion from SI units to US 'Conventional' units do: Measurement in \code{ConventionalUnit} = (Measurement in \code{SIUnit}) / \code{Conversion} To perform conversion from 'Conventional' to SI units do: Measurement in \code{SIUnit} = (Measurement in \code{ConventionalUnit}) * \code{Conversion} } \source{ \url{https://globalrph.com/medical/conventional-units-international-units/} } \seealso{ The function \code{\link{ConvertMedUnits}} automates the conversion task. } \examples{ data(MedUnits) # Show available conversions MedUnits$Measurement # Utility function matchUnits <- function(X) MedUnits[grep(X, MedUnits$Measurement),] # Convert SI Glucose measurement to 'Conventional' units GlucoseSI = c(5, 5.4, 5, 5.1, 5.6, 5.1, 4.9, 5.2, 5.5) # in SI Units GlucoseUS = GlucoseSI / matchUnits("Glucose")$Conversion cbind(GlucoseSI, GlucoseUS) # Also consider using ConvertMedUnits() ConvertMedUnits(GlucoseSI, "Glucose", to="US") } \keyword{datasets} gdata/man/reorder.Rd0000644000176200001440000000576614440625622014061 0ustar liggesusers\name{reorder.factor} \alias{reorder.factor} \title{Reorder the Levels of a Factor} \description{ Reorder the levels of a factor. } \usage{ \method{reorder}{factor}(x, X, FUN, \dots, order=is.ordered(x), new.order, sort=mixedsort) } \arguments{ \item{x}{factor} \item{X}{auxillary data vector} \item{FUN}{function to be applied to subsets of \code{X} determined by \code{x}, to determine factor order} \item{\dots}{optional parameters to \code{FUN}} \item{order}{logical value indicating whether the returned object should be an \code{\link{ordered}} factor} \item{new.order}{a vector of indexes or a vector of label names giving the order of the new factor levels} \item{sort}{function to use to sort the factor level names, used only when \code{new.order} is missing} } \details{ This function changes the order of the levels of a factor. It can do so via three different mechanisms, depending on whether, \code{X} \emph{and} \code{FUN}, \code{new.order} or \code{sort} are provided. If \code{X} \emph{and} \code{FUN} are provided: The data in \code{X} is grouped by the levels of \code{x} and \code{FUN} is applied. The groups are then sorted by this value, and the resulting order is used for the new factor level names. If \code{new.order} is a numeric vector, the new factor level names are constructed by reordering the factor levels according to the numeric values. If \code{new.order} is a chraccter vector, \code{new.order} gives the list of new factor level names. In either case levels omitted from \code{new.order} will become missing (\code{NA}) values. If \code{sort} is provided (as it is by default): The new factor level names are generated by calling the function specified by \code{sort} to the existing factor level \emph{names}. With \code{sort=mixedsort} (the default) the factor levels are sorted so that combined numeric and character strings are sorted in according to character rules on the character sections (including ignoring case), and the numeric rules for the numeric sections. See \code{\link[gtools]{mixedsort}} for details. } \value{A new factor with reordered levels} \author{Gregory R. Warnes \email{greg@warnes.net}} \seealso{ \code{\link{factor}} and \code{\link[stats]{reorder}} } \examples{ \dontshow{ set.seed(123456) } # Create a 4 level example factor trt <- factor(sample(c("PLACEBO", "300 MG", "600 MG", "1200 MG"), 100, replace=TRUE)) summary(trt) # Note that the levels are not in a meaningful order. # Change the order to something useful # - default "mixedsort" ordering trt2 <- reorder(trt) summary(trt2) # - using indexes: trt3 <- reorder(trt, new.order=c(4, 2, 3, 1)) summary(trt3) # - using label names: trt4 <- reorder(trt, new.order=c("PLACEBO", "300 MG", "600 MG", "1200 MG")) summary(trt4) # - using frequency trt5 <- reorder(trt, X=rnorm(100), FUN=mean) summary(trt5) # Drop out the '300 MG' level trt6 <- reorder(trt, new.order=c("PLACEBO", "600 MG", "1200 MG")) summary(trt6) } \keyword{manip} gdata/man/keep.Rd0000644000176200001440000000226714440625622013334 0ustar liggesusers\name{keep} \alias{keep} \title{Remove All Objects, Except Those Specified} \description{ Remove all objects from the user workspace, except those specified. } \usage{ keep(\dots, list=character(), all=FALSE, sure=FALSE) } \arguments{ \item{\dots}{objects to be kept, specified one by one, quoted or unquoted.} \item{list}{character vector of object names to be kept.} \item{all}{whether hidden objects (beginning with a \code{.}) should be removed, unless explicitly kept.} \item{sure}{whether to perform the removal, otherwise return names of objects that would be removed.} } \details{ Implemented with safety caps: objects whose name starts with a \code{.} are not removed unless \code{all=TRUE}, and an explicit \code{sure=TRUE} is required to remove anything. } \value{ A character vector containing object names that are deleted if \code{sure=TRUE}. } \author{Arni Magnusson} \seealso{ \code{keep} is a convenient interface to \code{\link{rm}} for removing most objects from the user workspace. } \examples{ data(trees, CO2) keep(trees) # To remove all objects except trees, run: # keep(trees, sure=TRUE) } \keyword{data} \keyword{environment} \keyword{utilities} gdata/man/ll.Rd0000644000176200001440000000410314440625622013006 0ustar liggesusers\name{ll} \alias{ll} \title{Describe Objects or Elements} \description{ Display name, class, size, and dimensions of each object in a given environment. Alternatively, if the main argument is an object, its elements are listed and described. } \usage{ ll(pos=1, unit="KB", digits=0, dim=FALSE, sort=FALSE, class=NULL, invert=FALSE, \dots) } \arguments{ \item{pos}{environment position number, environment name, data frame, list, model, S4 object, or any object that \code{is.list}.} \item{unit}{unit for displaying object size: "B", "KB", "MB", "GB", or first letter (case-insensitive).} \item{digits}{number of decimals to display when rounding object size.} \item{dim}{whether object dimensions should be returned.} \item{sort}{whether elements should be sorted by name.} \item{class}{character vector for limiting the output to specified classes.} \item{invert}{whether to invert the \code{class} filter, so specified classes are excluded.} \item{\dots}{passed to \code{ls}.} } \value{ A data frame with named rows and the following columns: \item{Class}{object class.} \item{KB}{object size \emph{(see note)}.} \item{Dim}{object dimensions \emph{(optional)}.} } \note{The name of the object size column is the same as the unit used.} \author{Arni Magnusson, with contributions by Jim Rogers and Michael Chirico.} \seealso{ \code{ll} is a verbose alternative to \code{\link{ls}} (objects in an environment), \code{\link{names}} (elements in a list-like object), and \code{\link{slotNames}} (S4 object). \code{\link{str}} and \code{\link{summary}} also describe elements in a list-like objects. \code{\link{env}} is a related function that describes all loaded environments. } \examples{ ll() ll(all=TRUE) ll("package:base") ll("package:base", class="function", invert=TRUE) ll(infert) model <- glm(case~spontaneous+induced, family=binomial, data=infert) ll(model, dim=TRUE) ll(model, sort=TRUE) ll(model$family) } \keyword{data} \keyword{attribute} \keyword{classes} \keyword{list} \keyword{environment} \keyword{print} \keyword{utilities} gdata/man/gdata-package.Rd0000644000176200001440000000426414510771613015060 0ustar liggesusers\name{gdata-package} \alias{gdata-package} \alias{gdata} \docType{package} \title{Various R Programming Tools for Data Manipulation} \description{ Various R programming tools for data manipulation, including: \itemize{ \item Medical unit conversions: \code{\link{ConvertMedUnits}}, \code{\link{MedUnits}} \item Combining objects: \code{link{bindData}}, \code{\link{cbindX}}, \code{\link{combine}}, \code{\link{interleave}} \item Character vector operations: \code{\link{centerText}}, \code{\link{startsWith}}, \code{\link{trim}} \item Factor manipulation: \code{\link{levels}}, \code{\link{reorder.factor}}, \code{\link{mapLevels}} \item Obtaining information about R objects: \code{\link{object_size}}, \code{\link{env}}, \code{\link{humanReadable}}, \code{\link{is.what}}, \code{\link{ll}}, \code{\link{keep}}, \code{\link{ls.funs}}, \code{\link{Args}}, \code{\link{nPairs}}, \code{\link{nobs}} \item Generating fixed-width format files: \code{\link{write.fwf}} \item Extracting components of date & time objects: \code{\link{getYear}}, \code{\link{getMonth}}, \code{\link{getDay}}, \code{\link{getHour}}, \code{\link{getMin}}, \code{\link{getSec}} \item Operations on columns of data frames: \code{\link{matchcols}}, \code{\link{rename.vars}} \item Matrix operations: \code{\link{unmatrix}}, \code{\link{upperTriangle}}, \code{\link{lowerTriangle}} \item Operations on vectors: \code{\link{case}}, \code{\link{unknownToNA}}, \code{\link{duplicated2}}, \code{\link{trimSum}} \item Operations on data frames: \code{\link{frameApply}}, \code{\link{wideByFactor}} \item Value of last evaluated expression: \code{\link{ans}} \item Wrapper for \code{sample} that ensures consistent behavior for both scalar and vector arguments: \code{\link{resample}} } } \note{\code{browseVignettes()} shows package vignettes.} \author{ Gregory R. Warnes, Gregor Gorjanc, Arni Magnusson, Liviu Andronic, Jim Rogers, Don MacQueen, and Ales Korosec, with contributions by Ben Bolker, Michael Chirico, Gabor Grothendieck, Thomas Lumley, and Brian Ripley. } \keyword{package} gdata/man/drop.levels.Rd0000644000176200001440000000205114440625622014634 0ustar liggesusers\name{drop.levels} \alias{drop.levels} \title{Drop unused factor levels} \description{Drop unused levels in a factor} \usage{ drop.levels(x, reorder=TRUE, \dots) } \arguments{ \item{x}{object to be processed} \item{reorder}{should factor levels be reordered using \code{\link{reorder.factor}}?} \item{\dots}{additional arguments to \code{\link{reorder.factor}}} } \details{ \code{drop.levels} is a generic function, where default method does nothing, while method for factor \code{s} drops all unused levels. Drop is done with \code{x[, drop=TRUE]}. There are also convenient methods for \code{list} and \code{data.frame}, where all unused levels are dropped in all factors (one by one) in a \code{list} or a \code{data.frame}. } \value{Input object without unused levels.} \author{Jim Rogers \email{james.a.rogers@pfizer.com} and Gregor Gorjanc} \examples{ f <- factor(c("A", "B", "C", "D"))[1:3] drop.levels(f) l <- list(f=f, i=1:3, c=c("A", "B", "D")) drop.levels(l) df <- as.data.frame(l) str(df) str(drop.levels(df)) } \keyword{manip} gdata/man/object_size.Rd0000644000176200001440000000724414510771613014710 0ustar liggesusers\name{object_size} \alias{object_size} \alias{c.object_sizes} \alias{as.object_sizes} \alias{is.object_sizes} \alias{format.object_sizes} \alias{print.object_sizes} \alias{object.size} \title{Report the Space Allocated for Objects} \description{ Provides an estimate of the memory that is being used to store \R objects. } \usage{ object_size(\dots) \method{is}{object_sizes}(x) \method{as}{object_sizes}(x) \method{c}{object_sizes}(\dots, recursive=FALSE) \method{format}{object_sizes}(x, humanReadable=getOption("humanReadable"), standard="IEC", units, digits=1, width=NULL, sep=" ", justify=c("right", "left"), \dots) \method{print}{object_sizes}(x, quote=FALSE, humanReadable=getOption("humanReadable"), standard="IEC", units, digits=1, width=NULL, sep=" ", justify=c("right", "left"), \dots) } \arguments{ \item{\dots}{\code{object_size}: \R objects; \code{print} and \code{format}: arguments to be passed to other methods.} \item{x}{output from \code{object_size}.} \item{quote}{whether or not the result should be printed with surrounding quotes.} \item{humanReadable}{whether to use the \dQuote{human readable} format.} \item{standard,units,digits,width,sep,justify}{passed to \code{\link{humanReadable}}.} \item{recursive}{passed to the \code{\link[base]{c}} method.} } \value{ A numeric vector class \code{c("object_sizes", "numeric")} containing estimated memory allocation attributable to the objects in bytes. } \details{ The base R package \code{utils} provides an \code{object.size} function that handles a single object. The \code{gdata} package provides a similar \code{object_size} function that handles multiple objects. Both the \code{utils} and \code{gdata} implementations store the object size in bytes, but offer a slightly different user interface for showing the object size in other formats. The \code{gdata} implementation offers human readable format similar to \code{ls}, \code{df} or \code{du} shell commands, by calling \code{humanReadable} directly, calling \code{print} with the argument \code{humanReadable=TRUE}, or by setting \code{options(humanReadable=TRUE)}. The 3.0.0 release of \code{gdata} renamed this function to \code{object_size}, allowing users to explicitly call the \code{gdata} implementation. This eliminates ambiguity and makes it less likely to get errors when running parts of an existing script without first loading the \code{gdata} package. The old \code{object.size} function name is now deprecated in the \code{gdata} package, pointing users to \code{object_size} and \code{utils::gdata} instead. } \seealso{ \code{\link[utils]{object.size}} in package 'utils' for the base R implementation, \code{\link{Memory-limits}} for the design limitations on object size, \code{\link{humanReadable}} for human readable format. } \examples{ object_size(letters) object_size(ls) # Find the 10 largest objects in the base package allObj <- sapply(ls("package:base"), function(x) object_size(get(x, envir=baseenv()))) (bigObj <- as.object_sizes(rev(sort(allObj))[1:10])) print(bigObj, humanReadable=TRUE) as.object_sizes(14567567) oldopt <- options(humanReadable=TRUE) (z <- object_size(letters, c(letters, letters), rep(letters, 100), rep(letters, 10000))) is.object_sizes(z) as.object_sizes(14567567) options(oldopt) # Comparison # gdata print(object_size(loadNamespace), humanReadable=TRUE) print(bigObj, humanReadable=TRUE) # utils print(utils::object.size(loadNamespace), units="auto") sapply(bigObj, utils:::format.object_size, units="auto") # ll ll("package:base")[order(-ll("package:base")$KB)[1:10],] } \keyword{utilities} gdata/man/mapLevels.Rd0000644000176200001440000001544214510771613014337 0ustar liggesusers\name{mapLevels} \alias{mapLevels} \alias{mapLevels.default} \alias{mapLevels.factor} \alias{mapLevels.character} \alias{mapLevels.list} \alias{mapLevels.data.frame} \alias{print.levelsMap} \alias{print.listLevelsMap} \alias{is.levelsMap} \alias{is.listLevelsMap} \alias{as.levelsMap} \alias{as.listLevelsMap} \alias{.checkLevelsMap} \alias{.checkListLevelsMap} \alias{"[.levelsMap"} \alias{"[.listLevelsMap"} \alias{c.levelsMap} \alias{c.listLevelsMap} \alias{unique.levelsMap} \alias{sort.levelsMap} \alias{mapLevels<-} \alias{mapLevels<-.default} \alias{mapLevels<-.factor} \alias{mapLevels<-.character} \alias{mapLevels<-.list} \alias{mapLevels<-.data.frame} \title{Mapping levels} \description{ \code{mapLevels} produces a map with information on levels and/or internal integer codes. As such can be conveniently used to store level mapping when one needs to work with internal codes of a factor and later transfrorm back to factor or when working with several factors that should have the same levels and therefore the same internal coding. } \usage{ mapLevels(x, codes=TRUE, sort=TRUE, drop=FALSE, combine=FALSE, \dots) mapLevels(x) <- value } \arguments{ \item{x}{object whose levels will be mapped, look into details} \item{codes}{boolean, create integer levelsMap (with internal codes) or character levelsMap (with level names)} \item{sort}{boolean, sort levels of character \code{x}, look into details} \item{drop}{boolean, drop unused levels} \item{combine}{boolean, combine levels, look into details} \item{\dots}{additional arguments for \code{sort}} \item{value}{levelsMap or listLevelsMap, output of \code{mapLevels} methods or constructed by user, look into details} } \section{mapLevels}{ The \code{mapLevels} function was written primarly for work with \dQuote{factors}, but is generic and can also be used with \dQuote{character}, \dQuote{list} and \dQuote{data.frame}, while \dQuote{default} method produces error. Here the term levels is also used for unique character values. When \code{codes=TRUE} \bold{integer \dQuote{levelsMap}} with information on mapping internal codes with levels is produced. Output can be used to transform integer to factor or remap factor levels as described below. With \code{codes=FALSE} \bold{character \dQuote{levelsMap}} is produced. The later is usefull, when one would like to remap factors or combine factors with some overlap in levels as described in \code{mapLevels<-} section and shown in examples. \code{sort} argument provides possibility to sort levels of \dQuote{character} \code{x} and has no effect when \code{x} is a \dQuote{factor}. Argument \code{combine} has effect only in \dQuote{list} and \dQuote{data.frame} methods and when \code{codes=FALSE} i.e. with \bold{character \dQuote{levelsMaps}}. The later condition is necesarry as it is not possible to combine maps with different mapping of level names and integer codes. It is assumed that passed \dQuote{list} and \dQuote{data.frame} have all components for which methods exist. Otherwise an error is produced. } \section{levelsMap and listLevelsMap}{ Function \code{mapLevels} returns a map of levels. This map is of class \dQuote{levelsMap}, which is actually a list of length equal to number of levels and with each component of length 1. Components need not be of length 1. There can be either integer or character \dQuote{levelsMap}. \bold{Integer \dQuote{levelsMap}} (when \code{codes=TRUE}) has names equal to levels and components equal to internal codes. \bold{Character \dQuote{levelsMap}} (when \code{codes=FALSE}) has names and components equal to levels. When \code{mapLevels} is applied to \dQuote{list} or \dQuote{data.frame}, result is of class \dQuote{listLevelsMap}, which is a list of \dQuote{levelsMap} components described previously. If \code{combine=TRUE}, result is a \dQuote{levelsMap} with all levels in \code{x} components. For ease of inspection, print methods unlists \dQuote{levelsMap} with proper names. \code{mapLevels<-} methods are fairly general and therefore additional convenience methods are implemented to ease the work with maps: \code{is.levelsMap} and \code{is.listLevelsMap}; \code{as.levelsMap} and \code{as.listLevelsMap} for coercion of user defined maps; generic \code{"["} and \code{c} for both classes (argument \code{recursive} can be used in \code{c} to coerce \dQuote{listLevelsMap} to \dQuote{levelsMap}) and generic \code{unique} and \code{sort} (generic from \R 2.4) for \dQuote{levelsMap}. } \section{mapLevels<-}{ Workhorse under \code{mapLevels<-} methods is \code{\link{levels<-}}. \code{mapLevels<-} just control the assignment of \dQuote{levelsMap} (integer or character) or \dQuote{listLevelsMap} to \code{x}. The idea is that map values are changed to map names as indicated in \code{\link{levels}} examples. \bold{Integer \dQuote{levelsMap}} can be applied to \dQuote{integer} or \dQuote{factor}, while \bold{character \dQuote{levelsMap}} can be applied to \dQuote{character} or \dQuote{factor}. Methods for \dQuote{list} and \dQuote{data.frame} can work only on mentioned atomic components/columns and can accept either \dQuote{levelsMap} or \dQuote{listLevelsMap}. Recycling occurs, if length of \code{value} is not the same as number of components/columns of a \dQuote{list/data.frame}. } \value{ \code{mapLevels()} returns \dQuote{levelsMap} or \dQuote{listLevelsMap} objects as described in levelsMap and listLevelsMap section. Result of \code{mapLevels<-} is always a factor with remapped levels or a \dQuote{list/data.frame} with remapped factors. } \author{Gregor Gorjanc} \seealso{ \code{\link{factor}}, \code{\link{levels}} and \code{\link{unclass}} } \examples{ ## Integer levelsMap (f <- factor(sample(letters, size=20, replace=TRUE))) (mapInt <- mapLevels(f)) ## Integer to factor (int <- as.integer(f)) (mapLevels(int) <- mapInt) all.equal(int, f) ## Remap levels of a factor (fac <- factor(as.integer(f))) (mapLevels(fac) <- mapInt) # the same as levels(fac) <- mapInt all.equal(fac, f) ## Character levelsMap f1 <- factor(letters[1:10]) f2 <- factor(letters[5:14]) ## Internal codes are the same, but levels are not as.integer(f1) as.integer(f2) ## Get character levelsMaps and combine them mapCha1 <- mapLevels(f1, codes=FALSE) mapCha2 <- mapLevels(f2, codes=FALSE) (mapCha <- c(mapCha1, mapCha2)) ## Remap factors mapLevels(f1) <- mapCha # the same as levels(f1) <- mapCha mapLevels(f2) <- mapCha # the same as levels(f2) <- mapCha ## Internal codes are now "consistent" among factors as.integer(f1) as.integer(f2) ## Remap characters to get factors f1 <- as.character(f1); f2 <- as.character(f2) mapLevels(f1) <- mapCha mapLevels(f2) <- mapCha ## Internal codes are now "consistent" among factors as.integer(f1) as.integer(f2) } \keyword{misc} \keyword{manip} gdata/man/resample.Rd0000644000176200001440000000242714440625622014216 0ustar liggesusers\name{resample} \alias{resample} \title{Consistent Random Samples and Permutations} \description{ Take a sample of the specified size from the elements of \code{x} using either with or without replacement. } \usage{ resample(x, size, replace = FALSE, prob = NULL) } \arguments{ \item{x}{A numeric, complex, character or logical vector from which to choose.} \item{size}{Non-negative integer giving the number of items to choose.} \item{replace}{Should sampling be with replacement?} \item{prob}{A vector of probability weights for obtaining the elements of the vector being sampled.} } \details{ \code{resample} differs from the S/R \code{sample} function in \code{resample} always considers \code{x} to be a vector of elements to select from, while \code{sample} treats a vector of length one as a special case and samples from \code{1:x}. Otherwise, the functions have identical behavior. } \value{ Vector of the same length as the input, with the elements permuted. } \author{Gregory R. Warnes \email{greg@warnes.net}} \seealso{\code{\link{sample}}} \examples{ ## Sample behavior differs if first argument is scalar vs vector sample(c(10)) sample(c(10, 10)) ## Resample has the consistent behavior for both cases resample(c(10)) resample(c(10, 10)) } \keyword{misc} gdata/man/case.Rd0000644000176200001440000000212214440625622013311 0ustar liggesusers\name{case} \alias{case} \title{Map elements of a vector according to the provided 'cases'} \description{ Map elements of a vector according to the provided 'cases'. This function is useful for mapping discrete values to factor labels and is the vector equivalent to the \code{switch} function. } \usage{ case(x, \dots, default = NA) } \arguments{ \item{x}{Vector to be converted} \item{\dots}{Map of alternatives, specified as "name"=value} \item{default}{Value to be assigned to elements of \code{x} not matching any of the alternatives. Defaults to \code{NA}.} } \details{ This function is to \code{switch} what \code{ifelse} is to \code{if}, and is a convenience wrapper for \code{factor}. } \value{ A factor variables with each element of \code{x} mapped into the corresponding level of specified in the mapping. } \author{Gregory R. Warnes \email{greg@warnes.net}} \seealso{\code{factor}, \code{switch}, \code{ifelse}} \examples{ ## default = NA case(c(1,1,4,3), "a"=1, "b"=2, "c"=3) ## default = "foo" case(c(1,1,4,3), "a"=1, "b"=2, "c"=3, default="foo") } \keyword{manip} gdata/man/ans.Rd0000644000176200001440000000160314440625622013162 0ustar liggesusers\name{ans} \alias{ans} \title{Value of Last Evaluated Expression} \usage{ ans() } \description{ The functon returns the value of the last evaluated \emph{top-level} expression, which is always assigned to \code{.Last.value} (in \code{package:base}). } \details{ This function retrieves \code{.Last.value}. For more details see \code{\link[base]{.Last.value}}. } \value{ \code{.Last.value} } \seealso{ \code{\link[base]{.Last.value}}, \code{\link[base]{eval}} } \author{Liviu Andronic} \examples{ 2+2 # Trivial calculation ans() # See the answer again gamma(1:15) # Some intensive calculation fac14 <- ans() # store the results into a variable rnorm(20) # Generate some standard normal values ans()^2 # Convert to Chi-square(1) values stem(ans()) # Now show a stem-and-leaf table } \keyword{programming} gdata/man/nobs.Rd0000644000176200001440000000327314510771613013347 0ustar liggesusers\name{nobs} \alias{nobs} \alias{n_obs} \alias{nobs.data.frame} \alias{nobs.default} \alias{nobs.lm} \title{Compute the Number of Non-Missing Observations} \description{ Compute the number of non-missing observations. Provides a new default method to handle numeric and logical vectors, and a method for data frames. } \usage{ nobs(object, \dots) \method{nobs}{default}(object, \dots) \method{nobs}{data.frame}(object, \dots) \method{nobs}{lm}(object, \dots) n_obs(object, \dots) } \arguments{ \item{object}{Numeric or logical vector, data frame, or a model object.} \item{\dots}{Further arguments to be passed to methods.} } \value{ Either single numeric value (for vectors) or a vector of numeric values (for data frames) giving the number of non-missing values. } \note{ The base R package \code{stats} provides a generic \code{nobs} function with methods for fitted model objects. The \code{gdata} package adds methods for numeric and logical vectors, as well as data frames. An alias function \code{n_obs} is also provided, equivalent to \code{gdata::nobs}. Using \code{n_obs} in scripts makes it explicitly clear that the \code{gdata} implementation is being used. } \author{Gregory R. Warnes \email{greg@warnes.net}} \seealso{ \code{\link[stats]{nobs}} in package 'stats' for the base R implementation, \code{\link{is.na}}, \code{\link{length}} } \examples{ x <- c(1, 2, 3, 5, NA, 6, 7, 1, NA) length(x) nobs(x) df <- data.frame(x=rnorm(100), y=rnorm(100)) df[1,1] <- NA df[1,2] <- NA df[2,1] <- NA nobs(df) fit <- lm(y~x, data=df) nobs(fit) n_obs(fit) # Comparison # gdata nobs(x) nobs(df) # stats length(na.omit(x)) sapply(df, function(x) length(na.omit(x))) } \keyword{attribute} gdata/man/bindData.Rd0000644000176200001440000000453214440625622014113 0ustar liggesusers\name{bindData} \alias{bindData} \title{Bind two data frames into a multivariate data frame} \description{ Usually data frames represent one set of variables and one needs to bind/join them for multivariate analysis. When \code{\link{merge}} is not the approriate solution, \code{bindData} might perform an appropriate binding for two data frames. This is especially usefull when some variables are measured once, while others are repeated. } \usage{ bindData(x, y, common) } \arguments{ \item{x}{data.frame} \item{y}{data.frame} \item{common}{character, list of column names that are common to both input data frames} } \details{ Data frames are joined in a such a way, that the new data frame has \eqn{c + (n_1 - c) + (n_2 - c)} columns, where \eqn{c} is the number of common columns, and \eqn{n_1} and \eqn{n_2} are the number of columns in the first and in the second data frame, respectively. } \value{ A data frame. } \author{Gregor Gorjanc} \seealso{ \code{\link[base]{merge}}, \code{\link{wideByFactor}} } \examples{ n1 <- 6 n2 <- 12 n3 <- 4 ## Single trait 1 num <- c(5:n1, 10:13) (tmp1 <- data.frame(y1=rnorm(n=n1), f1=factor(rep(c("A", "B"), n1/2)), ch=letters[num], fa=factor(letters[num]), nu=(num) + 0.5, id=factor(num), stringsAsFactors=FALSE)) ## Single trait 2 with repeated records, some subjects also in tmp1 num <- 4:9 (tmp2 <- data.frame(y2=rnorm(n=n2), f2=factor(rep(c("C", "D"), n2/2)), ch=letters[rep(num, times=2)], fa=factor(letters[rep(c(num), times=2)]), nu=c((num) + 0.5, (num) + 0.25), id=factor(rep(num, times=2)), stringsAsFactors=FALSE)) ## Single trait 3 with completely distinct set of subjects num <- 1:4 (tmp3 <- data.frame(y3=rnorm(n=n3), f3=factor(rep(c("E", "F"), n3/2)), ch=letters[num], fa=factor(letters[num]), nu=(num) + 0.5, id=factor(num), stringsAsFactors=FALSE)) ## Combine all datasets (tmp12 <- bindData(x=tmp1, y=tmp2, common=c("id", "nu", "ch", "fa"))) (tmp123 <- bindData(x=tmp12, y=tmp3, common=c("id", "nu", "ch", "fa"))) ## Sort by subject tmp123[order(tmp123$ch), ] } \keyword{manip} \keyword{misc} gdata/man/frameApply.Rd0000644000176200001440000000742414440625622014510 0ustar liggesusers\name{frameApply} \alias{frameApply} \title{Subset analysis on data frames} \description{Apply a function to row subsets of a data frame.} \usage{ frameApply(x, by=NULL, on=by[1], fun=function(xi) c(Count=nrow(xi)), subset=TRUE, simplify=TRUE, byvar.sep="\\\\$\\\\@\\\\$", \dots) } \arguments{ \item{x}{a data frame} \item{by}{names of columns in \code{x} specifying the variables to use to form the subgroups. None of the \code{by} variables should have the name "sep" (you will get an error if one of them does; a bit of laziness in the code). Unused levels of the \code{by} variables will be dropped. Use \code{by = NULL} (the default) to indicate that all of the data is to be treated as a single (trivial) subgroup.} \item{on}{names of columns in \code{x} specifying columns over which \code{fun} is to be applied. These can include columns specified in \code{by}, (as with the default) although that is not usually the case.} \item{fun}{a function that can operate on data frames that are row subsets of \code{x[on]}. If \code{simplify = TRUE}, the return value of the function should always be either a try-error (see \code{\link{try}}), or a vector of fixed length (i.e. same length for every subset), preferably with named elements.} \item{subset}{logical vector (can be specified in terms of variables in data). This row subset of \code{x} is taken before doing anything else.} \item{simplify}{logical. If TRUE (the default), return value will be a data frame including the \code{by} columns and a column for each element of the return vector of \code{fun}. If FALSE, the return value will be a list, sometimes necessary for less structured output (see description of return value below).} \item{byvar.sep}{character. This can be any character string not found anywhere in the values of the \code{by} variables. The \code{by} variables will be pasted together using this as the separator, and the result will be used as the index to form the subgroups.} \item{\dots}{additional arguments to \code{fun}.} } \value{ A data frame if \code{simplify = TRUE} (the default), assuming there is sufficiently structured output from \code{fun}. If \code{simplify = FALSE} and \code{by} is not NULL, the return value will be a list with two elements. The first element, named "by", will be a data frame with the unique rows of \code{x[by]}, and the second element, named "result" will be a list where the ith component gives the result for the ith row of the "by" element. } \details{ This function accomplishes something similar to \code{\link{by}}. The main difference is that \code{frameApply} is designed to return data frames and lists instead of objects of class 'by'. Also, \code{frameApply} works only on the unique combinations of the \code{by} that are actually present in the data, not on the entire cartesian product of the \code{by} variables. In some cases this results in great gains in efficiency, although \code{frameApply} is hardly an efficient function. } \examples{ data(ELISA, package="gtools") # Default is slightly unintuitive, but commonly useful: frameApply(ELISA, by = c("PlateDay", "Read")) # Wouldn't actually recommend this model! Just a demo: frameApply(ELISA, on = c("Signal", "Concentration"), by = c("PlateDay", "Read"), fun = function(dat) coef(lm(Signal ~ Concentration, data = dat))) frameApply(ELISA, on = "Signal", by = "Concentration", fun = function(dat) { x <- dat[[1]] out <- c(Mean = mean(x, na.rm=TRUE), SD = sd(x, na.rm=TRUE), N = sum(x, na.rm=TRUE))}, subset = !is.na(Concentration)) } \author{Jim Rogers \email{james.a.rogers@pfizer.com}} \keyword{manip} gdata/man/getDateTimePart.Rd0000644000176200001440000000267014440625622015431 0ustar liggesusers\name{getYear} \alias{getDateTimeParts} \alias{getYear} \alias{getYear.default} \alias{getYear.Date} \alias{getYear.POSIXct} \alias{getYear.POSIXlt} \alias{getMonth} \alias{getMonth.default} \alias{getMonth.Date} \alias{getMonth.POSIXct} \alias{getMonth.POSIXlt} \alias{getDay} \alias{getDay.default} \alias{getDay.Date} \alias{getDay.POSIXct} \alias{getDay.POSIXlt} \alias{getHour} \alias{getHour.default} \alias{getMin} \alias{getMin.default} \alias{getSec} \alias{getSec.default} \title{Get date/time parts from date and time objects} \description{ Experimental approach for extracting the date/time parts from objects of a date/time class. They are designed to be intiutive and thus lowering the learning curve for work with date and time classes in \R{}.} \usage{ getYear(x, format, \dots) getMonth(x, format, \dots) getDay(x, format, \dots) getHour(x, format, \dots) getMin(x, format, \dots) getSec(x, format, \dots) } \arguments{ \item{x}{generic, date/time object} \item{format}{character, format} \item{\dots}{arguments pased to other methods} } \value{Character} \author{Gregor Gorjanc} \seealso{ \code{\link{Date}}, \code{\link{DateTimeClasses}}, \code{\link{strptime}} } \examples{ ## Date tmp <- Sys.Date() tmp getYear(tmp) getMonth(tmp) getDay(tmp) ## POSIXct tmp <- as.POSIXct(tmp) getYear(tmp) getMonth(tmp) getDay(tmp) ## POSIXlt tmp <- as.POSIXlt(tmp) getYear(tmp) getMonth(tmp) getDay(tmp) } \keyword{manip} \keyword{misc} gdata/man/nPairs.Rd0000644000176200001440000000307214440625622013637 0ustar liggesusers\name{nPairs} \alias{nPairs} \concept{pairs} \title{Number of variable pairs} \description{ Count the number of pairs between variables. } \usage{ nPairs(x, margin=FALSE, names=TRUE, abbrev=TRUE, \dots) } \arguments{ \item{x}{data.frame or a matrix} \item{margin}{logical, calculate the cumulative number of \dQuote{pairs}} \item{names}{logical, add row/col-names to the output} \item{abbrev}{logical, abbreviate names} \item{\dots}{other arguments passed to \code{\link{abbreviate}}} } \details{ The class of returned matrix is nPairs and matrix. There is a summary method, which shows the opposite information - counts how many times each variable is known, while the other variable of a pair is not. See examples. } \value{ Matrix of order \eqn{k}, where \eqn{k} is the number of columns in \code{x}. Values in a matrix represent the number of pairs between columns/variables in \code{x}. If \code{margin=TRUE}, the number of columns is \eqn{k+1} and the last column represents the cumulative number of pairing all variables. } \author{Gregor Gorjanc} \seealso{\code{\link{abbreviate}}} \examples{ # Test data test <- data.frame(V1=c(1, 2, 3, 4, 5), V2=c(NA, 2, 3, 4, 5), V3=c(1, NA, NA, NA, NA), V4=c(1, 2, 3, NA, NA)) # Number of variable pairs nPairs(x=test) # Without names nPairs(x=test, names=FALSE) # Longer names colnames(test) <- c("Variable1", "Variable2", "Variable3", "Variable4") nPairs(x=test) # Margin nPairs(x=test, margin=TRUE) # Summary summary(object=nPairs(x=test)) } \keyword{misc} gdata/man/mv.Rd0000644000176200001440000000131414440625622013022 0ustar liggesusers\name{mv} \alias{mv} \title{ Rename an Object } \description{ Rename an object. } \usage{ mv(from, to, envir = parent.frame()) } \arguments{ \item{from}{Character scalar giving the source object name} \item{to}{Character scalar giving the desination object name} \item{envir}{Environment in which to do the rename} } \details{ This function renames an object by the value of object \code{a} to the name \code{b}, and removing \code{a}. } \value{ Invisibly returns the value of the object. } \author{ Gregory R. Warnes \email{greg@warnes.net} } \seealso{ \code{\link[base]{rm}}, \code{\link[base]{assign}} } \examples{ a <- 1:10 a mv("a", "b") b exists("a") } \keyword{environment} \keyword{data} gdata/man/centerText.Rd0000644000176200001440000000211414440625622014524 0ustar liggesusers\name{centerText} \alias{centerText} \title{ Center Text Strings } \description{ Function to center text strings for display on the text console by prepending the necessary number of spaces to each element. } \usage{ centerText(x, width = getOption("width")) } \arguments{ \item{x}{Character vector containing text strings to be centered.} \item{width}{Desired display width. Defaults to the R display width given by \code{getOption("width")}.} } \details{ Each element will be centered individually by prepending the necessary number of spaces to center the text in the specified display width assuming a fixed width font. } \value{ Vector of character strings. } \author{ Gregory R. Warnes \email{greg@warnes.net} } \seealso{ \code{\link[base]{strwrap}} } \examples{ cat(centerText("One Line Test"), "\n\n") mText <-c("This", "is an example", " of a multiline text ", "with ", " leading", " and trailing ", "spaces.") cat("\n", centerText(mText), "\n", sep="\n") } \keyword{manip} \keyword{character} gdata/DESCRIPTION0000644000176200001440000000402114513307506013041 0ustar liggesusersPackage: gdata Version: 3.0.0 Date: 2023-10-09 Title: Various R Programming Tools for Data Manipulation Authors@R: c(person(c("Gregory", "R."), "Warnes", role="aut", email="greg@warnes.net"), person("Gregor", "Gorjanc", role="aut"), person("Arni", "Magnusson", role=c("aut","cre"), email="thisisarni@gmail.com"), person("Liviu", "Andronic", role="aut"), person("Jim", "Rogers", role="aut"), person("Don", "MacQueen", role="aut"), person("Ales", "Korosec", role="aut"), person("Ben", "Bolker", role="ctb"), person("Michael", "Chirico", role="ctb"), person("Gabor", "Grothendieck", role="ctb"), person("Thomas", "Lumley", role="ctb"), person("Brian", "Ripley", role="ctb"), person("inoui llc", role="fnd")) Imports: gtools, methods, stats, utils Suggests: RUnit Description: Various R programming tools for data manipulation, including medical unit conversions, combining objects, character vector operations, factor manipulation, obtaining information about R objects, generating fixed-width format files, extracting components of date & time objects, operations on columns of data frames, matrix operations, operations on vectors, operations on data frames, value of last evaluated expression, and a resample() wrapper for sample() that ensures consistent behavior for both scalar and vector arguments. License: GPL-2 URL: https://github.com/r-gregmisc/gdata BugReports: https://github.com/r-gregmisc/gdata/issues NeedsCompilation: no Packaged: 2023-10-09 15:07:28 UTC; arnim Author: Gregory R. Warnes [aut], Gregor Gorjanc [aut], Arni Magnusson [aut, cre], Liviu Andronic [aut], Jim Rogers [aut], Don MacQueen [aut], Ales Korosec [aut], Ben Bolker [ctb], Michael Chirico [ctb], Gabor Grothendieck [ctb], Thomas Lumley [ctb], Brian Ripley [ctb], inoui llc [fnd] Maintainer: Arni Magnusson Repository: CRAN Date/Publication: 2023-10-16 19:30:14 UTC gdata/build/0000755000176200001440000000000014511013460012424 5ustar liggesusersgdata/build/vignette.rds0000644000176200001440000000041514511013460014763 0ustar liggesusersuOj0Tjשڋ_ri %˭, ɩ-_wmK6䠕f|/!w$qF8<ORW%WDŽvyryGl DUAp/e~t?O'fo뼘7X,면_v2|IW Q$'Xrk79@J(҉'-,A,ԛof2k>S8(5e!lմ: ȡ0GtH}O8gdata/tests/0000755000176200001440000000000014510771613012501 5ustar liggesusersgdata/tests/tests.write.fwf.Rout.save0000644000176200001440000002604514441446535017401 0ustar liggesusers R version 4.3.0 (2023-04-21) -- "Already Tomorrow" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(gdata) Attaching package: 'gdata' The following object is masked from 'package:stats': nobs The following object is masked from 'package:utils': object.size The following object is masked from 'package:base': startsWith > > ## Test data > > num <- round(c(733070.345678, 1214213.78765456, 553823.798765678, + 1085022.8876545678, 571063.88765456, 606718.3876545678, + 1053686.6, 971024.187656, 631193.398765456, 879431.1), digits=3) > > testData <- data.frame(num1=c(1:10, NA), + num2=c(NA, seq(from=1, to=5.5, by=0.5)), + num3=c(NA, num), + int1=c(as.integer(1:4), NA, as.integer(4:9)), + fac1=factor(c(NA, letters[1:9], "hjh")), + fac2=factor(c(letters[6:15], NA)), + cha1=c(letters[17:26], NA), + cha2=c(NA, "longer", letters[25:17]), + stringsAsFactors=FALSE) > levels(testData$fac1) <- c(levels(testData$fac1), "unusedLevel") > testData$Date <- as.Date("1900-1-1") > testData$Date[2] <- NA > testData$POSIXt <- as.POSIXct(strptime("1900-1-1 01:01:01", + format="%Y-%m-%d %H:%M:%S")) > testData$POSIXt[5] <- NA > > ## Tests > > ## Default > write.fwf(testData) num1 num2 num3 int1 fac1 fac2 cha1 cha2 Date POSIXt 1 1 f q 1900-01-01 1900-01-01 01:01:01 2 1.0 733070.3 2 a g r longer 1900-01-01 01:01:01 3 1.5 1214213.8 3 b h s y 1900-01-01 1900-01-01 01:01:01 4 2.0 553823.8 4 c i t x 1900-01-01 1900-01-01 01:01:01 5 2.5 1085022.9 d j u w 1900-01-01 6 3.0 571063.9 4 e k v v 1900-01-01 1900-01-01 01:01:01 7 3.5 606718.4 5 f l w u 1900-01-01 1900-01-01 01:01:01 8 4.0 1053686.6 6 g m x t 1900-01-01 1900-01-01 01:01:01 9 4.5 971024.2 7 h n y s 1900-01-01 1900-01-01 01:01:01 10 5.0 631193.4 8 i o z r 1900-01-01 1900-01-01 01:01:01 5.5 879431.1 9 hjh q 1900-01-01 1900-01-01 01:01:01 > > ## NA should be - > write.fwf(x=testData, na="-") num1 num2 num3 int1 fac1 fac2 cha1 cha2 Date POSIXt 1 - - 1 - f q - 1900-01-01 1900-01-01 01:01:01 2 1.0 733070.3 2 a g r longer - 1900-01-01 01:01:01 3 1.5 1214213.8 3 b h s y 1900-01-01 1900-01-01 01:01:01 4 2.0 553823.8 4 c i t x 1900-01-01 1900-01-01 01:01:01 5 2.5 1085022.9 - d j u w 1900-01-01 - 6 3.0 571063.9 4 e k v v 1900-01-01 1900-01-01 01:01:01 7 3.5 606718.4 5 f l w u 1900-01-01 1900-01-01 01:01:01 8 4.0 1053686.6 6 g m x t 1900-01-01 1900-01-01 01:01:01 9 4.5 971024.2 7 h n y s 1900-01-01 1900-01-01 01:01:01 10 5.0 631193.4 8 i o z r 1900-01-01 1900-01-01 01:01:01 - 5.5 879431.1 9 hjh - - q 1900-01-01 1900-01-01 01:01:01 > ## NA should be -NA- > write.fwf(x=testData, na="-NA-") num1 num2 num3 int1 fac1 fac2 cha1 cha2 Date POSIXt 1 -NA- -NA- 1 -NA- f q -NA- 1900-01-01 1900-01-01 01:01:01 2 1.0 733070.3 2 a g r longer -NA- 1900-01-01 01:01:01 3 1.5 1214213.8 3 b h s y 1900-01-01 1900-01-01 01:01:01 4 2.0 553823.8 4 c i t x 1900-01-01 1900-01-01 01:01:01 5 2.5 1085022.9 -NA- d j u w 1900-01-01 -NA- 6 3.0 571063.9 4 e k v v 1900-01-01 1900-01-01 01:01:01 7 3.5 606718.4 5 f l w u 1900-01-01 1900-01-01 01:01:01 8 4.0 1053686.6 6 g m x t 1900-01-01 1900-01-01 01:01:01 9 4.5 971024.2 7 h n y s 1900-01-01 1900-01-01 01:01:01 10 5.0 631193.4 8 i o z r 1900-01-01 1900-01-01 01:01:01 -NA- 5.5 879431.1 9 hjh -NA- -NA- q 1900-01-01 1900-01-01 01:01:01 > > ## Some other separator than space > write.fwf(testData[, 1:4], sep="-mySep-") num1-mySep-num2-mySep-num3-mySep-int1 1-mySep- -mySep- -mySep-1 2-mySep-1.0-mySep- 733070.3-mySep-2 3-mySep-1.5-mySep-1214213.8-mySep-3 4-mySep-2.0-mySep- 553823.8-mySep-4 5-mySep-2.5-mySep-1085022.9-mySep- 6-mySep-3.0-mySep- 571063.9-mySep-4 7-mySep-3.5-mySep- 606718.4-mySep-5 8-mySep-4.0-mySep-1053686.6-mySep-6 9-mySep-4.5-mySep- 971024.2-mySep-7 10-mySep-5.0-mySep- 631193.4-mySep-8 -mySep-5.5-mySep- 879431.1-mySep-9 > > ## Justify right for character columns > write.fwf(testData, justify="right") num1 num2 num3 int1 fac1 fac2 cha1 cha2 Date POSIXt 1 1 f q 1900-01-01 1900-01-01 01:01:01 2 1.0 733070.3 2 a g r longer 1900-01-01 01:01:01 3 1.5 1214213.8 3 b h s y 1900-01-01 1900-01-01 01:01:01 4 2.0 553823.8 4 c i t x 1900-01-01 1900-01-01 01:01:01 5 2.5 1085022.9 d j u w 1900-01-01 6 3.0 571063.9 4 e k v v 1900-01-01 1900-01-01 01:01:01 7 3.5 606718.4 5 f l w u 1900-01-01 1900-01-01 01:01:01 8 4.0 1053686.6 6 g m x t 1900-01-01 1900-01-01 01:01:01 9 4.5 971024.2 7 h n y s 1900-01-01 1900-01-01 01:01:01 10 5.0 631193.4 8 i o z r 1900-01-01 1900-01-01 01:01:01 5.5 879431.1 9 hjh q 1900-01-01 1900-01-01 01:01:01 > > ## Justify right for character columns, track na values > write.fwf(testData, justify="right", na="!") num1 num2 num3 int1 fac1 fac2 cha1 cha2 Date POSIXt 1 ! ! 1 ! f q ! 1900-01-01 1900-01-01 01:01:01 2 1.0 733070.3 2 a g r longer ! 1900-01-01 01:01:01 3 1.5 1214213.8 3 b h s y 1900-01-01 1900-01-01 01:01:01 4 2.0 553823.8 4 c i t x 1900-01-01 1900-01-01 01:01:01 5 2.5 1085022.9 ! d j u w 1900-01-01 ! 6 3.0 571063.9 4 e k v v 1900-01-01 1900-01-01 01:01:01 7 3.5 606718.4 5 f l w u 1900-01-01 1900-01-01 01:01:01 8 4.0 1053686.6 6 g m x t 1900-01-01 1900-01-01 01:01:01 9 4.5 971024.2 7 h n y s 1900-01-01 1900-01-01 01:01:01 10 5.0 631193.4 8 i o z r 1900-01-01 1900-01-01 01:01:01 ! 5.5 879431.1 9 hjh ! ! q 1900-01-01 1900-01-01 01:01:01 > > ## With quotes > write.fwf(testData, quote=TRUE) "num1" "num2" "num3" "int1" "fac1" "fac2" "cha1" "cha2" "Date" "POSIXt" " 1" " " " " "1" " " "f" "q" " " "1900-01-01" "1900-01-01 01:01:01" " 2" "1.0" " 733070.3" "2" "a " "g" "r" "longer" " " "1900-01-01 01:01:01" " 3" "1.5" "1214213.8" "3" "b " "h" "s" "y " "1900-01-01" "1900-01-01 01:01:01" " 4" "2.0" " 553823.8" "4" "c " "i" "t" "x " "1900-01-01" "1900-01-01 01:01:01" " 5" "2.5" "1085022.9" " " "d " "j" "u" "w " "1900-01-01" " " " 6" "3.0" " 571063.9" "4" "e " "k" "v" "v " "1900-01-01" "1900-01-01 01:01:01" " 7" "3.5" " 606718.4" "5" "f " "l" "w" "u " "1900-01-01" "1900-01-01 01:01:01" " 8" "4.0" "1053686.6" "6" "g " "m" "x" "t " "1900-01-01" "1900-01-01 01:01:01" " 9" "4.5" " 971024.2" "7" "h " "n" "y" "s " "1900-01-01" "1900-01-01 01:01:01" "10" "5.0" " 631193.4" "8" "i " "o" "z" "r " "1900-01-01" "1900-01-01 01:01:01" " " "5.5" " 879431.1" "9" "hjh" " " " " "q " "1900-01-01" "1900-01-01 01:01:01" > > ## With rownames > write.fwf(testData, rownames=TRUE) num1 num2 num3 int1 fac1 fac2 cha1 cha2 Date POSIXt 1 1 1 f q 1900-01-01 1900-01-01 01:01:01 2 2 1.0 733070.3 2 a g r longer 1900-01-01 01:01:01 3 3 1.5 1214213.8 3 b h s y 1900-01-01 1900-01-01 01:01:01 4 4 2.0 553823.8 4 c i t x 1900-01-01 1900-01-01 01:01:01 5 5 2.5 1085022.9 d j u w 1900-01-01 6 6 3.0 571063.9 4 e k v v 1900-01-01 1900-01-01 01:01:01 7 7 3.5 606718.4 5 f l w u 1900-01-01 1900-01-01 01:01:01 8 8 4.0 1053686.6 6 g m x t 1900-01-01 1900-01-01 01:01:01 9 9 4.5 971024.2 7 h n y s 1900-01-01 1900-01-01 01:01:01 10 10 5.0 631193.4 8 i o z r 1900-01-01 1900-01-01 01:01:01 11 5.5 879431.1 9 hjh q 1900-01-01 1900-01-01 01:01:01 > > ## Without colnames > write.fwf(testData, colnames=FALSE) 1 1 f q 1900-01-01 1900-01-01 01:01:01 2 1.0 733070.3 2 a g r longer 1900-01-01 01:01:01 3 1.5 1214213.8 3 b h s y 1900-01-01 1900-01-01 01:01:01 4 2.0 553823.8 4 c i t x 1900-01-01 1900-01-01 01:01:01 5 2.5 1085022.9 d j u w 1900-01-01 6 3.0 571063.9 4 e k v v 1900-01-01 1900-01-01 01:01:01 7 3.5 606718.4 5 f l w u 1900-01-01 1900-01-01 01:01:01 8 4.0 1053686.6 6 g m x t 1900-01-01 1900-01-01 01:01:01 9 4.5 971024.2 7 h n y s 1900-01-01 1900-01-01 01:01:01 10 5.0 631193.4 8 i o z r 1900-01-01 1900-01-01 01:01:01 5.5 879431.1 9 hjh q 1900-01-01 1900-01-01 01:01:01 > > ## Without colnames, with rownames > write.fwf(testData, colnames=FALSE, rownames=TRUE) 1 1 1 f q 1900-01-01 1900-01-01 01:01:01 2 2 1.0 733070.3 2 a g r longer 1900-01-01 01:01:01 3 3 1.5 1214213.8 3 b h s y 1900-01-01 1900-01-01 01:01:01 4 4 2.0 553823.8 4 c i t x 1900-01-01 1900-01-01 01:01:01 5 5 2.5 1085022.9 d j u w 1900-01-01 6 6 3.0 571063.9 4 e k v v 1900-01-01 1900-01-01 01:01:01 7 7 3.5 606718.4 5 f l w u 1900-01-01 1900-01-01 01:01:01 8 8 4.0 1053686.6 6 g m x t 1900-01-01 1900-01-01 01:01:01 9 9 4.5 971024.2 7 h n y s 1900-01-01 1900-01-01 01:01:01 10 10 5.0 631193.4 8 i o z r 1900-01-01 1900-01-01 01:01:01 11 5.5 879431.1 9 hjh q 1900-01-01 1900-01-01 01:01:01 > > ## With rownames and colnames and rowCol > write.fwf(testData, rownames=TRUE, rowCol="HI!") HI! num1 num2 num3 int1 fac1 fac2 cha1 cha2 Date POSIXt 1 1 1 f q 1900-01-01 1900-01-01 01:01:01 2 2 1.0 733070.3 2 a g r longer 1900-01-01 01:01:01 3 3 1.5 1214213.8 3 b h s y 1900-01-01 1900-01-01 01:01:01 4 4 2.0 553823.8 4 c i t x 1900-01-01 1900-01-01 01:01:01 5 5 2.5 1085022.9 d j u w 1900-01-01 6 6 3.0 571063.9 4 e k v v 1900-01-01 1900-01-01 01:01:01 7 7 3.5 606718.4 5 f l w u 1900-01-01 1900-01-01 01:01:01 8 8 4.0 1053686.6 6 g m x t 1900-01-01 1900-01-01 01:01:01 9 9 4.5 971024.2 7 h n y s 1900-01-01 1900-01-01 01:01:01 10 10 5.0 631193.4 8 i o z r 1900-01-01 1900-01-01 01:01:01 11 5.5 879431.1 9 hjh q 1900-01-01 1900-01-01 01:01:01 > > proc.time() user system elapsed 0.104 0.020 0.119 gdata/tests/test.reorder.factor.R0000644000176200001440000000030014441446535016517 0ustar liggesusers## Test results before and after loading gdata m <- factor(c("a", "b", "c")) (m1 <- reorder(m, X=c(3, 2, 1))) library(gdata) (m2 <- reorder(m, X=c(3, 2, 1))) stopifnot(identical(m1, m2)) gdata/tests/test.write.fwf.eol.R0000644000176200001440000000025214441446535016277 0ustar liggesuserslibrary(gdata) saveto <- tempfile(pattern = "test.txt", tmpdir = tempdir()) write.fwf(x = data.frame(a=1:length(LETTERS), b=LETTERS), file=saveto, eol="\r\n") gdata/tests/test.write.fwf.eol.Rout.save0000644000176200001440000000212714441446535017767 0ustar liggesusers R version 4.3.0 (2023-04-21) -- "Already Tomorrow" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(gdata) Attaching package: 'gdata' The following object is masked from 'package:stats': nobs The following object is masked from 'package:utils': object.size The following object is masked from 'package:base': startsWith > saveto <- tempfile(pattern = "test.txt", tmpdir = tempdir()) > > write.fwf(x = data.frame(a=1:length(LETTERS), b=LETTERS), + file=saveto, eol="\r\n") > > proc.time() user system elapsed 0.088 0.008 0.093 gdata/tests/test.humanReadable.Rout.save0000644000176200001440000002770414510771613020031 0ustar liggesusers R version 4.3.0 (2023-04-21) -- "Already Tomorrow" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(gdata) Attaching package: 'gdata' The following object is masked from 'package:stats': nobs The following object is masked from 'package:utils': object.size The following object is masked from 'package:base': startsWith > > options(humanReadable=FALSE) > > set.seed(123456) > > baseSI <- 10 > powerSI <- seq(from=0, to=27, by=3) > SI0 <- (baseSI)^powerSI > k <- length(SI0) - 1 > SI1 <- SI0 - SI0 / c(2, runif(n=k, min=1.01, max=5.99)) > SI2 <- SI0 + SI0 / c(2, runif(n=k, min=1.01, max=5.99)) > > baseIEC <- 2 > powerIEC <- seq(from=0, to=90, by=10) > IEC0 <- (baseIEC)^powerIEC > IEC1 <- IEC0 - IEC0 / c(2, runif(n=k, min=1.01, max=5.99)) > IEC2 <- IEC0 + IEC0 / c(2, runif(n=k, min=1.01, max=5.99)) > > # Auto units, specify width > cbind(humanReadable(x=SI2, standard="SI", width=7), + humanReadable(x=SI2, standard="SI", width=5), + humanReadable(x=SI2, standard="SI", width=3), + humanReadable(x=IEC2, standard="IEC", width=7), + humanReadable(x=IEC2, standard="IEC", width=5), + humanReadable(x=IEC2, standard="IEC", width=3), + humanReadable(x=IEC2, standard="Unix", width=7), + humanReadable(x=IEC2, standard="Unix", width=5), + humanReadable(x=IEC2, standard="Unix", width=3)) [,1] [,2] [,3] [,4] [,5] [,6] [1,] " 2 B " " 2 B " " 2 B " " 2 B " " 2 B " " 2 B " [2,] "1.54215 kB" "1.542 kB" " 1.5 kB" "1.18582 KiB" "1.186 KiB" " 1.2 KiB" [3,] "1.20064 MB" "1.201 MB" " 1.2 MB" "1.19003 MiB" " 1.19 MiB" " 1.2 MiB" [4,] "1.25207 GB" "1.252 GB" " 1.3 GB" "1.54448 GiB" "1.544 GiB" " 1.5 GiB" [5,] "1.18121 TB" "1.181 TB" " 1.2 TB" "1.27667 TiB" "1.277 TiB" " 1.3 TiB" [6,] " 1.1853 PB" "1.185 PB" " 1.2 PB" "1.18733 PiB" "1.187 PiB" " 1.2 PiB" [7,] " 1.1678 EB" "1.168 EB" " 1.2 EB" "1.46271 EiB" "1.463 EiB" " 1.5 EiB" [8,] "1.18275 ZB" "1.183 ZB" " 1.2 ZB" "1.62382 ZiB" "1.624 ZiB" " 1.6 ZiB" [9,] "1.18568 YB" "1.186 YB" " 1.2 YB" "1.19557 YiB" "1.196 YiB" " 1.2 YiB" [10,] "1501.49 YB" " 1501 YB" "1501 YB" "1750.35 YiB" " 1750 YiB" "1750 YiB" [,7] [,8] [,9] [1,] " 2 B" " 2 B" " 2 B" [2,] "1.18582 K" "1.186 K" " 1.2 K" [3,] "1.19003 M" " 1.19 M" " 1.2 M" [4,] "1.54448 G" "1.544 G" " 1.5 G" [5,] "1.27667 T" "1.277 T" " 1.3 T" [6,] "1.18733 P" "1.187 P" " 1.2 P" [7,] "1.46271 E" "1.463 E" " 1.5 E" [8,] "1.62382 Z" "1.624 Z" " 1.6 Z" [9,] "1.19557 Y" "1.196 Y" " 1.2 Y" [10,] "1750.35 Y" " 1750 Y" "1750 Y" > > # Auto units, specify digits > cbind(humanReadable(x=SI2, standard="SI", width=NULL, digits=7), + humanReadable(x=SI2, standard="SI", width=NULL, digits=3), + humanReadable(x=SI2, standard="SI", width=NULL, digits=2), + humanReadable(x=SI2, standard="SI", width=NULL, digits=1), + humanReadable(x=IEC2, standard="IEC", width=NULL, digits=7), + humanReadable(x=IEC2, standard="IEC", width=NULL, digits=3), + humanReadable(x=IEC2, standard="IEC", width=NULL, digits=2), + humanReadable(x=IEC2, standard="IEC", width=NULL, digits=1), + humanReadable(x=IEC2, standard="Unix", width=NULL, digits=7), + humanReadable(x=IEC2, standard="Unix", width=NULL, digits=3), + humanReadable(x=IEC2, standard="Unix", width=NULL, digits=2), + humanReadable(x=IEC2, standard="Unix", width=NULL, digits=1)) [,1] [,2] [,3] [,4] [1,] " 1.5000000 B " " 1.500 B " " 1.50 B " " 1.5 B " [2,] " 1.5421535 kB" " 1.542 kB" " 1.54 kB" " 1.5 kB" [3,] " 1.2006426 MB" " 1.201 MB" " 1.20 MB" " 1.2 MB" [4,] " 1.2520737 GB" " 1.252 GB" " 1.25 GB" " 1.3 GB" [5,] " 1.1812105 TB" " 1.181 TB" " 1.18 TB" " 1.2 TB" [6,] " 1.1853010 PB" " 1.185 PB" " 1.19 PB" " 1.2 PB" [7,] " 1.1678048 EB" " 1.168 EB" " 1.17 EB" " 1.2 EB" [8,] " 1.1827531 ZB" " 1.183 ZB" " 1.18 ZB" " 1.2 ZB" [9,] " 1.1856788 YB" " 1.186 YB" " 1.19 YB" " 1.2 YB" [10,] "1501.4852409 YB" "1501.485 YB" "1501.49 YB" "1501.5 YB" [,5] [,6] [,7] [,8] [1,] " 1.5000000 B " " 1.500 B " " 1.50 B " " 1.5 B " [2,] " 1.1858248 KiB" " 1.186 KiB" " 1.19 KiB" " 1.2 KiB" [3,] " 1.1900302 MiB" " 1.190 MiB" " 1.19 MiB" " 1.2 MiB" [4,] " 1.5444791 GiB" " 1.544 GiB" " 1.54 GiB" " 1.5 GiB" [5,] " 1.2766723 TiB" " 1.277 TiB" " 1.28 TiB" " 1.3 TiB" [6,] " 1.1873270 PiB" " 1.187 PiB" " 1.19 PiB" " 1.2 PiB" [7,] " 1.4627144 EiB" " 1.463 EiB" " 1.46 EiB" " 1.5 EiB" [8,] " 1.6238214 ZiB" " 1.624 ZiB" " 1.62 ZiB" " 1.6 ZiB" [9,] " 1.1955693 YiB" " 1.196 YiB" " 1.20 YiB" " 1.2 YiB" [10,] "1750.3547972 YiB" "1750.355 YiB" "1750.35 YiB" "1750.4 YiB" [,9] [,10] [,11] [,12] [1,] " 1.5000000 B" " 1.500 B" " 1.50 B" " 1.5 B" [2,] " 1.1858248 K" " 1.186 K" " 1.19 K" " 1.2 K" [3,] " 1.1900302 M" " 1.190 M" " 1.19 M" " 1.2 M" [4,] " 1.5444791 G" " 1.544 G" " 1.54 G" " 1.5 G" [5,] " 1.2766723 T" " 1.277 T" " 1.28 T" " 1.3 T" [6,] " 1.1873270 P" " 1.187 P" " 1.19 P" " 1.2 P" [7,] " 1.4627144 E" " 1.463 E" " 1.46 E" " 1.5 E" [8,] " 1.6238214 Z" " 1.624 Z" " 1.62 Z" " 1.6 Z" [9,] " 1.1955693 Y" " 1.196 Y" " 1.20 Y" " 1.2 Y" [10,] "1750.3547972 Y" "1750.355 Y" "1750.35 Y" "1750.4 Y" > > # Single unit, specify width > cbind(humanReadable(x=SI1, units="GB", standard="SI", width=7), + humanReadable(x=SI1, units="GB", standard="SI", width=5), + humanReadable(x=SI1, units="GB", standard="SI", width=3), + humanReadable(x=IEC1, units="GiB", standard="IEC", width=7), + humanReadable(x=IEC1, units="GiB", standard="IEC", width=5), + humanReadable(x=IEC1, units="GiB", standard="IEC", width=3), + humanReadable(x=IEC1, units="G", standard="Unix", width=7), + humanReadable(x=IEC1, units="G", standard="Unix", width=5), + humanReadable(x=IEC1, units="G", standard="Unix", width=3)) [,1] [,2] [,3] [,4] [,5] [,6] [1,] "5e-10 GB" "5e-10 GB" "5e-10 GB" "5e-10 GiB" "5e-10 GiB" "5e-10 GiB" [2,] "8e-07 GB" "8e-07 GB" "8e-07 GB" "6e-07 GiB" "6e-07 GiB" "6e-07 GiB" [3,] "8e-04 GB" "8e-04 GB" "8e-04 GB" "8e-04 GiB" "8e-04 GiB" "8e-04 GiB" [4,] "7e-01 GB" "7e-01 GB" "7e-01 GB" "4e-01 GiB" "4e-01 GiB" "4e-01 GiB" [5,] "6e+02 GB" "6e+02 GB" "6e+02 GB" "3e+02 GiB" "3e+02 GiB" "3e+02 GiB" [6,] "6e+05 GB" "6e+05 GB" "6e+05 GB" "4e+05 GiB" "4e+05 GiB" "4e+05 GiB" [7,] "5e+08 GB" "5e+08 GB" "5e+08 GB" "5e+08 GiB" "5e+08 GiB" "5e+08 GiB" [8,] "7e+11 GB" "7e+11 GB" "7e+11 GB" "8e+11 GiB" "8e+11 GiB" "8e+11 GiB" [9,] "3e+14 GB" "3e+14 GB" "3e+14 GB" "9e+14 GiB" "9e+14 GiB" "9e+14 GiB" [10,] "8e+17 GB" "8e+17 GB" "8e+17 GB" "9e+17 GiB" "9e+17 GiB" "9e+17 GiB" [,7] [,8] [,9] [1,] "5e-10 G" "5e-10 G" "5e-10 G" [2,] "6e-07 G" "6e-07 G" "6e-07 G" [3,] "8e-04 G" "8e-04 G" "8e-04 G" [4,] "4e-01 G" "4e-01 G" "4e-01 G" [5,] "3e+02 G" "3e+02 G" "3e+02 G" [6,] "4e+05 G" "4e+05 G" "4e+05 G" [7,] "5e+08 G" "5e+08 G" "5e+08 G" [8,] "8e+11 G" "8e+11 G" "8e+11 G" [9,] "9e+14 G" "9e+14 G" "9e+14 G" [10,] "9e+17 G" "9e+17 G" "9e+17 G" > > # Single unit, specify digits > cbind(humanReadable(x=SI1, units="GB", standard="SI", width=NULL, digits=7), + humanReadable(x=SI1, units="GB", standard="SI", width=NULL, digits=3), + humanReadable(x=SI1, units="GB", standard="SI", width=NULL, digits=2), + humanReadable(x=SI1, units="GB", standard="SI", width=NULL, digits=1), + humanReadable(x=IEC1, units="GiB", standard="IEC", width=NULL, digits=7), + humanReadable(x=IEC1, units="GiB", standard="IEC", width=NULL, digits=3), + humanReadable(x=IEC1, units="GiB", standard="IEC", width=NULL, digits=2), + humanReadable(x=IEC1, units="GiB", standard="IEC", width=NULL, digits=1), + humanReadable(x=IEC1, units="G", standard="Unix", width=NULL, digits=7), + humanReadable(x=IEC1, units="G", standard="Unix", width=NULL, digits=3), + humanReadable(x=IEC1, units="G", standard="Unix", width=NULL, digits=2), + humanReadable(x=IEC1, units="G", standard="Unix", width=NULL, digits=1)) [,1] [,2] [,3] [,4] [1,] "5.000000e-10 GB" "5.00e-10 GB" "5.0e-10 GB" "5e-10 GB" [2,] "7.993163e-07 GB" "7.99e-07 GB" "8.0e-07 GB" "8e-07 GB" [3,] "7.900375e-04 GB" "7.90e-04 GB" "7.9e-04 GB" "8e-04 GB" [4,] "6.619855e-01 GB" "6.62e-01 GB" "6.6e-01 GB" "7e-01 GB" [5,] "6.311259e+02 GB" "6.31e+02 GB" "6.3e+02 GB" "6e+02 GB" [6,] "6.440324e+05 GB" "6.44e+05 GB" "6.4e+05 GB" "6e+05 GB" [7,] "4.994386e+08 GB" "4.99e+08 GB" "5.0e+08 GB" "5e+08 GB" [8,] "7.277869e+11 GB" "7.28e+11 GB" "7.3e+11 GB" "7e+11 GB" [9,] "3.291745e+14 GB" "3.29e+14 GB" "3.3e+14 GB" "3e+14 GB" [10,] "8.313511e+17 GB" "8.31e+17 GB" "8.3e+17 GB" "8e+17 GB" [,5] [,6] [,7] [,8] [1,] "4.656613e-10 GiB" "4.66e-10 GiB" "4.7e-10 GiB" "5e-10 GiB" [2,] "5.975956e-07 GiB" "5.98e-07 GiB" "6.0e-07 GiB" "6e-07 GiB" [3,] "7.764672e-04 GiB" "7.76e-04 GiB" "7.8e-04 GiB" "8e-04 GiB" [4,] "4.459146e-01 GiB" "4.46e-01 GiB" "4.5e-01 GiB" "4e-01 GiB" [5,] "2.985889e+02 GiB" "2.99e+02 GiB" "3.0e+02 GiB" "3e+02 GiB" [6,] "4.209112e+05 GiB" "4.21e+05 GiB" "4.2e+05 GiB" "4e+05 GiB" [7,] "4.983449e+08 GiB" "4.98e+08 GiB" "5.0e+08 GiB" "5e+08 GiB" [8,] "7.751081e+11 GiB" "7.75e+11 GiB" "7.8e+11 GiB" "8e+11 GiB" [9,] "8.756173e+14 GiB" "8.76e+14 GiB" "8.8e+14 GiB" "9e+14 GiB" [10,] "9.390947e+17 GiB" "9.39e+17 GiB" "9.4e+17 GiB" "9e+17 GiB" [,9] [,10] [,11] [,12] [1,] "4.656613e-10 G" "4.66e-10 G" "4.7e-10 G" "5e-10 G" [2,] "5.975956e-07 G" "5.98e-07 G" "6.0e-07 G" "6e-07 G" [3,] "7.764672e-04 G" "7.76e-04 G" "7.8e-04 G" "8e-04 G" [4,] "4.459146e-01 G" "4.46e-01 G" "4.5e-01 G" "4e-01 G" [5,] "2.985889e+02 G" "2.99e+02 G" "3.0e+02 G" "3e+02 G" [6,] "4.209112e+05 G" "4.21e+05 G" "4.2e+05 G" "4e+05 G" [7,] "4.983449e+08 G" "4.98e+08 G" "5.0e+08 G" "5e+08 G" [8,] "7.751081e+11 G" "7.75e+11 G" "7.8e+11 G" "8e+11 G" [9,] "8.756173e+14 G" "8.76e+14 G" "8.8e+14 G" "9e+14 G" [10,] "9.390947e+17 G" "9.39e+17 G" "9.4e+17 G" "9e+17 G" > > stopifnot(is.object_sizes(as.object_sizes(2^(1:30)))) > stopifnot(format(as.object_sizes(124)) == "124 bytes") > stopifnot(format(as.object_sizes(124e8), units="auto") == "11.5 GiB") > stopifnot(format(as.object_sizes(124e8), humanReadable=TRUE) == "11.5 GiB") > stopifnot(format(as.object_sizes(124e8), units="bytes") == "1.24e+10 bytes") > > tools::assertError(as.object_sizes(-1)) > tools::assertError(as.object_sizes("a")) > tools::assertError(as.object_sizes(list())) > tools::assertError(as.object_sizes(NULL)) > tools::assertError(as.object_sizes(0+1i)) > > stopifnot(format(as.object_sizes(1e40)) == "1e+40 bytes") > stopifnot(format(as.object_sizes(1e40), units="auto") == "8.271806e+15 YiB") > stopifnot(format(as.object_sizes(1e40), units="bytes") == "1e+40 bytes") > stopifnot(format(as.object_sizes(1e40), humanReadable=TRUE) == "8.271806e+15 YiB") > stopifnot(format(as.object_sizes(1e40), humanReadable=FALSE) == "1e+40 bytes") > > options(humanReadable=TRUE) > stopifnot(format(as.object_sizes(1e40)) == "8.271806e+15 YiB") > options(humanReadable=FALSE) > > proc.time() user system elapsed 0.105 0.008 0.108 gdata/tests/test.reorder.factor.Rout.save0000644000176200001440000000234514441446535020217 0ustar liggesusers R version 4.3.0 (2023-04-21) -- "Already Tomorrow" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## Test results before and after loading gdata > > m <- factor(c("a", "b", "c")) > > (m1 <- reorder(m, X=c(3, 2, 1))) [1] a b c attr(,"scores") a b c 3 2 1 Levels: c b a > > library(gdata) Attaching package: 'gdata' The following object is masked from 'package:stats': nobs The following object is masked from 'package:utils': object.size The following object is masked from 'package:base': startsWith > > (m2 <- reorder(m, X=c(3, 2, 1))) [1] a b c attr(,"scores") a b c 3 2 1 Levels: c b a > > stopifnot(identical(m1, m2)) > > proc.time() user system elapsed 0.084 0.009 0.088 gdata/tests/unitTests/0000755000176200001440000000000014441446535014510 5ustar liggesusersgdata/tests/unitTests/runit.mapLevels.R0000644000176200001440000002261414441446535017730 0ustar liggesusers## Test setup if(FALSE) { library("RUnit") library("gdata") } test.mapLevels <- function() { ## Integer and numeric checkException(mapLevels(1:3)) # wrong class(x) checkException(mapLevels(1.5)) # wrong class(x) ## Factor f <- factor(c("B", "C", "A")) fMapInt <- list(A=as.integer(1), B=as.integer(2), C=as.integer(3)) fMapInt1 <- list(B=as.integer(1), C=as.integer(2)) fMapCha <- list(A="A", B="B", C="C") fMapInt <- as.levelsMap(fMapInt) fMapInt1 <- as.levelsMap(fMapInt1) fMapCha <- as.levelsMap(fMapCha) fMapCha1 <- fMapCha[c(1, 3)] # this will test also [.levelsMap checkIdentical(mapLevels(f), fMapInt) checkTrue(is.levelsMap(mapLevels(f))) # test for is.levelsMap checkTrue(is.levelsMap(fMapInt)) # test for as.levelsMap checkTrue(!gdata:::.isCharacterMap(fMapInt)) checkIdentical(mapLevels(f, sort=FALSE), fMapInt) # sort is not used for factors checkIdentical(mapLevels(f[1:2], drop=TRUE), fMapInt1) checkIdentical(mapLevels(f, codes=FALSE), fMapCha) checkIdentical(mapLevels(f[c(2, 3)], drop=TRUE, codes=FALSE), fMapCha1) ## Character cha <- c("Z", "M", "A") chaMapInt <- list(A=as.integer(1), M=as.integer(2), Z=as.integer(3)) chaMapIntO <- list(Z=as.integer(1), M=as.integer(2), A=as.integer(3)) chaMapInt1 <- list(M=as.integer(1), Z=as.integer(2)) chaMapCha <- list(A="A", M="M", Z="Z") chaMapInt <- as.levelsMap(chaMapInt) chaMapIntO <- as.levelsMap(chaMapIntO) chaMapInt1 <- as.levelsMap(chaMapInt1) chaMapCha <- as.levelsMap(chaMapCha) checkIdentical(mapLevels(cha), chaMapInt) checkIdentical(mapLevels(cha, sort=FALSE), chaMapIntO) # sort works for characters checkIdentical(mapLevels(cha[1:2], drop=TRUE), chaMapInt1) checkIdentical(mapLevels(cha, codes=FALSE), chaMapCha) ## List l <- list(f=f, cha=cha) l1 <- list(cha=cha, f=f) l2 <- list(cha=cha, f=f, i=1:10) lMapInt <- list(f=fMapInt, cha=chaMapInt) lMapCha <- list(f=fMapCha, cha=chaMapCha) lMapInt <- as.listLevelsMap(lMapInt) lMapCha <- as.listLevelsMap(lMapCha) lMapChaC <- as.list(sort(unique(c(cha, as.character(f))))) lMapChaCO <- as.list(unique(c(cha, as.character(f)))) names(lMapChaC) <- unlist(lMapChaC) names(lMapChaCO) <- unlist(lMapChaCO) lMapChaC <- as.levelsMap(lMapChaC) lMapChaCO <- as.levelsMap(lMapChaCO) checkIdentical(mapLevels(l), lMapInt) checkTrue(is.listLevelsMap(mapLevels(l))) # test for is.listLevelsMap checkTrue(is.listLevelsMap(lMapInt)) # test for as.listLevelsMap checkIdentical(mapLevels(l, codes=FALSE), lMapCha) checkException(mapLevels(l, combine=TRUE)) # can not combine integer maps checkIdentical(mapLevels(l, codes=FALSE, combine=TRUE), lMapChaC) checkIdentical(mapLevels(l1, codes=FALSE, combine=TRUE), lMapChaC) checkIdentical(mapLevels(l1, codes=FALSE, combine=TRUE, sort=FALSE), lMapChaCO) checkException(mapLevels(l2)) # only char and factor ## Data.frame df <- data.frame(f1=factor(c("G", "Abc", "Abc", "D", "F")), f2=factor(c("Abc", "Abc", "B", "D", "K")), cha=c("jkl", "A", "D", "K", "L"), int=1:5) dfMapInt <- list(f1=mapLevels(df$f1), f2=mapLevels(df$f2), cha=mapLevels(df$cha)) dfMapInt <- as.listLevelsMap(dfMapInt) dfMapInt1 <- dfMapInt[c(1, 3)] # this will test also [.listLevelsMap checkException(mapLevels(df)) # wrong class of int checkIdentical(mapLevels(df[, 1:3]), dfMapInt) checkIdentical(mapLevels(df[, c(1, 3)]), dfMapInt1) } test.checkLevelsMap <- function(x) { ## levelsMap ## not a list checkException(gdata:::.checkLevelsMap(x="A", method="raw")) ## list without names checkException(gdata:::.checkLevelsMap(x=list("A"), method="raw")) fMapInt <- list(A=as.integer(1), B=as.integer(2), C=as.integer(3)) ## x should be levelsMap checkException(gdata:::.checkLevelsMap(x=fMapInt, method="class")) ## listLevelsMap map <- list(as.levelsMap(fMapInt), as.levelsMap(fMapInt)) map1 <- list(fMapInt, fMapInt) class(map1) <- "listLevelsMap" ## x should be a listLevelsMap checkException(gdata:::.checkListLevelsMap(x=map, method="class")) ## x should be also a list of levelsMaps checkException(gdata:::.checkListLevelsMap(x=map1, method="class")) ## the rest is done with levelsMap tests } test.cLevelsMap <- function() { f1 <- factor(letters[c(2, 1)]) f2 <- factor(letters[c(3, 1, 2)]) mapCha1 <- mapLevels(f1, codes=FALSE) # get maps mapCha2 <- mapLevels(f2, codes=FALSE) mapCha1S <- mapLevels(as.character(f1), codes=FALSE, sort=FALSE) mapCha2S <- mapLevels(as.character(f2), codes=FALSE, sort=FALSE) mapChaTest <- list(a="a", b="b") mapChaTest1 <- list(a="a", b="b", c="c") mapChaTest2 <- list(c="c", a="a", b="b") class(mapChaTest) <- class(mapChaTest1) <- class(mapChaTest2) <- "levelsMap" mapChaTest3 <- list(mapChaTest, mapChaTest1, mapChaTest, mapChaTest1) class(mapChaTest3) <- "listLevelsMap" checkIdentical(c(mapCha1), mapChaTest) checkIdentical(c(mapCha2, mapCha1), mapChaTest1) checkIdentical(c(mapCha2S, mapCha1S, sort=FALSE), mapChaTest2) l <- list(f1, f2) mapCha <- mapLevels(l, codes=FALSE) checkIdentical(c(mapCha, mapCha), mapChaTest3) checkIdentical(c(mapCha, recursive=TRUE), mapChaTest1) checkException(c(mapLevels(f1))) # can not combine integer "levelsMaps" ## Example with maps of different length of components map1 <- list(A=c("a", "e", "i", "o", "u"), B="b", C="c", C="m", D=c("d", "e"), F="f") map2 <- list(A=c("a", "z", "w", "y", "x"), F="f", G=c("g", "h", "j"), i="i", k=c("k", "l"), B="B") map0Test <- list(A=c("a", "e", "i", "o", "u"), B="b", C="c", C="m", D=c("d", "e"), F="f", A=c("z", "w", "y", "x"), G=c("g", "h", "j"), i="i", k=c("k", "l"), B="B") map0Test <- as.levelsMap(map0Test) mapTest <- sort(map0Test) map1 <- as.levelsMap(map1) map2 <- as.levelsMap(map2) map <- c(map1, map2) map0 <- c(map1, map2, sort=FALSE) checkIdentical(map, mapTest) checkIdentical(map0, map0Test) } test.uniqueLevelsMap <- function() { map <- list(A=c(1, 2, 1, 3), B=4, C=1, C=5, D=c(6, 8), E=7, B=4, D=c(6, 8)) map1 <- map map1[[1]] <- map[[1]][c(1, 2, 4)] map1[[7]] <- NULL # remove B=4 map1[[7]] <- NULL # remove D=c(6, 8) ## unique (used in as.levelsMap), will remove duplicates (A=1) checkIdentical(as.levelsMap(map1), as.levelsMap(map)) } "test.mapLevels<-" <- function() { ## Some errors checkException("mapLevels<-"(1.1, value=2)) # wrong class(x) checkException("mapLevels<-"(complex(1.1), value=2)) # wrong class(x) f <- factor(c("A", "B", "C")) fMapInt <- mapLevels(f) ## Can not apply integer "levelsMap" to "character" checkException("mapLevels<-"(as.character(f), value=fMapInt)) fMapCha <- mapLevels(f, codes=FALSE) ## Can not apply character levelsMap to "integer" checkException("mapLevels<-"(as.integer(f), value=chaMapCha)) fMapFuzz <- fMapInt fMapFuzz[[1]] <- "A" ## All components of 'value' must be of the same class checkException("mapLevels<-"(as.character(f), value=fMapFuzz)) checkException("mapLevels<-"(as.integer(f), value=fMapFuzz)) ## x integer, value integer levelsMap f <- factor(letters[c(10, 15, 1, 2)]) fMapInt <- mapLevels(f) fInt <- as.integer(f) mapLevels(fInt) <- fMapInt checkIdentical(fInt, f) ## x factor, value integer levelsMap fInt <- factor(as.integer(f)) mapLevels(fInt) <- fMapInt checkIdentical(fInt, f) ## Above is essentially the same as levels<-.factor fInt1 <- factor(as.integer(f)) levels(fInt1) <- fMapInt checkIdentical(fInt1, f) ## x character, value character levelsMap cha <- c("B", "A", "C") chaMapCha <- as.levelsMap(list(A1="A", B2="B", C3="C")) mapLevels(cha) <- chaMapCha chaTest <- factor(c("B2", "A1", "C3")) checkIdentical(cha, chaTest) ## and a bit more for components of length > 1 cha <- c("G", "I", "B", "A", "C", "D", "Z") chaMapCha <- as.levelsMap(list(A1=c("A", "G", "I"), B2="B", C3=c("C", "D"))) mapLevels(cha) <- chaMapCha chaTest <- factor(c("A1", "A1", "B2", "A1", "C3", "C3", NA)) checkIdentical(cha, chaTest) ## x factor, value character levelsMap f <- factor(c("G", "I", "B", "A", "C", "D", "Z")) fMapCha <- as.levelsMap(list(A1=c("A", "G", "I"), B2="B", C3=c("C", "D"))) mapLevels(f) <- fMapCha fTest <- factor(c("A1", "A1", "B2", "A1", "C3", "C3", NA)) checkIdentical(f, fTest) ## Two factors and character map f1 <- factor(letters[1:10]) f2 <- factor(letters[5:14]) checkIdentical(as.integer(f1), as.integer(f2)) # the same integer codes mapCha1 <- mapLevels(f1, codes=FALSE) # get maps mapCha2 <- mapLevels(f2, codes=FALSE) mapCha <- c(mapCha1, mapCha2) # combine maps ## apply map mapLevels(f1) <- mapCha # the same as levels(f1) <- mapCha mapLevels(f2) <- mapCha # the same as levels(f2) <- mapCha checkIdentical(as.integer(f1), 1:10) # \ internal codes are now checkIdentical(as.integer(f2), 5:14) # / "consistent" among factors ## The same with list l <- list(f1=f1, f2=f2) mapCha <- mapLevels(l, codes=FALSE, combine=TRUE) mapLevels(l) <- mapCha checkIdentical(as.integer(l$f1), 1:10) # \ internal codes are now checkIdentical(as.integer(l$f2), 5:14) # / "consistent" among factors ## and data.frame df <- data.frame(f1=f1, f2=f2) mapCha <- mapLevels(df, codes=FALSE, combine=TRUE) mapLevels(df) <- mapCha checkIdentical(as.integer(df$f1), 1:10) # \ internal codes are now checkIdentical(as.integer(df$f2), 5:14) # / "consistent" among factors } gdata/tests/unitTests/runit.drop.levels.R0000644000176200001440000000071314441446535020231 0ustar liggesusers## Test setup if(FALSE) { library("RUnit") library("gdata") } test.drop.levels <- function() { f <- factor(c("A", "B", "C", "D"))[1:3] fDrop <- factor(c("A", "B", "C")) l <- list(f=f, i=1:3, c=c("A", "B", "D")) lDrop <- list(f=fDrop, i=1:3, c=c("A", "B", "D")) df <- as.data.frame(l) dfDrop <- as.data.frame(lDrop) checkIdentical(drop.levels(f), fDrop) checkIdentical(drop.levels(l), lDrop) checkIdentical(drop.levels(df), dfDrop) } gdata/tests/unitTests/runit.trimSum.R0000644000176200001440000000142114441446535017431 0ustar liggesusers## Test setup if(FALSE) { library("RUnit") library("gdata") } test.trimSum <- function() { ## 'x' must be a vector - for now checkException(trimSum(matrix(1:10))) checkException(trimSum(data.frame(1:10))) checkException(trimSum(list(1:10))) ## 'x' must be numeric checkException(trimSum(letters)) ## 'n' must be smaller than the length of x checkException(trimSum(x=1:10, n=11)) checkException(trimSum(x=1, n=1)) ## Default x <- trimSum(x=1:10, n=5) x2 <- c(1:4, 45) checkEquals(x, x2) ## Left x <- trimSum(x=1:10, n=5, right=FALSE) x2 <- c(21, 7:10) checkEquals(x, x2) ## NA x <- trimSum(x=c(1:9, NA), n=5) x2 <- c(1:4, NA) checkEquals(x, x2) x <- trimSum(x=c(1:9, NA), n=5, na.rm=TRUE) x2 <- c(1:4, 35) checkEquals(x, x2) } gdata/tests/unitTests/runit.wideByFactor.R0000644000176200001440000000242014441446535020353 0ustar liggesusers## Test setup if(FALSE) { library("RUnit") library("gdata") } test.wideByFactor <- function() { n <- 10 f <- 2 tmp <- data.frame(y1=(1:n)/2, y2=(n:1)*2, f1=factor(rep(letters[1:f], n/2)), f2=factor(c(rep(c("M"), n/2), rep(c("F"), n/2))), c1=1:n, c2=2*(1:n)) ## 'x' must be a data.frame checkException(wideByFactor(x=1:10)) checkException(wideByFactor(x=matrix(1:10))) ## 'factor' can be only of length one checkException(wideByFactor(x=tmp, factor=c("f1", "f2"))) ## Column defined in 'factor' must be a factor checkException(wideByFactor(x=tmp, factor="c1")) tmp2 <- wideByFactor(x=tmp, factor="f1", common=c("c1", "c2"), sort=FALSE) checkEquals(tmp2[c("c1", "c2")], tmp[c("c1", "c2")]) checkEquals(names(tmp2), c("c1", "c2", "f1", "y1.a", "y2.a", "f2.a", "y1.b", "y2.b", "f2.b")) checkEquals(tmp2$y1.a, c(0.5, NA, 1.5, NA, 2.5, NA, 3.5, NA, 4.5, NA)) checkEquals(tmp2$f2.a, factor(c("M", NA, "M", NA, "M", NA, "F", NA, "F", NA))) tmp2 <- wideByFactor(x=tmp, factor="f1", common=c("c1", "c2"), sort=TRUE, keepFactor=FALSE) checkEquals(tmp2$f2.a, factor(c("M", "M", "M", "F", "F", NA, NA, NA, NA, NA))) checkEquals(names(tmp2), c("c1", "c2", "y1.a", "y2.a", "f2.a", "y1.b", "y2.b", "f2.b")) } gdata/tests/unitTests/runit.trim.R0000644000176200001440000000162714441446535016754 0ustar liggesusers## Test setup if(FALSE) { library("RUnit") library("gdata") } test.trim <- function() { tmp <- Sys.getlocale(category="LC_COLLATE") Sys.setlocale(category="LC_COLLATE", locale="C") sTrim <- " this is an example string " sTrimR <- "this is an example string" fTrim <- factor(c(sTrim, sTrim, " A", " B ", " C ", "D ")) fTrimR <- factor(c(sTrimR, sTrimR, "A", "B", "C", "D")) lTrim <- list(s=rep(sTrim, times=6), f=fTrim, i=1:6) lTrimR <- list(s=rep(sTrimR, times=6), f=fTrimR, i=1:6) dfTrim <- as.data.frame(lTrim) dfTrimR <- as.data.frame(lTrimR) checkIdentical(trim(sTrim), sTrimR) checkIdentical(trim(fTrim), fTrimR) checkIdentical(levels(trim(fTrim, recode.factor=FALSE)), c("this is an example string", "C", "A", "B", "D")) checkIdentical(trim(lTrim), lTrimR) checkIdentical(trim(dfTrim), dfTrimR) Sys.setlocale(category="LC_COLLATE", locale=tmp) } gdata/tests/unitTests/runit.bindData.R0000644000176200001440000000435114441446535017504 0ustar liggesusers## Test setup if(FALSE) { library("RUnit") library("gdata") } test.bindData <- function() { ## 'x'/'y' must be a data.frame checkException(bindData(x=1:10, y=1:10)) checkException(bindData(x=matrix(1:10), y=matrix(1:10))) n1 <- 6; n2 <- 12; n3 <- 4 ## Single trait 1 num <- c(5:n1, 10:13) tmp1 <- data.frame(y1=rnorm(n=n1), f1=factor(rep(c("A", "B"), n1/2)), ch=letters[num], fa=factor(letters[num]), nu=(num) + 0.5, id=factor(num), stringsAsFactors=FALSE) ## Single trait 2 with repeated records, some subjects also in tmp1 num <- 4:9 tmp2 <- data.frame(y2=rnorm(n=n2), f2=factor(rep(c("C", "D"), n2/2)), ch=letters[rep(num, times=2)], fa=factor(letters[rep(c(num), times=2)]), nu=c((num) + 0.5, (num) + 0.25), id=factor(rep(num, times=2)), stringsAsFactors=FALSE) ## Single trait 3 with completely distinct set of subjects num <- 1:4 tmp3 <- data.frame(y3=rnorm(n=n3), f3=factor(rep(c("E", "F"), n3/2)), ch=letters[num], fa=factor(letters[num]), nu=(num) + 0.5, id=factor(num), stringsAsFactors=FALSE) ## Combine all datasets tmp12 <- bindData(x=tmp1, y=tmp2, common=c("id", "nu", "ch", "fa")) tmp123 <- bindData(x=tmp12, y=tmp3, common=c("id", "nu", "ch", "fa")) checkEquals(names(tmp123), c("id", "nu", "ch", "fa", "y1", "f1", "y2", "f2", "y3", "f3")) checkEquals(rbind(tmp1["id"], tmp2["id"], tmp3["id"]), tmp123["id"]) checkEquals(rbind(tmp1["fa"], tmp2["fa"], tmp3["fa"]), tmp123["fa"]) checkEquals(is.na(tmp123$y1), c(rep(FALSE, times=n1), rep(TRUE, times=n2+n3))) checkEquals(is.na(tmp123$f1), c(rep(FALSE, times=n1), rep(TRUE, times=n2+n3))) checkEquals(is.na(tmp123$y2), c(rep(TRUE, times=n1), rep(FALSE, times=n2), rep(TRUE, times=n3))) checkEquals(is.na(tmp123$f2), c(rep(TRUE, times=n1), rep(FALSE, times=n2), rep(TRUE, times=n3))) checkEquals(is.na(tmp123$y3), c(rep(TRUE, times=n1+n2), rep(FALSE, times=n3))) checkEquals(is.na(tmp123$f3), c(rep(TRUE, times=n1+n2), rep(FALSE, times=n3))) } gdata/tests/unitTests/runit.reorder.factor.R0000644000176200001440000000246514441446535020721 0ustar liggesusers## Test setup if(FALSE) { library("RUnit") library("gdata") } test.reorder.factor <- function() { tmp <- Sys.getlocale(category="LC_COLLATE") Sys.setlocale(category="LC_COLLATE", locale="C") ## Create a 4 level example factor levs <- c("PLACEBO", "300 MG", "600 MG", "1200 MG") trt <- factor(rep(x=levs, times=c(22, 24, 28, 26))) ## Change the order to something useful ## default "mixedsort" ordering trt2 <- reorder(trt) levsTest <- c("300 MG", "600 MG", "1200 MG", "PLACEBO") checkIdentical(levels(trt2), levsTest) ## Using indexes trt3 <- reorder(trt, new.order=c(4, 2, 3, 1)) levsTest <- c("PLACEBO", "300 MG", "600 MG", "1200 MG") checkIdentical(levels(trt3), levsTest) ## Using label names trt4 <- reorder(trt, new.order=c("PLACEBO", "300 MG", "600 MG", "1200 MG")) levsTest <- c("PLACEBO", "300 MG", "600 MG", "1200 MG") checkIdentical(levels(trt4), levsTest) ## Using frequency trt5 <- reorder(trt, X=as.numeric(trt), FUN=length) levsTest <- c("PLACEBO", "300 MG", "1200 MG", "600 MG") checkIdentical(levels(trt5), levsTest) ## Drop out the '300 MG' level trt6 <- reorder(trt, new.order=c("PLACEBO", "600 MG", "1200 MG")) levsTest <- c("PLACEBO", "600 MG", "1200 MG") checkIdentical(levels(trt6), levsTest) Sys.setlocale(category="LC_COLLATE", locale=tmp) } gdata/tests/unitTests/Makefile0000644000176200001440000000056114511013460016133 0ustar liggesusersTOP=../.. PKG=${shell cd ${TOP};pwd} SUITE=runRUnitTests.R test: # Run unit tests Rscript ${SUITE} all: inst test echo: # Echo env. variables @echo "Package folder: ${PKG}" @echo "R binary: ${R}" help: # Help @echo -e '\nTarget: Dependency # Description'; \ echo '=================================================='; \ egrep '^[[:alnum:].+_()%]*:' ./Makefile gdata/tests/unitTests/runit.cbindX.R0000644000176200001440000000412214441446535017201 0ustar liggesusers## Test setup if(FALSE) { library("RUnit") library("gdata") } test.cbindX <- function() { df1 <- data.frame(a=1:3, b=c("A", "B", "C")) df2 <- data.frame(c=as.character(1:5), a=5:1) ma1 <- matrix(as.character(1:4), nrow=2, ncol=2) ma2 <- matrix(1:6, nrow=3, ncol=2) df12test <- cbindX(df1, df2) df12stand <- data.frame(a=c(1:3, NA, NA), b=c("A", "B", "C", NA, NA), c=as.character(1:5), a=5:1) names(df12stand)[4] <- "a" checkEquals(df12test, df12stand) ma12test <- cbindX(ma1, ma2) ma12stand <- matrix(as.character(c(1, 3, 1, 4, 2, 4, 2, 5, NA, NA, 3, 6)), nrow=3, ncol=4, byrow=TRUE) checkEquals(ma12test, ma12stand) da11test <- cbindX(df1, ma1) da11stand <- data.frame(a=1:3, b=c("A", "B", "C"), as.character(c(1:2, NA)), as.character(c(3:4, NA))) names(da11stand)[3:4] <- c("1", "2") checkEquals(da11test, da11stand) tmpTest <- cbindX(df1, df2, ma1, ma2) tmpStand <- data.frame(a=c(1:3, NA, NA), b=c("A", "B", "C", NA, NA), c=as.character(1:5), a=5:1, as.character(c(1:2, NA, NA, NA)), as.character(c(3:4, NA, NA, NA)), c(1:3, NA, NA), c(4:6, NA, NA)) names(tmpStand)[4:8] <- c("a", "1", "2", "1", "2") checkEquals(tmpTest, tmpStand) tmpTest <- cbindX(ma1, ma2, df1, df2) tmpStand <- data.frame(as.character(c(1:2, NA, NA, NA)), as.character(c(3:4, NA, NA, NA)), as.character(c(1:3, NA, NA)), as.character(c(4:6, NA, NA)), a=c(1:3, NA, NA), b=c("A", "B", "C", NA, NA), c=as.character(1:5), a=5:1) names(tmpStand)[c(1:4, 8)] <- c("1", "2", "3", "4", "a") checkEquals(tmpTest, tmpStand) } gdata/tests/unitTests/runit.unknown.R0000644000176200001440000005415114441446535017500 0ustar liggesusers## Test setup library("RUnit") library("gdata") ## Vectors intUnk <- 9999 xInt <- as.integer(c(NA, 1:2, NA, 5, 6, 7, 8, 9)) xIntUnk <- as.integer(c(intUnk, 1:2, intUnk, 5, 6, 7, 8, 9)) xIntUnkTest <- xIntUnk %in% intUnk numUnk <- 0 xNum <- c(9999, NA, 1.5, NA, 5, 6, 7, 8, 9) xNumUnk <- c(9999, 0, 1.5, 0, 5, 6, 7, 8, 9) xNumUnkTest <- xNumUnk %in% numUnk chaUnk <- "notAvail" chaUnk1 <- "-" xCha <- c("A", "B", NA, "C", NA, "-", "7", "8", "9") xChaUnk <- c("A", "B", chaUnk, "C", chaUnk, "-", "7", "8", "9") xChaUnk1 <- c("A", "B", chaUnk1, "C", chaUnk1, "-", "7", "8", "9") xChaUnkTest <- xChaUnk %in% chaUnk xChaUnk1Test <- xChaUnk %in% chaUnk1 facUnk <- "notAvail" facUnk1 <- "NA" xFac <- factor(c("A", "0", 0, "NA", "NA", intUnk, numUnk, "-", NA)) xFacUnk <- factor(c("A", "0", 0, "NA", "NA", intUnk, numUnk, "-", facUnk)) xFacUnk1 <- factor(c("A", "0", 0, "NA", "NA", intUnk, numUnk, "-", facUnk1)) xFacUnkTest <- c(0, 0, 0, 0, 0, 0, 0, 0, 1) xFacUnkTest <- as.logical(xFacUnkTest) xFacUnk1Test <- c(0, 0, 0, 1, 1, 0, 0, 0, 1) xFacUnk1Test <- as.logical(xFacUnk1Test) xFac1 <- factor(c("A", "0", 0, NA, NA, intUnk, numUnk, "-", NA)) facLev <- "A" xFacUnkLev <- factor(c("A", "0", 0, "NA", "NA", intUnk, numUnk, "-", "A")) xFacUnkLevTest <- c(1, 0, 0, 0, 0, 0, 0, 0, 1) xFacUnkLevTest <- as.logical(xFacUnkLevTest) dateUnk <- as.Date("2006-08-14") tmp <- as.Date("2006-08-15") xDate <- c(tmp, NA) xDateUnk <- c(tmp, dateUnk) xDateTest <- c(FALSE, TRUE) xDate1Unk <- c(tmp, dateUnk, NA) xDate1Test <- c(FALSE, TRUE, FALSE) POSIXltUnk <- strptime("2006-08-14", format="%Y-%m-%d") tmp <- strptime("2006-08-15", format="%Y-%m-%d") xPOSIXlt <- c(tmp, NA) xPOSIXltUnk <- c(tmp, POSIXltUnk) xPOSIXltTest <- c(FALSE, TRUE) xPOSIXlt1Unk <- c(tmp, POSIXltUnk, NA) xPOSIXlt1Test <- c(FALSE, TRUE, FALSE) POSIXctUnk <- as.POSIXct(strptime("2006-08-14 01:01:01", format="%Y-%m-%d %H:%M:%S")) tmp <- as.POSIXct(strptime("2006-08-15 01:01:01", format="%Y-%m-%d %H:%M:%S")) xPOSIXct <- c(tmp, NA) xPOSIXctUnk <- c(tmp, POSIXctUnk) xPOSIXctTest <- xPOSIXltTest xPOSIXct1Unk <- c(tmp, POSIXctUnk, NA) xPOSIXct1Test <- xPOSIXlt1Test ## Lists and data frames xList <- list(xInt, xCha, xNum, xFac) xListN <- list(int=xInt, cha=xCha, num=xNum, fac=xFac) xListUnk <- list(xIntUnk, xChaUnk, xNumUnk, xFacUnk) xListUnkTest <- list(xIntUnkTest, xChaUnkTest, xNumUnkTest, xFacUnkTest) xListNUnk <- list(int=xIntUnk, cha=xChaUnk, num=xNumUnk, fac=xFacUnk) xListNUnkTest <- list(int=xIntUnkTest, cha=xChaUnkTest, num=xNumUnkTest, fac=xFacUnkTest) xDF <- as.data.frame(xListN) xDF$cha <- as.character(xDF$cha) xDFUnk <- as.data.frame(xListNUnk) xDFUnk$cha <- as.character(xDFUnk$cha) xDFUnkTest <- as.data.frame(xListNUnkTest) unkC <- c(intUnk, chaUnk, numUnk, facUnk) unkL <- list(intUnk, chaUnk, numUnk, facUnk) unkLN <- list(num=numUnk, cha=chaUnk, fac=facUnk, int=intUnk) # mixed as it is named unkLMN <- list(cha=chaUnk, int=intUnk, num=c(intUnk, numUnk), fac=c(chaUnk1, facUnk)) xListMNUnkF <- list(int=as.integer(c(9999, 1, 2, 9999, 5, 6, 7, 8, 9)), cha=c("A", "B", "notAvail", "C", "notAvail", "-", "7", "8", "9"), num=c(9999, 0, 1.5, 0, 5, 6, 7, 8, 9), fac=factor(c("A", "0", "0", "NA", "NA", 9999, "0", "-", "notAvail"))) xListMNUnkFTest <- list(int=c(1, 0, 0, 1, 0, 0, 0, 0, 0), cha=c(0, 0, 1, 0, 1, 0, 0, 0, 0), num=c(1, 1, 0, 1, 0, 0, 0, 0, 0), fac=c(0, 0, 0, 0, 0, 0, 0, 1, 1)) xListMNUnkFTest <- lapply(xListMNUnkFTest, as.logical) xListMNF <- list(int=as.integer(c(NA, 1, 2, NA, 5, 6, 7, 8, 9)), cha=c("A", "B", NA, "C", NA, "-", "7", "8", "9"), num=c(NA, NA, 1.5, NA, 5, 6, 7, 8, 9), fac=factor(c("A", "0", "0", "NA", "NA", "9999", "0", NA, NA))) xDFMUnkF <- as.data.frame(xListMNUnkF) xDFMUnkF$cha <- as.character(xDFMUnkF$cha) xDFMUnkFTest <- as.data.frame(xListMNUnkFTest) xDFMF <- as.data.frame(xListMNF) xDFMF$cha <- as.character(xDFMF$cha) unk1 <- 555555 xListUnk1 <- list(as.integer(c(unk1, 1, 2, unk1, 5, 6, 7, 8, 9)), c("A", "B", unk1, "C", unk1, "-", "7", "8", "9"), c(9999, unk1, 1.5, unk1, 5, 6, 7, 8, 9), factor(c("A", "0", "0", "NA", "NA", "9999", "0", "-", unk1))) xListUnk1Test <- lapply(xListUnk1, function(x) x %in% unk1) xListNUnk1 <- xListUnk1 names(xListNUnk1) <- c("int", "cha", "num", "fac") xDFUnk1 <- as.data.frame(xListNUnk1) xDFUnk1$cha <- as.character(xDFUnk1$cha) xDFUnk1Test <- as.data.frame(xListUnk1Test) names(xDFUnk1Test) <- names(xListNUnk1) unkC2 <- c(0, "notAvail") xListUnk2 <- list(as.integer(c(unkC2[1], 1, 2, unkC2[1], 5, 6, 7, 8, 9)), c("A", "B", unkC2[2], "C", unkC2[2], "-", "7", "8", "9"), c(9999, as.numeric(unkC2[1]), 1.5, as.numeric(unkC2[1]), 5, 6, 7, 8, 9), factor(c("A", "0", "0", "NA", "NA", "9999", "0", "-", unkC2[2]))) xListNUnk2 <- xListUnk2 names(xListNUnk2) <- c("int", "cha", "num", "fac") xDFUnk2 <- as.data.frame(xListNUnk2) xDFUnk2$cha <- as.character(xDFUnk2$cha) xListUnk2Test <- xListUnk2 xListUnk2Test[[1]] <- xListUnk2Test[[1]] %in% unkC2[1] xListUnk2Test[[2]] <- xListUnk2Test[[2]] %in% unkC2[2] xListUnk2Test[[3]] <- xListUnk2Test[[3]] %in% unkC2[1] xListUnk2Test[[4]] <- xListUnk2Test[[4]] %in% unkC2[2] xListNUnk2Test <- xListUnk2Test names(xListNUnk2Test) <- names(xListNUnk2) xDFUnk2Test <- as.data.frame(xListNUnk2Test) unkL2 <- as.list(unkC2) unkLN2 <- unkL2[c(2, 1)] names(unkLN2) <- c("cha", "int") xListUnk2a <- list(as.integer(c(NA, 1, 2, NA, 5, 6, 7, 8, 9)), c("A", "B", unkLN2[[2]], "C", unkLN2[[2]], "-", "7", "8", "9"), c(9999, NA, 1.5, NA, 5, 6, 7, 8, 9), factor(c("A", "0", "0", "NA", "NA", "9999", "0", "-", unkLN2[[2]]))) xListUnk2aTest <- xListUnk2a xListUnk2aTest[[1]] <- xListUnk2aTest[[1]] %in% unkLN2[1] xListUnk2aTest[[2]] <- xListUnk2aTest[[2]] %in% unkLN2[2] xListUnk2aTest[[3]] <- xListUnk2aTest[[3]] %in% unkLN2[1] xListUnk2aTest[[4]] <- xListUnk2aTest[[4]] %in% unkLN2[2] xList2a <- list(xListUnk2a[[1]], c("A", "B", NA, "C", NA, "-", "7", "8", "9"), xListUnk2a[[3]], factor(c("A", NA, NA, "NA", "NA", 9999, NA, "-", NA))) ## Matrix matUnk <- 9999 mat <- matrix(1:25, nrow=5, ncol=5) mat[1, 2] <- NA; mat[1, 4] <- NA; mat[2, 2] <- NA; mat[3, 2] <- NA; mat[3, 5] <- NA; mat[5, 4] <- NA; matUnk1 <- mat matUnk1[1, 2] <- matUnk; matUnk1[1, 4] <- matUnk; matUnk1[2, 2] <- matUnk; matUnk1[3, 2] <- matUnk; matUnk1[3, 5] <- matUnk; matUnk1[5, 4] <- matUnk; matUnkTest <- matUnk1Test <- is.na(mat) matUnk2Test <- matUnkTest | mat == 1 ## Use of unknown=list(.default=, ...) or similarly named vector D1 <- "notAvail" unkLND1 <- list(.default=D1) xListUnkD1 <- list(as.integer(c(NA, 1:2, NA, 5, 6, 7, 8, 9)), c("A", "B", D1, "C", D1, "-", "7", "8", "9"), c(9999, NA, 1.5, NA, 5, 6, 7, 8, 9), factor(c("A", "0", 0, "NA", "NA", intUnk, numUnk, "-", D1))) xListUnkD1Test <- lapply(xListUnkD1, function(x) x %in% D1) xListD1 <- xList xListNUnkD1 <- xListUnkD1 xListNUnkD1Test <- xListUnkD1Test names(xListNUnkD1) <- names(xListNUnkD1Test) <- names(xListNUnk1) xListND1 <- xListN DSO2 <- c("notAvail", 5678) unkLNDSO2 <- as.list(DSO2) names(unkLNDSO2) <- c(".default", "someOther") xListUnkDSO2 <- list(as.integer(c(NA, 1:2, NA, 5, 6, 7, 8, 9)), c("A", "B", DSO2[1], "C", DSO2[1], "-", "7", "8", "9"), c(9999, NA, 1.5, NA, 5, 6, 7, 8, 9), factor(c("A", "0", 0, "NA", "NA", intUnk, numUnk, "-", DSO2[2]))) xListUnkDSO2Test <- lapply(xListUnkDSO2, function(x) x %in% DSO2) unkLND3 <- list(.default="notAvail", num=0, int=9999) xListNUnkD3 <- list(int=as.integer(c(unkLND3[[3]], 1:2, unkLND3[[3]], 5, 6, 7, 8, 9)), cha=c("A", "B", unkLND3[[1]], "C", unkLND3[[1]], "-", "7", "8", "9"), num=c(9999, unkLND3[[2]], 1.5, unkLND3[[2]], 5, 6, 7, 8, 9), fac=factor(c("A", "0", 0, "NA", "NA", intUnk, numUnk, "-", unkLND3[[1]]))) xListNUnkD3Test <- xListNUnkD3 xListNUnkD3Test$int <- xListNUnkD3Test$int %in% unkLND3[[3]] xListNUnkD3Test$cha <- xListNUnkD3Test$cha %in% unkLND3[[1]] xListNUnkD3Test$num <- xListNUnkD3Test$num %in% unkLND3[[2]] xListNUnkD3Test$fac <- xListNUnkD3Test$fac %in% unkLND3[[1]] unkLND2E <- list(.default="notAvail", 9999) ## isUnknown test.isUnknown <- function() { ## Base methods for vectors checkIdentical(isUnknown(xIntUnk, unknown=as.integer(intUnk)), xIntUnkTest) checkIdentical(isUnknown(xIntUnk, unknown=intUnk), xIntUnkTest) checkIdentical(isUnknown(xNumUnk, unknown=numUnk), xNumUnkTest) checkIdentical(isUnknown(xNumUnk, unknown=as.integer(numUnk)), xNumUnkTest) checkIdentical(isUnknown(xChaUnk, unknown=chaUnk), xChaUnkTest) checkIdentical(isUnknown(xFacUnk, unknown=facUnk), xFacUnkTest) ## Multiple values are allowed for vector methods in vector or list form checkIdentical(isUnknown(xIntUnk, unknown=unkC), xIntUnkTest) checkIdentical(isUnknown(xIntUnk, unknown=unkL), xIntUnkTest) ## NA's in factors checkIdentical(isUnknown(xFacUnk1, unknown=facUnk1), xFacUnk1Test) facNA <- factor(c("0", 1, 2, 3, NA, "NA")) facNATest <- c(FALSE, FALSE, FALSE, FALSE, TRUE, FALSE) checkIdentical(isUnknown(facNA), facNATest) ## Date-time classes checkIdentical(isUnknown(xDateUnk, unknown=dateUnk), xDateTest) checkIdentical(isUnknown(xDate1Unk, unknown=dateUnk), xDate1Test) checkIdentical(isUnknown(xPOSIXltUnk, unknown=POSIXltUnk), xPOSIXltTest) checkIdentical(isUnknown(xPOSIXlt1Unk, unknown=POSIXltUnk), xPOSIXlt1Test) checkIdentical(isUnknown(xPOSIXctUnk, unknown=POSIXctUnk), xPOSIXctTest) checkIdentical(isUnknown(xPOSIXct1Unk, unknown=POSIXctUnk), xPOSIXct1Test) ## Lists and data frames ## with vector of single unknown values checkIdentical(isUnknown(xListUnk, unknown=unkC), xListUnkTest) checkIdentical(isUnknown(xDFUnk, unknown=unkC), xDFUnkTest) ## with list of single unknown values checkIdentical(isUnknown(xListUnk, unknown=unkL), xListUnkTest) checkIdentical(isUnknown(xDFUnk, unknown=unkL), xDFUnkTest) ## with named list of single unknown values checkIdentical(isUnknown(xListNUnk, unknown=unkLN), xListNUnkTest) checkIdentical(isUnknown(xDFUnk, unknown=unkLN), xDFUnkTest) ## with named list of multiple unknown values - valid here checkIdentical(isUnknown(xListMNUnkF, unknown=unkLMN), xListMNUnkFTest) checkIdentical(isUnknown(xDFMUnkF, unknown=unkLMN), xDFMUnkFTest) ## with single unknown value - recycling checkIdentical(isUnknown(xListUnk1, unknown=unk1), xListUnk1Test) checkIdentical(isUnknown(xDFUnk1, unknown=unk1), xDFUnk1Test) ## with vector of two unknown values - recycling checkIdentical(isUnknown(xListUnk2, unknown=unkC2), xListUnk2Test) checkIdentical(isUnknown(xDFUnk2, unknown=unkC2), xDFUnk2Test) ## with list of two unknown values - recycling checkIdentical(isUnknown(xListUnk2, unknown=unkL2), xListUnk2Test) checkIdentical(isUnknown(xDFUnk2, unknown=unkL2), xDFUnk2Test) ## list(.default=) checkIdentical(isUnknown(x=xListUnkD1, unknown=unkLND1), xListUnkD1Test) ## list(.default=, someOther=) we do not know someOther, but should work ## as x is not named checkIdentical(isUnknown(x=xListUnkDSO2, unknown=unkLNDSO2), xListUnkDSO2Test) ## list(.default=) in named list checkIdentical(isUnknown(x=xListNUnkD1, unknown=unkLND1), xListNUnkD1Test) ## list(.default=, someOther=) OK if someOther is in the named list checkIdentical(isUnknown(x=xListNUnkD3, unknown=unkLND3), xListNUnkD3Test) ## list(.default=, 99) ERROR as we do not know where to apply 99 checkException(isUnknown(x=xListNUnk, unknown=unkLND2E)) ## Matrix checkIdentical(isUnknown(x=mat, unknown=NA), matUnkTest) checkIdentical(isUnknown(x=matUnk1, unknown=matUnk), matUnkTest) checkIdentical(isUnknown(x=matUnk1, unknown=c(1, matUnk)), matUnk2Test) } ## unknownToNA test.unknownToNA <- function() { ## Base methods for vectors checkIdentical(unknownToNA(xIntUnk, as.integer(intUnk)), xInt) checkIdentical(unknownToNA(xIntUnk, intUnk), xInt) # with numeric checkIdentical(unknownToNA(xNumUnk, numUnk), xNum) checkIdentical(unknownToNA(xNumUnk, as.integer(numUnk)), xNum) checkIdentical(unknownToNA(xChaUnk, chaUnk), xCha) checkIdentical(unknownToNA(xChaUnk, chaUnk), xCha) checkIdentical(unknownToNA(xFacUnk, facUnk), xFac) ## Multiple values are allowed for vector methods in vector or list form checkIdentical(unknownToNA(xIntUnk, unknown=unkC), xInt) checkIdentical(unknownToNA(xIntUnk, unknown=unkL), xInt) ## NA's in factors checkIdentical(unknownToNA(xFacUnk1, unknown=facUnk1), xFac1) facNA <- factor(c("0", 1, 2, 3, NA, "NA")) facNATest <- factor(c("0", 1, 2, 3, NA, NA)) checkIdentical(unknownToNA(x=facNA, unknown="NA"), facNATest) ## Date-time classes checkIdentical(unknownToNA(xDateUnk, unknown=dateUnk), xDate) checkIdentical(unknownToNA(xPOSIXctUnk, unknown=POSIXctUnk), xPOSIXct) ## Per Brian Ripley on 2014-01-15: ## ## On platforms where POSIXlt has a gmtoff component, it does not need to be set. So ## ## > z$gmtoff ## [1] 3600 NA ## > xPOSIXltUnk$gmtoff ## [1] 3600 3600 ## ## (or sometimes 0, not NA). ## ## So although identical() correctly reports that they differ, this ## is allowed for optional components. ## ## It would also be wrong to use identical() to compare isdst ## components: isdst = -1 means unknown. ## ## Replaced: ## checkIdentical(unknownToNA(xPOSIXltUnk, unknown=POSIXltUnk), xPOSIXlt) ## With: tmp_unknownToNA <- unknownToNA(xPOSIXltUnk, unknown=POSIXltUnk) tmp_xPOSIXlt <- xPOSIXlt tmp_unknownToNA$gmtoff <- NULL # Remove $gmtoff to avoid comparison tmp_xPOSIXlt$gmtoff <- NULL isdst.unknown <- unique( c(which(is.na(tmp_unknownToNA$isdst) | tmp_unknownToNA$isdst==-1)), c(which(is.na(tmp_xPOSIXlt$isdst) | tmp_xPOSIXlt$isdst==-1))) checkIdentical(tmp_unknownToNA$isdst[!isdst.unknown], tmp_xPOSIXlt$isds[!isdst.unknown]) tmp_unknownToNA$isdst <- NULL # remove $isdst to avoid comparison tmp_xPOSIXlt$isdst <- NULL # by checkIdentical checkIdentical(tmp_unknownToNA, tmp_xPOSIXlt) ## Lists and data frames ## with vector of single unknown values checkIdentical(unknownToNA(xListUnk, unknown=unkC), xList) checkIdentical(unknownToNA(xDFUnk, unknown=unkC), xDF) ## with list of single unknown values checkIdentical(unknownToNA(xListUnk, unknown=unkL), xList) checkIdentical(unknownToNA(xDFUnk, unknown=unkL), xDF) ## with named list of single unknown values checkIdentical(unknownToNA(xListNUnk, unknown=unkLN), xListN) checkIdentical(unknownToNA(xDFUnk, unknown=unkLN), xDF) ## with names list of multiple unknown values - must be an error checkIdentical(unknownToNA(xListMNUnkF, unknown=unkLMN), xListMNF) checkIdentical(unknownToNA(xDFMUnkF, unknown=unkLMN), xDFMF) ## with single unknown value - recycling checkIdentical(unknownToNA(xListUnk1, unknown=unk1), xList) checkIdentical(unknownToNA(xDFUnk1, unknown=unk1), xDF) ## with vector of two unknown values - recycling checkIdentical(unknownToNA(xListUnk2, unknown=unkC2), xList) checkIdentical(unknownToNA(xDFUnk2, unknown=unkC2), xDF) ## with list of two unknown values - recycling checkIdentical(unknownToNA(xListUnk2, unknown=unkL2), xList) checkIdentical(unknownToNA(xDFUnk2, unknown=unkL2), xDF) ## with named list of two unknown values but x is not named so named list ## does not have any effect --> error as we do not know how to recycle checkException(unknownToNA(xListUnk2a, unknown=unkLN2)) ## but we should get some results with named x checkIdentical(unknownToNA(xListNUnk2, unknown=unkL2), xListN) ## not also necesarily with recycling of names lists, as it is ## not clear how to properly recycle named lists (only names that match ## can be really properly recycled) checkException(unknownToNA(xListNUnk2, unknown=unkLN2)) checkIdentical(unknownToNA(xDFUnk2, unknown=unkL2), xDF) checkException(unknownToNA(xDFUnk2, unknown=unkLN2)) ## list(.default=) checkIdentical(unknownToNA(x=xListUnkD1, unknown=unkLND1), xListD1) ## list(.default=, someOther=) we do not know someOther, but should work ## as x is not named checkIdentical(unknownToNA(x=xListUnkDSO2, unknown=unkLNDSO2), xList) ## list(.default=) in named list checkIdentical(unknownToNA(x=xListNUnkD1, unknown=unkLND1), xListND1) ## list(.default=, someOther=) OK if someOther is in the named list checkIdentical(unknownToNA(x=xListNUnkD3, unknown=unkLND3), xListN) ## list(.default=, 99) ERROR as we do not know where to apply 99 checkException(unknownToNA(x=xListNUnk, unknown=unkLND2E)) ## Matrix checkEquals(unknownToNA(x=matUnk1, unknown=matUnk), mat) } ## NAToUnknown test.NAToUnknown <- function() { ## Base methods for vectors checkIdentical(NAToUnknown(xInt, as.integer(intUnk)), xIntUnk) checkIdentical(NAToUnknown(xInt, intUnk), xIntUnk) # with numeric checkIdentical(NAToUnknown(xNum, numUnk), xNumUnk) checkIdentical(NAToUnknown(xNum, as.integer(numUnk)), xNumUnk) checkIdentical(NAToUnknown(xCha, chaUnk), xChaUnk) checkIdentical(NAToUnknown(xCha, chaUnk), xChaUnk) checkIdentical(NAToUnknown(xFac, facUnk), xFacUnk) ## only single values are allowed for vector methods checkException(NAToUnknown(xInt, unknown=unkC)) checkException(NAToUnknown(xInt, unknown=unkL)) ## and they should not already be in x unless force=TRUE checkException(NAToUnknown(xCha, unknown=chaUnk1)) checkIdentical(NAToUnknown(xCha, unknown=chaUnk1, force=TRUE), xChaUnk1) checkException(NAToUnknown(xFac, unknown=facLev)) checkIdentical(NAToUnknown(xFac, unknown=facLev, force=TRUE), xFacUnkLev) ## NA's in factors checkIdentical(NAToUnknown(xFac, unknown=facUnk1, force=TRUE), xFacUnk1) facNA <- factor(c("0", 1, 2, 3, NA, NA)) facNATest <- factor(c("0", 1, 2, 3, "NA", "NA")) checkIdentical(NAToUnknown(x=facNA, unknown="NA"), facNATest) ## Date-time classes checkIdentical(NAToUnknown(xDate, unknown=dateUnk), xDateUnk) checkIdentical(NAToUnknown(xPOSIXct, unknown=POSIXctUnk), xPOSIXctUnk) ## Per Brian Ripley on 2014-01-15: ## ## On platforms where POSIXlt has a gmtoff component, it does not need to be set. So ## ## > z$gmtoff ## [1] 3600 NA ## > xPOSIXltUnk$gmtoff ## [1] 3600 3600 ## ## (or sometimes 0, not NA). ## ## So although identical() correctly reports that they differ, this ## is allowed for optional components. ## ## It would also be wrong to use identical() to compare isdst ## components: isdst = -1 means unknown. ## ## Replaced: ## checkIdentical(NAToUnknown(xPOSIXlt, unknown=POSIXltUnk), xPOSIXltUnk) ## With: tmp_NAToUnknown <- NAToUnknown(xPOSIXlt, unknown=POSIXltUnk) tmp_xPOSIXltUnk <- xPOSIXltUnk tmp_NAToUnknown$gmtoff <- NULL # remove $gmtoff to avoid comparison tmp_xPOSIXltUnk$gmtoff <- NULL isdst.unknown <- unique( c(which(is.na(tmp_NAToUnknown$isdst) | tmp_NAToUnknown$isdst==-1)), c(which(is.na(tmp_xPOSIXltUnk$isdst) | tmp_xPOSIXltUnk$isdst==-1))) checkIdentical(tmp_NAToUnknown$isdst[!isdst.unknown], tmp_xPOSIXltUnk$isds[!isdst.unknown]) tmp_NAToUnknown$isdst <- NULL # remove $isdst to avoid comparison tmp_xPOSIXltUnk$isdst <- NULL # by checkIdentical checkIdentical(tmp_NAToUnknown, tmp_xPOSIXltUnk) ## Lists and data frames ## with vector of single unknown values checkIdentical(NAToUnknown(xList, unknown=unkC), xListUnk) checkIdentical(NAToUnknown(xDF, unknown=unkC), xDFUnk) ## with list of single unknown values checkIdentical(NAToUnknown(xList, unknown=unkL), xListUnk) checkIdentical(NAToUnknown(xDF, unknown=unkL), xDFUnk) ## with named list of single unknown values checkIdentical(NAToUnknown(xListN, unknown=unkLN), xListNUnk) checkIdentical(NAToUnknown(xDF, unknown=unkLN), xDFUnk) ## with names list of multiple unknown values - must be an error checkException(NAToUnknown(xListN, unknown=unkLMN)) checkException(NAToUnknown(xDF, unknown=unkLMN)) ## with single unknown value - recycling checkIdentical(NAToUnknown(xList, unknown=unk1), xListUnk1) checkIdentical(NAToUnknown(xDF, unknown=unk1), xDFUnk1) ## with vector of two unknown values - recycling checkIdentical(NAToUnknown(xList, unknown=unkC2), xListUnk2) checkIdentical(NAToUnknown(xDF, unknown=unkC2), xDFUnk2) ## with list of two unknown values - recycling checkIdentical(NAToUnknown(xList, unknown=unkL2), xListUnk2) checkIdentical(NAToUnknown(xDF, unknown=unkL2), xDFUnk2) ## with named list of two unknown values but x is not named so named list ## does not have any effect --> error as we do not know how to recycle checkException(NAToUnknown(xList, unknown=unkLN2)) ## but we should get some results with named x checkIdentical(NAToUnknown(xListN, unknown=unkL2), xListNUnk2) ## not also necesarilly with recycling of names lists, as it is ## not clear how to properly recycle named lists (only names that match ## can be really properly recycled) checkException(NAToUnknown(xListN, unknown=unkLN2)) checkIdentical(NAToUnknown(xDF, unknown=unkL2), xDFUnk2) checkException(NAToUnknown(xDF, unknown=unkLN2)) ## list(.default=) checkIdentical(NAToUnknown(x=xList, unknown=unkLND1), xListUnkD1) ## list(.default=, someOther=) we do not know someOther, but should work ## as x is not named checkIdentical(NAToUnknown(x=xList, unknown=unkLNDSO2), xListUnkDSO2) ## list(.default=) in named list checkIdentical(NAToUnknown(x=xListN, unknown=unkLND1), xListNUnkD1) ## list(.default=, someOther=) OK if someOther is in the named list checkIdentical(NAToUnknown(x=xListN, unknown=unkLND3), xListNUnkD3) ## list(.default=, 99) ERROR as we do not know where to apply 99 checkException(NAToUnknown(x=xListN, unknown=unkLND2E)) ## Matrix checkEquals(NAToUnknown(x=mat, unknown=matUnk), matUnk1) } gdata/tests/unitTests/runit.write.fwf.R0000644000176200001440000001242414441446535017711 0ustar liggesusers## Test setup if(FALSE) { library("RUnit") library("gdata") } test.write.fwf <- function() { ## 'x' must be a data.frame or matrix checkException(write.fwf(1:10)) checkException(write.fwf(list(1:10))) ## Only single value is allowed in 'na' checkException(write.fwf(data.frame(1:10, letters[1:10]), na=c("", " "))) ## Example dataset num <- round(c(733070.345678, 1214213.78765456, 553823.798765678, 1085022.8876545678, 571063.88765456, 606718.3876545678, 1053686.6, 971024.187656, 631193.398765456, 879431.1), digits=3) testData <- data.frame(num1=c(1:10, NA), num2=c(NA, seq(from=1, to=5.5, by=0.5)), num3=c(NA, num), int1=c(as.integer(1:4), NA, as.integer(4:9)), fac1=factor(c(NA, letters[1:9], "hjh")), fac2=factor(c(letters[6:15], NA)), cha1=c(letters[17:26], NA), cha2=c(NA, "longer", letters[25:17]), stringsAsFactors=FALSE) levels(testData$fac1) <- c(levels(testData$fac1), "unusedLevel") testData$Date <- as.Date("1900-1-1") testData$Date[2] <- NA testData$POSIXt <- as.POSIXct(strptime("1900-1-1 01:01:01", format="%Y-%m-%d %H:%M:%S")) testData$POSIXt[5] <- NA ## Output ## is tested with regular tests ## formatInfo ## Default output formatInfoT <- data.frame(colname=c("num1", "num2"), nlevels=c(0, 0), position=c(1, 4), width=c(2, 3), digits=c(0, 1), exp=c(0, 0), stringsAsFactors=FALSE) testData1 <- testData[, c("num1", "num2")] testData1M <- as.matrix(testData1) formatInfo <- write.fwf(testData1, formatInfo=TRUE) checkEquals(formatInfo, formatInfoT) formatInfoM <- write.fwf(testData1M, formatInfo=TRUE) checkEquals(formatInfoM, formatInfoT) ## Scientific notation dd <- options("digits"); options(digits = 7) testData2 <- data.frame(a=123, b=pi, c=1e8, d=1e222) formatInfo <- write.fwf(x=testData2, formatInfo=TRUE) checkEquals(formatInfo$width, c(3, 8, 5, 6)) checkEquals(formatInfo$digits, c(0, 6, 0, 0)) checkEquals(formatInfo$exp, c(0, 0, 2, 3)) options(dd) ## reset old options ## 'na' can either decrease or increase the width ## --> values of int1 have width 1 and using na="" should not increase ## the width formatInfo <- write.fwf(testData[, "int1", drop=FALSE], formatInfo=TRUE, na="") checkEquals(formatInfo$width, 1) ## --> values of int1 have width 1 and using na="1234" should increase ## the width to 4 formatInfo <- write.fwf(testData[, "int1", drop=FALSE], formatInfo=TRUE, na="1234") checkEquals(formatInfo$width, 4) ## rowCol formatInfoTR <- data.frame(colname=c("row", "num1", "num2"), nlevels=c(11, 0, 0), position=c(1, 4, 7), width=c(2, 2, 3), digits=c(0, 0, 1), exp=c(0, 0, 0), stringsAsFactors=FALSE) testData3 <- testData[, c("num1", "num2")] testData3M <- as.matrix(testData3) formatInfoR <- write.fwf(testData3, formatInfo=TRUE, rownames=TRUE, rowCol="row") checkEquals(formatInfoR, formatInfoTR) formatInfoR <- write.fwf(testData3M, formatInfo=TRUE, rownames=TRUE, rowCol="row") checkEquals(formatInfoR, formatInfoTR) ## QuoteInfo alone does not have any effect formatInfoI <- write.fwf(testData3, formatInfo=TRUE, quoteInfo=TRUE) checkEquals(formatInfoI, formatInfoT) formatInfoI <- write.fwf(testData3M, formatInfo=TRUE, quoteInfo=TRUE) checkEquals(formatInfoI, formatInfoT) ## Quote formatInfoTQ <- formatInfoT formatInfoTQ$position <- c(1, 6) formatInfoTQ$width <- c(4, 5) formatInfoQ <- write.fwf(testData3, formatInfo=TRUE, quote=TRUE) checkEquals(formatInfoQ, formatInfoTQ) formatInfoQ <- write.fwf(testData3M, formatInfo=TRUE, quote=TRUE) checkEquals(formatInfoQ, formatInfoTQ) ## Quote without quoteInfo formatInfoTQI <- formatInfoT formatInfoTQI$position <- c(2, 6) formatInfoQI <- write.fwf(testData3, formatInfo=TRUE, quote=TRUE, quoteInfo=FALSE) checkEquals(formatInfoQI, formatInfoTQI) formatInfoQI <- write.fwf(testData3M, formatInfo=TRUE, quote=TRUE, quoteInfo=FALSE) checkEquals(formatInfoQI, formatInfoTQI) ## Width ## --> default width for num1 is 2 testData4 <- testData[, "num1", drop=FALSE] testData4M <- as.matrix(testData[, "num1", drop=FALSE]) formatInfo <- write.fwf(testData4, width=10, formatInfo=TRUE) checkEquals(formatInfo$width, 10) formatInfo <- write.fwf(testData4M, width=10, formatInfo=TRUE) checkEquals(formatInfo$width, 10) ## Too small value in width (this also tests recycling) ## --> proper width for num1 is 2, while for num2 it is 3 checkException(write.fwf(testData[, c("num1", "num2")], width=2)) checkException(write.fwf(testData[, c("num1", "num2")], width=c(2, 1))) ## Done cat("\nDONE.\n\n") } gdata/tests/unitTests/runit.nPairs.R0000644000176200001440000000322014441446535017224 0ustar liggesusers## Test setup if(FALSE) { library("RUnit") library("gdata") } test.nPairs <- function() { ## 'x' must be a data.frame or a matrix x <- rpois(100, lambda=10) checkException(nPairs(x=x)) checkException(nPairs(x=table(x))) test <- data.frame(V1=c(1, 2, 3, 4, 5), V2=c(NA, 2, 3, 4, 5), V3=c(1, NA, NA, NA, NA), V4=c(1, 2, 3, NA, NA)) testCheck <- matrix(data=as.integer(c(5, 4, 1, 3, 4, 4, 0, 2, 1, 0, 1, 1, 3, 2, 1, 3)), nrow=4, ncol=4, byrow=TRUE) class(testCheck) <- c("nPairs", class(testCheck)) testCheckNames <- testCheck colnames(testCheckNames) <- rownames(testCheckNames) <- colnames(test) checkIdentical(nPairs(x=test), testCheckNames) checkIdentical(nPairs(x=test, names=FALSE), testCheck) checkIdentical(nPairs(x=as.matrix(test)), testCheckNames) checkIdentical(nPairs(x=as.matrix(test), names=FALSE), testCheck) testCheck <- cbind(testCheckNames, as.integer(c(5, 4, 0, 0))) class(testCheck) <- class(testCheckNames) colnames(testCheck) <- c(colnames(test), "all") checkIdentical(nPairs(x=test, margin=TRUE), testCheck) testCheckSumm <- matrix(data=as.integer(c(0, 1, 4, 2, 0, 0, 4, 2, 0, 1, 0, 0, 0, 1, 2, 0)), nrow=4, ncol=4, byrow=TRUE) dimnames(testCheckSumm) <- dimnames(testCheckNames) tmp <- summary(nPairs(x=test)) checkEquals(tmp, testCheckSumm) } gdata/tests/unitTests/runit.getDateTimeParts.R0000644000176200001440000000327614441446535021211 0ustar liggesusers## Test setup if(FALSE) { library("RUnit") library("gdata") } num <- 1 cha <- "a" fac <- factor("A") tYear <- as.character(c(2006, 1995, 1005, 3067)) tMonth <- c("01", "04", "06", "12") tDay <- c("01", "12", "22", "04") tDate <- paste(paste(tYear, tMonth, tDay, sep="-"), "GMT") tHour <- c("05", "16", "20", "03") tMin <- c("16", "40", "06", "52") tSec <- c("56", "34", "05", "15") tTime <- paste(tHour, tMin, tSec, sep=":") cDate <- as.Date(tDate) cDatePOSIXct <- as.POSIXct(tDate) cDatePOSIXlt <- as.POSIXlt(tDate) test.getYear <- function() { checkException(getYear(x=num)) checkException(getYear(x=cha)) checkException(getYear(x=fac)) checkIdentical(getYear(x=cDate), tYear) checkIdentical(getYear(x=cDatePOSIXct), tYear) checkIdentical(getYear(x=cDatePOSIXlt), tYear) } test.getMonth <- function() { checkException(getMonth(x=num)) checkException(getMonth(x=cha)) checkException(getMonth(x=fac)) checkIdentical(getMonth(x=cDate), tMonth) checkIdentical(getMonth(x=cDatePOSIXct), tMonth) checkIdentical(getMonth(x=cDatePOSIXlt), tMonth) } test.getDay <- function() { checkException(getDay(x=num)) checkException(getDay(x=cha)) checkException(getDay(x=fac)) checkIdentical(getDay(x=cDate), tDay) checkIdentical(getDay(x=cDatePOSIXct), tDay) checkIdentical(getDay(x=cDatePOSIXlt), tDay) } test.getHour <- function() { checkException(getHour(x=num)) checkException(getHour(x=cha)) checkException(getHour(x=fac)) } test.getMin <- function() { checkException(getMin(x=num)) checkException(getMin(x=cha)) checkException(getMin(x=fac)) } test.getSec <- function() { checkException(getSec(x=num)) checkException(getSec(x=cha)) checkException(getSec(x=fac)) } gdata/tests/test.humanReadable.R0000644000176200001440000001064514510771613016340 0ustar liggesuserslibrary(gdata) options(humanReadable=FALSE) set.seed(123456) baseSI <- 10 powerSI <- seq(from=0, to=27, by=3) SI0 <- (baseSI)^powerSI k <- length(SI0) - 1 SI1 <- SI0 - SI0 / c(2, runif(n=k, min=1.01, max=5.99)) SI2 <- SI0 + SI0 / c(2, runif(n=k, min=1.01, max=5.99)) baseIEC <- 2 powerIEC <- seq(from=0, to=90, by=10) IEC0 <- (baseIEC)^powerIEC IEC1 <- IEC0 - IEC0 / c(2, runif(n=k, min=1.01, max=5.99)) IEC2 <- IEC0 + IEC0 / c(2, runif(n=k, min=1.01, max=5.99)) # Auto units, specify width cbind(humanReadable(x=SI2, standard="SI", width=7), humanReadable(x=SI2, standard="SI", width=5), humanReadable(x=SI2, standard="SI", width=3), humanReadable(x=IEC2, standard="IEC", width=7), humanReadable(x=IEC2, standard="IEC", width=5), humanReadable(x=IEC2, standard="IEC", width=3), humanReadable(x=IEC2, standard="Unix", width=7), humanReadable(x=IEC2, standard="Unix", width=5), humanReadable(x=IEC2, standard="Unix", width=3)) # Auto units, specify digits cbind(humanReadable(x=SI2, standard="SI", width=NULL, digits=7), humanReadable(x=SI2, standard="SI", width=NULL, digits=3), humanReadable(x=SI2, standard="SI", width=NULL, digits=2), humanReadable(x=SI2, standard="SI", width=NULL, digits=1), humanReadable(x=IEC2, standard="IEC", width=NULL, digits=7), humanReadable(x=IEC2, standard="IEC", width=NULL, digits=3), humanReadable(x=IEC2, standard="IEC", width=NULL, digits=2), humanReadable(x=IEC2, standard="IEC", width=NULL, digits=1), humanReadable(x=IEC2, standard="Unix", width=NULL, digits=7), humanReadable(x=IEC2, standard="Unix", width=NULL, digits=3), humanReadable(x=IEC2, standard="Unix", width=NULL, digits=2), humanReadable(x=IEC2, standard="Unix", width=NULL, digits=1)) # Single unit, specify width cbind(humanReadable(x=SI1, units="GB", standard="SI", width=7), humanReadable(x=SI1, units="GB", standard="SI", width=5), humanReadable(x=SI1, units="GB", standard="SI", width=3), humanReadable(x=IEC1, units="GiB", standard="IEC", width=7), humanReadable(x=IEC1, units="GiB", standard="IEC", width=5), humanReadable(x=IEC1, units="GiB", standard="IEC", width=3), humanReadable(x=IEC1, units="G", standard="Unix", width=7), humanReadable(x=IEC1, units="G", standard="Unix", width=5), humanReadable(x=IEC1, units="G", standard="Unix", width=3)) # Single unit, specify digits cbind(humanReadable(x=SI1, units="GB", standard="SI", width=NULL, digits=7), humanReadable(x=SI1, units="GB", standard="SI", width=NULL, digits=3), humanReadable(x=SI1, units="GB", standard="SI", width=NULL, digits=2), humanReadable(x=SI1, units="GB", standard="SI", width=NULL, digits=1), humanReadable(x=IEC1, units="GiB", standard="IEC", width=NULL, digits=7), humanReadable(x=IEC1, units="GiB", standard="IEC", width=NULL, digits=3), humanReadable(x=IEC1, units="GiB", standard="IEC", width=NULL, digits=2), humanReadable(x=IEC1, units="GiB", standard="IEC", width=NULL, digits=1), humanReadable(x=IEC1, units="G", standard="Unix", width=NULL, digits=7), humanReadable(x=IEC1, units="G", standard="Unix", width=NULL, digits=3), humanReadable(x=IEC1, units="G", standard="Unix", width=NULL, digits=2), humanReadable(x=IEC1, units="G", standard="Unix", width=NULL, digits=1)) stopifnot(is.object_sizes(as.object_sizes(2^(1:30)))) stopifnot(format(as.object_sizes(124)) == "124 bytes") stopifnot(format(as.object_sizes(124e8), units="auto") == "11.5 GiB") stopifnot(format(as.object_sizes(124e8), humanReadable=TRUE) == "11.5 GiB") stopifnot(format(as.object_sizes(124e8), units="bytes") == "1.24e+10 bytes") tools::assertError(as.object_sizes(-1)) tools::assertError(as.object_sizes("a")) tools::assertError(as.object_sizes(list())) tools::assertError(as.object_sizes(NULL)) tools::assertError(as.object_sizes(0+1i)) stopifnot(format(as.object_sizes(1e40)) == "1e+40 bytes") stopifnot(format(as.object_sizes(1e40), units="auto") == "8.271806e+15 YiB") stopifnot(format(as.object_sizes(1e40), units="bytes") == "1e+40 bytes") stopifnot(format(as.object_sizes(1e40), humanReadable=TRUE) == "8.271806e+15 YiB") stopifnot(format(as.object_sizes(1e40), humanReadable=FALSE) == "1e+40 bytes") options(humanReadable=TRUE) stopifnot(format(as.object_sizes(1e40)) == "8.271806e+15 YiB") options(humanReadable=FALSE) gdata/tests/runRUnitTests.R0000644000176200001440000000550314441446535015445 0ustar liggesusers## The setup seems to be quite messy, but it is so to enable use of this in ## several ways as shown below. ## 1. "R CMD check" should be the most authoritative way to run the RUnit ## tests for a developer. RUnit tests are issued during R CMD check of the ## package due to example section of .runRUnitTests() function. If any test ## fails or if there are any R errors during RUnit testing, R CMD check fails. ## These are variable values specific for this way: ## - .path DEVEL/PATH/PKG.Rcheck/PKG/unitTests ## - .way function ## 2. Running ".runRUnitTests()" from within R after library(PKG) is handy for ## package useRs, since it enables useRs to be sure that all tests pass for ## their installation. This is just a convenient wrapper function to run ## the RUnit testing suite. These are variable values specific for this ## way: ## - .path INSTALL/PATH/PKG/unitTests ## - .way function ## 3. The "Shell" is another possibility, mainly for a developer in order to ## skip possibly lengthy R CMD check and perform just RUnit testing with an ## installed version of a pcakage. These are variable values specific for ## this way: ## - .path DEVEL/PATH/PKG/inst/unitTests ## - .way shell ## ## Rscript runRUnitTests.R ## R CMD BATCH runRUnitTests.R ## make ## make all PKG <- "gdata" if(require("RUnit", quietly=TRUE)) { path <- normalizePath("unitTests") cat("\nRunning unit tests\n") print(list(pkg=PKG, getwd=getwd(), pathToUnitTests=path)) library(package=PKG, character.only=TRUE) testFileRegexp <- "^runit.+\\.[rR]$" ## Debugging echo cat("\nRunning RUnit tests\n") print(list(pkg=PKG, getwd=getwd(), pathToRUnitTests=path)) ## Define tests testSuite <- defineTestSuite(name=paste(PKG, "RUnit testing"), dirs=path, testFileRegexp=testFileRegexp) ## Run tests <- runTestSuite(testSuite) if(file.access(path, 02) != 0) { ## Cannot write to path -> use writable one tdir <- tempfile(paste(PKG, "RUnitTests", sep="_")) dir.create(tdir) pathReport <- file.path(tdir, "report") } else { pathReport <- file.path(path, "report") } ## Print results: printTextProtocol(tests) printTextProtocol(tests, fileName=paste0(pathReport, ".txt")) ## Print HTML Version of results: printHTMLProtocol(tests, fileName=paste0(pathReport, ".html")) cat("\nRUnit reports also written to\n", pathReport, ".(txt|html)\n\n", sep="") ## Return stop() to cause R CMD check stop in case of ## - failures i.e. FALSE to RUnit tests or ## - errors i.e. R errors tmp <- getErrors(tests) if(tmp$nFail > 0 || tmp$nErr > 0) { stop("\n\nRUnit testing failed:\n", " - #test failures: ", tmp$nFail, "\n", " - #R errors: ", tmp$nErr, "\n\n") } } else { cat("R package 'RUnit' cannot be loaded - no unit tests run\n", "for package", PKG, "\n") } gdata/tests/tests.write.fwf.R0000644000176200001440000000333714441446535015713 0ustar liggesuserslibrary(gdata) ## Test data num <- round(c(733070.345678, 1214213.78765456, 553823.798765678, 1085022.8876545678, 571063.88765456, 606718.3876545678, 1053686.6, 971024.187656, 631193.398765456, 879431.1), digits=3) testData <- data.frame(num1=c(1:10, NA), num2=c(NA, seq(from=1, to=5.5, by=0.5)), num3=c(NA, num), int1=c(as.integer(1:4), NA, as.integer(4:9)), fac1=factor(c(NA, letters[1:9], "hjh")), fac2=factor(c(letters[6:15], NA)), cha1=c(letters[17:26], NA), cha2=c(NA, "longer", letters[25:17]), stringsAsFactors=FALSE) levels(testData$fac1) <- c(levels(testData$fac1), "unusedLevel") testData$Date <- as.Date("1900-1-1") testData$Date[2] <- NA testData$POSIXt <- as.POSIXct(strptime("1900-1-1 01:01:01", format="%Y-%m-%d %H:%M:%S")) testData$POSIXt[5] <- NA ## Tests ## Default write.fwf(testData) ## NA should be - write.fwf(x=testData, na="-") ## NA should be -NA- write.fwf(x=testData, na="-NA-") ## Some other separator than space write.fwf(testData[, 1:4], sep="-mySep-") ## Justify right for character columns write.fwf(testData, justify="right") ## Justify right for character columns, track na values write.fwf(testData, justify="right", na="!") ## With quotes write.fwf(testData, quote=TRUE) ## With rownames write.fwf(testData, rownames=TRUE) ## Without colnames write.fwf(testData, colnames=FALSE) ## Without colnames, with rownames write.fwf(testData, colnames=FALSE, rownames=TRUE) ## With rownames and colnames and rowCol write.fwf(testData, rownames=TRUE, rowCol="HI!") gdata/vignettes/0000755000176200001440000000000014511013460013335 5ustar liggesusersgdata/vignettes/mapLevels.Rnw0000644000176200001440000002024214441446535015774 0ustar liggesusers%\VignetteIndexEntry{Mapping levels of a factor} %\VignettePackage{gdata} %\VignetteKeywords{levels, factor, manip} \documentclass[a4paper]{report} \usepackage{Rnews} \usepackage[round]{natbib} \bibliographystyle{abbrvnat} \usepackage{Sweave} \SweaveOpts{strip.white=all, keep.source=TRUE} \SweaveOpts{concordance=TRUE} \begin{document} \SweaveOpts{concordance=TRUE} \begin{article} \title{Mapping levels of a factor} \subtitle{The \pkg{gdata} package} \author{by Gregor Gorjanc} \maketitle \section{Introduction} Factors use levels attribute to store information on mapping between internal integer codes and character values i.e. levels. First level is mapped to internal integer code 1 and so on. Although some users do not like factors, their use is more efficient in terms of storage than for character vectors. Additionally, there are many functions in base \R{} that provide additional value for factors. Sometimes users need to work with internal integer codes and mapping them back to factor, especially when interfacing external programs. Mapping information is also of interest if there are many factors that should have the same set of levels. This note describes \code{mapLevels} function, which is an utility function for mapping the levels of a factor in \pkg{gdata} \footnote{from version 2.3.1} package \citep{WarnesGdata}. \section{Description with examples} Function \code{mapLevels()} is an (S3) generic function and works on \code{factor} and \code{character} atomic classes. It also works on \code{list} and \code{data.frame} objects with previously mentioned atomic classes. Function \code{mapLevels} produces a so called ``map'' with names and values. Names are levels, while values can be internal integer codes or (possibly other) levels. This will be clarified later on. Class of this ``map'' is \code{levelsMap}, if \code{x} in \code{mapLevels()} was atomic or \code{listLevelsMap} otherwise - for \code{list} and \code{data.frame} classes. The following example shows the creation and printout of such a ``map''. <>= library(gdata) (fac <- factor(c("B", "A", "Z", "D"))) (map <- mapLevels(x=fac)) @ If we have to work with internal integer codes, we can transform factor to integer and still get ``back the original factor'' with ``map'' used as argument in \code{mapLevels<-} function as shown bellow. \code{mapLevels<-} is also an (S3) generic function and works on same classes as \code{mapLevels} plus \code{integer} atomic class. <>= (int <- as.integer(fac)) mapLevels(x=int) <- map int identical(fac, int) @ Internally ``map'' (\code{levelsMap} class) is a \code{list} (see bellow), but its print method unlists it for ease of inspection. ``Map'' from example has all components of length 1. This is not mandatory as \code{mapLevels<-} function is only a wrapper around workhorse function \code{levels<-} and the later can accept \code{list} with components of various lengths. <>= str(map) @ Although not of primary importance, this ``map'' can also be used to remap factor levels as shown bellow. Components ``later'' in the map take over the ``previous'' ones. Since this is not optimal I would rather recommend other approaches for ``remapping'' the levels of a \code{factor}, say \code{recode} in \pkg{car} package \citep{FoxCar}. <>= map[[2]] <- as.integer(c(1, 2)) map int <- as.integer(fac) mapLevels(x=int) <- map int @ Up to now examples showed ``map'' with internal integer codes for values and levels for names. I call this integer ``map''. On the other hand character ``map'' uses levels for values and (possibly other) levels for names. This feature is a bit odd at first sight, but can be used to easily unify levels and internal integer codes across several factors. Imagine you have a factor that is for some reason split into two factors \code{f1} and \code{f2} and that each factor does not have all levels. This is not uncommon situation. <>= (f1 <- factor(c("A", "D", "C"))) (f2 <- factor(c("B", "D", "C"))) @ If we work with this factors, we need to be careful as they do not have the same set of levels. This can be solved with appropriately specifying \code{levels} argument in creation of factors i.e. \code{levels=c("A", "B", "C", "D")} or with proper use of \code{levels<-} function. I say proper as it is very tempting to use: <>= fTest <- f1 levels(fTest) <- c("A", "B", "C", "D") fTest @ Above example extends set of levels, but also changes level of 2nd and 3rd element in \code{fTest}! Proper use of \code{levels<-} (as shown in \code{levels} help page) would be: <>= fTest <- f1 levels(fTest) <- list(A="A", B="B", C="C", D="D") fTest @ Function \code{mapLevels} with character ``map'' can help us in such scenarios to unify levels and internal integer codes across several factors. Again the workhorse under this process is \code{levels<-} function from base \R{}! Function \code{mapLevels<-} just controls the assignment of (integer or character) ``map'' to \code{x}. Levels in \code{x} that match ``map'' values (internal integer codes or levels) are changed to ``map'' names (possibly other levels) as shown in \code{levels} help page. Levels that do not match are converted to \code{NA}. Integer ``map'' can be applied to \code{integer} or \code{factor}, while character ``map'' can be applied to \code{character} or \code{factor}. Result of \code{mapLevels<-} is always a \code{factor} with possibly ``remapped'' levels. To get one joint character ``map'' for several factors, we need to put factors in a \code{list} or \code{data.frame} and use arguments \code{codes=FALSE} and \code{combine=TRUE}. Such map can then be used to unify levels and internal integer codes. <>= (bigMap <- mapLevels(x=list(f1, f2), codes=FALSE, combine=TRUE)) mapLevels(f1) <- bigMap mapLevels(f2) <- bigMap f1 f2 cbind(as.character(f1), as.integer(f1), as.character(f2), as.integer(f2)) @ If we do not specify \code{combine=TRUE} (which is the default behaviour) and \code{x} is a \code{list} or \code{data.frame}, \code{mapLevels} returns ``map'' of class \code{listLevelsMap}. This is internally a \code{list} of ``maps'' (\code{levelsMap} objects). Both \code{listLevelsMap} and \code{levelsMap} objects can be passed to \code{mapLevels<-} for \code{list}/\code{data.frame}. Recycling occurs when length of \code{listLevelsMap} is not the same as number of components/columns of a \code{list}/\code{data.frame}. Additional convenience methods are also implemented to ease the work with ``maps'': \begin{itemize} \item \code{is.levelsMap}, \code{is.listLevelsMap}, \code{as.levelsMap} and \code{as.listLevelsMap} for testing and coercion of user defined ``maps'', \item \code{"["} for subsetting, \item \code{c} for combining \code{levelsMap} or \code{listLevelsMap} objects; argument \code{recursive=TRUE} can be used to coerce \code{listLevelsMap} to \code{levelsMap}, for example \code{c(llm1, llm2, recursive=TRUE)} and \item \code{unique} and \code{sort} for \code{levelsMap}. \end{itemize} \section{Summary} Functions \code{mapLevels} and \code{mapLevels<-} can help users to map internal integer codes to factor levels and unify levels as well as internal integer codes among several factors. I welcome any comments or suggestions. % \bibliography{refs} \begin{thebibliography}{1} \providecommand{\natexlab}[1]{#1} \providecommand{\url}[1]{\texttt{#1}} \expandafter\ifx\csname urlstyle\endcsname\relax \providecommand{\doi}[1]{doi: #1}\else \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi \bibitem[Fox(2006)]{FoxCar} J.~Fox. \newblock \emph{car: Companion to Applied Regression}, 2006. \newblock URL \url{http://socserv.socsci.mcmaster.ca/jfox/}. \newblock R package version 1.1-1. \bibitem[Warnes(2006)]{WarnesGdata} G.~R. Warnes. \newblock \emph{gdata: Various R programming tools for data manipulation}, 2006. \newblock URL \url{http://cran.r-project.org/src/contrib/Descriptions/gdata.html}. \newblock R package version 2.3.1. Includes R source code and/or documentation contributed by Ben Bolker, Gregor Gorjanc and Thomas Lumley. \end{thebibliography} \address{Gregor Gorjanc\\ University of Ljubljana, Slovenia\\ \email{gregor.gorjanc@bfro.uni-lj.si}} \end{article} \end{document} gdata/vignettes/unknown.Rnw0000644000176200001440000002342314441446535015547 0ustar liggesusers %\VignetteIndexEntry{Working with Unknown Values} %\VignettePackage{gdata} %\VignetteKeywords{unknown, missing, manip} \documentclass[a4paper]{report} \usepackage{Rnews} \usepackage[round]{natbib} \bibliographystyle{abbrvnat} \usepackage{Sweave} \SweaveOpts{strip.white=all, keep.source=TRUE} \SweaveOpts{concordance=TRUE} \begin{document} \begin{article} \title{Working with Unknown Values} \subtitle{The \pkg{gdata} package} \author{by Gregor Gorjanc} \maketitle This vignette has been published as \cite{Gorjanc}. \section{Introduction} Unknown or missing values can be represented in various ways. For example SAS uses \code{.}~(dot), while \R{} uses \code{NA}, which we can read as Not Available. When we import data into \R{}, say via \code{read.table} or its derivatives, conversion of blank fields to \code{NA} (according to \code{read.table} help) is done for \code{logical}, \code{integer}, \code{numeric} and \code{complex} classes. Additionally, the \code{na.strings} argument can be used to specify values that should also be converted to \code{NA}. Inversely, there is an argument \code{na} in \code{write.table} and its derivatives to define value that will replace \code{NA} in exported data. There are also other ways to import/export data into \R{} as described in the {\emph R Data Import/Export} manual \citep{RImportExportManual}. However, all approaches lack the possibility to define unknown value(s) for some particular column. It is possible that an unknown value in one column is a valid value in another column. For example, I have seen many datasets where values such as 0, -9, 999 and specific dates are used as column specific unknown values. This note describes a set of functions in package \pkg{gdata}\footnote{ package version 2.3.1} \citep{WarnesGdata}: \code{isUnknown}, \code{unknownToNA} and \code{NAToUnknown}, which can help with testing for unknown values and conversions between unknown values and \code{NA}. All three functions are generic (S3) and were tested (at the time of writing) to work with: \code{integer}, \code{numeric}, \code{character}, \code{factor}, \code{Date}, \code{POSIXct}, \code{POSIXlt}, \code{list}, \code{data.frame} and \code{matrix} classes. \section{Description with examples} The following examples show simple usage of these functions on \code{numeric} and \code{factor} classes, where value \code{0} (beside \code{NA}) should be treated as an unknown value: <>= library("gdata") xNum <- c(0, 6, 0, 7, 8, 9, NA) isUnknown(x=xNum) @ The default unknown value in \code{isUnknown} is \code{NA}, which means that output is the same as \code{is.na} --- at least for atomic classes. However, we can pass the argument \code{unknown} to define which values should be treated as unknown: <>= isUnknown(x=xNum, unknown=0) @ This skipped \code{NA}, but we can get the expected answer after appropriately adding \code{NA} into the argument \code{unknown}: <>= isUnknown(x=xNum, unknown=c(0, NA)) @ Now, we can change all unknown values to \code{NA} with \code{unknownToNA}. There is clearly no need to add \code{NA} here. This step is very handy after importing data from an external source, where many different unknown values might be used. Argument \code{warning=TRUE} can be used, if there is a need to be warned about ``original'' \code{NA}s: <>= (xNum2 <- unknownToNA(x=xNum, unknown=0)) @ Prior to export from \R{}, we might want to change unknown values (\code{NA} in \R{}) to some other value. Function \code{NAToUnknown} can be used for this: <>= NAToUnknown(x=xNum2, unknown=999) @ Converting \code{NA} to a value that already exists in \code{x} issues an error, but \code{force=TRUE} can be used to overcome this if needed. But be warned that there is no way back from this step: <>= NAToUnknown(x=xNum2, unknown=7, force=TRUE) @ Examples below show all peculiarities with class \code{factor}. \code{unknownToNA} removes \code{unknown} value from levels and inversely \code{NAToUnknown} adds it with a warning. Additionally, \code{"NA"} is properly distinguished from \code{NA}. It can also be seen that the argument \code{unknown} in functions \code{isUnknown} and \code{unknownToNA} need not match the class of \code{x} (otherwise factor should be used) as the test is internally done with \code{\%in\%}, which nicely resolves coercing issues. <>= (xFac <- factor(c(0, "BA", "RA", "BA", NA, "NA"))) isUnknown(x=xFac) isUnknown(x=xFac, unknown=0) isUnknown(x=xFac, unknown=c(0, NA)) isUnknown(x=xFac, unknown=c(0, "NA")) isUnknown(x=xFac, unknown=c(0, "NA", NA)) (xFac <- unknownToNA(x=xFac, unknown=0)) (xFac <- NAToUnknown(x=xFac, unknown=0)) @ These two examples with classes \code{numeric} and \code{factor} are fairly simple and we could get the same results with one or two lines of \R{} code. The real benefit of the set of functions presented here is in \code{list} and \code{data.frame} methods, where \code{data.frame} methods are merely wrappers for \code{list} methods. We need additional flexibility for \code{list}/\code{data.frame} methods, due to possibly having multiple unknown values that can be different among \code{list} components or \code{data.frame} columns. For these two methods, the argument \code{unknown} can be either a \code{vector} or \code{list}, both possibly named. Of course, greater flexibility (defining multiple unknown values per component/column) can be achieved with a \code{list}. When a \code{vector}/\code{list} object passed to the argument \code{unknown} is not named, the first value/component of a \code{vector}/\code{list} matches the first component/column of a \code{list}/\code{data.frame}. This can be quite error prone, especially with \code{vectors}. Therefore, I encourage the use of a \code{list}. In case \code{vector}/\code{list} passed to argument \code{unknown} is named, names are matched to names of \code{list} or \code{data.frame}. If lengths of \code{unknown} and \code{list} or \code{data.frame} do not match, recycling occurs. The example below illustrates the application of the described functions to a list which is composed of previously defined and modified numeric (\code{xNum}) and factor (\code{xFac}) classes. First, function \code{isUnknown} is used with \code{0} as an unknown value. Note that we get \code{FALSE} for \code{NA}s as has been the case in the first example. <>= (xList <- list(a=xNum, b=xFac)) isUnknown(x=xList, unknown=0) @ We need to add \code{NA} as an unknown value. However, we do not get the expected result this way! <>= isUnknown(x=xList, unknown=c(0, NA)) @ This is due to matching of values in the argument \code{unknown} and components in a \code{list}; i.e., \code{0} is used for component \code{a} and \code{NA} for component \code{b}. Therefore, it is less error prone and more flexible to pass a \code{list} (preferably a named list) to the argument \code{unknown}, as shown below. <>= (xList1 <- unknownToNA(x=xList, unknown=list(b=c(0, "NA"), a=0))) @ Changing \code{NA}s to some other value (only one per component/column) can be accomplished as follows: <>= NAToUnknown(x=xList1, unknown=list(b="no", a=0)) @ A named component \code{.default} of a \code{list} passed to argument \code{unknown} has a special meaning as it will match a component/column with that name and any other not defined in \code{unknown}. As such it is very useful if the number of components/columns with the same unknown value(s) is large. Consider a wide \code{data.frame} named \code{df}. Now \code{.default} can be used to define unknown value for several columns: <>= df <- data.frame(col1=c(0, 1, 999, 2), col2=c("a", "b", "c", "unknown"), col3=c(0, 1, 2, 3), col4=c(0, 1, 2, 2)) @ <>= tmp <- list(.default=0, col1=999, col2="unknown") (df2 <- unknownToNA(x=df, unknown=tmp)) @ If there is a need to work only on some components/columns you can of course ``skip'' columns with standard \R{} mechanisms, i.e., by subsetting \code{list} or \code{data.frame} objects: <>= df2 <- df cols <- c("col1", "col2") tmp <- list(col1=999, col2="unknown") df2[, cols] <- unknownToNA(x=df[, cols], unknown=tmp) df2 @ \section{Summary} Functions \code{isUnknown}, \code{unknownToNA} and \code{NAToUnknown} provide a useful interface to work with various representations of unknown/missing values. Their use is meant primarily for shaping the data after importing to or before exporting from \R{}. I welcome any comments or suggestions. % \bibliography{refs} \begin{thebibliography}{1} \providecommand{\natexlab}[1]{#1} \providecommand{\url}[1]{\texttt{#1}} \expandafter\ifx\csname urlstyle\endcsname\relax \providecommand{\doi}[1]{doi: #1}\else \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi \bibitem[Gorjanc(2007)]{Gorjanc} G.~Gorjanc. \newblock Working with unknown values: the gdata package. \newblock \emph{R News}, 7\penalty0 (1):\penalty0 24--26, 2007. \newblock URL \url{http://CRAN.R-project.org/doc/Rnews/Rnews_2007-1.pdf}. \bibitem[{R Development Core Team}(2006)]{RImportExportManual} {R Development Core Team}. \newblock \emph{R Data Import/Export}, 2006. \newblock URL \url{http://cran.r-project.org/manuals.html}. \newblock ISBN 3-900051-10-0. \bibitem[Warnes (2006)]{WarnesGdata} G.~R. Warnes. \newblock \emph{gdata: Various R programming tools for data manipulation}, 2006. \newblock URL \url{http://cran.r-project.org/src/contrib/Descriptions/gdata.html}. \newblock R package version 2.3.1. Includes R source code and/or documentation contributed by Ben Bolker, Gregor Gorjanc and Thomas Lumley. \end{thebibliography} \address{Gregor Gorjanc\\ University of Ljubljana, Slovenia\\ \email{gregor.gorjanc@bfro.uni-lj.si}} \end{article} \end{document} gdata/vignettes/Rnews.sty0000644000176200001440000001556414441446535015226 0ustar liggesusers%% %% This is file `Rnews.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% Rnews.dtx (with options: `package') %% %% IMPORTANT NOTICE: %% %% For the copyright see the source file. %% %% Any modified versions of this file must be renamed %% with new filenames distinct from Rnews.sty. %% %% For distribution of the original source see the terms %% for copying and modification in the file Rnews.dtx. %% %% This generated file may be distributed as long as the %% original source files, as listed above, are part of the %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) \def\fileversion{v0.3.6} \def\filename{Rnews} \def\filedate{2002/06/02} \def\docdate {2001/10/31} %% %% Package `Rnews' to use with LaTeX2e %% Copyright (C) 2001--2002 by the R Core Development Team %% Please report errors to KH or FL %% %% -*- LaTeX -*- \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{\filename}[\filedate\space\fileversion\space Rnews package] \typeout{Package: `\filename\space\fileversion \@spaces <\filedate>'} \typeout{English documentation as of <\docdate>} \RequirePackage{ifthen} \newboolean{Rnews@driver} \DeclareOption{driver}{\setboolean{Rnews@driver}{true}} \DeclareOption*{\PackageWarning{\filename}{Unknown option `\CurrentOption'}} \ProcessOptions\relax \ifthenelse{\boolean{Rnews@driver}}{}{ \RequirePackage{multicol,graphicx,color,fancyhdr,hyperref} \newcommand{\volume}[1]{\def\Rnews@volume{#1}} \newcommand{\volnumber}[1]{\def\Rnews@number{#1}} \renewcommand{\date}[1]{\def\Rnews@date{#1}} \setcounter{secnumdepth}{-1} \renewcommand{\author}[1]{\def\Rnews@author{#1}} \renewcommand{\title}[1]{\def\Rnews@title{#1}} \newcommand{\subtitle}[1]{\def\Rnews@subtitle{#1}} \newenvironment{article}{% \author{}\title{}\subtitle{}}{\end{multicols}} \renewcommand{\maketitle}{ \begin{multicols}{2}[\chapter{\Rnews@title}\refstepcounter{chapter}][3cm] \ifx\empty\Rnews@subtitle\else\noindent\textbf{\Rnews@subtitle} \par\nobreak\addvspace{\baselineskip}\fi \ifx\empty\Rnews@author\else\noindent\textit{\Rnews@author} \par\nobreak\addvspace{\baselineskip}\fi \@afterindentfalse\@nobreaktrue\@afterheading} \renewcommand\chapter{\secdef\Rnews@chapter\@schapter} \providecommand{\nohyphens}{% \hyphenpenalty=10000\exhyphenpenalty=10000\relax} \newcommand{\Rnews@chapter}{% \renewcommand{\@seccntformat}[1]{}% \@startsection{chapter}{0}{0mm}{% -2\baselineskip \@plus -\baselineskip \@minus -.2ex}{\p@}{% \normalfont\Huge\bfseries\raggedright}} \renewcommand*\l@chapter{\@dottedtocline{0}{0pt}{1em}} \def\@schapter#1{\section*#1} \renewenvironment{figure}[1][]{% \def\@captype{figure} \noindent \begin{minipage}{\columnwidth}}{% \end{minipage}\par\addvspace{\baselineskip}} \renewcommand{\theequation}{\@arabic\c@equation} \def\equation{% \let\refstepcounter\H@refstepcounter \H@equation \def\newname{\arabic{chapter}.\theequation}% \let\theHequation\newname% \hyper@makecurrent{equation}% \Hy@raisedlink{\hyper@anchorstart{\@currentHref}}% \let\refstepcounter\new@refstepcounter}% \def\endequation{\Hy@raisedlink{\hyper@anchorend}\H@endequation} \renewcommand{\thefigure}{\@arabic\c@figure} \renewcommand{\thetable}{\@arabic\c@table} \renewcommand{\contentsname}{Contents of this issue:} \renewcommand\tableofcontents{% \section*{\contentsname \@mkboth{% \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}% \@starttoc{toc}} \renewcommand{\titlepage}{% \noindent \rule{\textwidth}{1pt}\\[-.8\baselineskip] \rule{\textwidth}{.5pt} \begin{center} \includegraphics[height=2cm]{Rlogo}\hspace{7mm} \fontsize{2cm}{2cm}\selectfont News \end{center} The Newsletter of the R Project\hfill Volume \Rnews@volume/\Rnews@number, \Rnews@date\\[-.5\baselineskip] \rule{\textwidth}{.5pt}\\[-.8\baselineskip] \rule{\textwidth}{1pt} \vspace{1cm} \fancyhf{} \fancyhead[L]{Vol.~\Rnews@volume/\Rnews@number, \Rnews@date} \fancyhead[R]{\thepage} \fancyfoot[L]{R News} \fancyfoot[R]{ISSN 1609-3631} \thispagestyle{empty} \begin{bottombox} \begin{multicols}{2} \setcounter{tocdepth}{0} \tableofcontents \setcounter{tocdepth}{2} \end{multicols} \end{bottombox}} \setlength{\textheight}{250mm} \setlength{\topmargin}{-10mm} \setlength{\textwidth}{17cm} \setlength{\oddsidemargin}{-6mm} \setlength{\columnseprule}{.1pt} \setlength{\columnsep}{20pt} \RequirePackage{ae,mathpple} \RequirePackage[T1]{fontenc} \renewcommand{\rmdefault}{ppl} \renewcommand{\sfdefault}{aess} \renewcommand{\ttdefault}{aett} \definecolor{Red}{rgb}{0.7,0,0} \definecolor{Blue}{rgb}{0,0,0.8} \definecolor{hellgrau}{rgb}{0.55,0.55,0.55} \newcommand{\R}{R} \newcommand{\address}[1]{\addvspace{\baselineskip}\noindent\emph{#1}} \newcommand{\email}[1]{\href{mailto:#1}{\normalfont\texttt{#1}}} \newsavebox{\Rnews@box} \newlength{\Rnews@len} \newenvironment{bottombox}{% \begin{figure*}[b] \begin{center} \noindent \begin{lrbox}{\Rnews@box} \begin{minipage}{0.99\textwidth}}{% \end{minipage} \end{lrbox} \addtolength{\Rnews@len}{\fboxsep} \addtolength{\Rnews@len}{\fboxrule} \hspace*{-\Rnews@len}\fbox{\usebox{\Rnews@box}} \end{center} \end{figure*}} \RequirePackage{verbatim} \def\boxedverbatim{% \def\verbatim@processline{% {\setbox0=\hbox{\the\verbatim@line}% \hsize=\wd0 \the\verbatim@line\par}}% \@minipagetrue \@tempswatrue \setbox0=\vbox \bgroup\small\verbatim } \def\endboxedverbatim{% \endverbatim \unskip\setbox0=\lastbox \egroup \fbox{\box0} } \pagestyle{fancy} } % \ifthenelse{\boolean{Rnews@driver}} \newcommand\code{\bgroup\@codex} \def\@codex#1{{\normalfont\ttfamily\hyphenchar\font=-1 #1}\egroup} \newcommand{\kbd}[1]{{\normalfont\texttt{#1}}} \newcommand{\key}[1]{{\normalfont\texttt{\uppercase{#1}}}} \newcommand\samp{`\bgroup\@noligs\@sampx} \def\@sampx#1{{\normalfont\texttt{#1}}\egroup'} \newcommand{\var}[1]{{\normalfont\textsl{#1}}} \let\env=\code \newcommand{\file}[1]{{`\normalfont\textsf{#1}'}} \let\command=\code \let\option=\samp \newcommand{\dfn}[1]{{\normalfont\textsl{#1}}} \newcommand{\acronym}[1]{{\normalfont\textsc{\lowercase{#1}}}} \newcommand{\strong}[1]{{\normalfont\fontseries{b}\selectfont #1}} \let\pkg=\strong \RequirePackage{alltt} \newenvironment{example}{\begin{alltt}}{\end{alltt}} \newenvironment{smallexample}{\begin{alltt}\small}{\end{alltt}} \newenvironment{display}{\list{}{}\item\relax}{\endlist} \newenvironment{smallverbatim}{\small\verbatim}{\endverbatim} \providecommand{\operatorname}[1]{% \mathop{\operator@font#1}\nolimits} \renewcommand{\P}{% \mathop{\operator@font I\hspace{-1.5pt}P\hspace{.13pt}}} \newcommand{\E}{% \mathop{\operator@font I\hspace{-1.5pt}E\hspace{.13pt}}} \newcommand{\VAR}{\operatorname{var}} \newcommand{\COV}{\operatorname{cov}} \newcommand{\COR}{\operatorname{cor}} \RequirePackage{amsfonts} \endinput %% %% End of file `Rnews.sty'. gdata/NEWS0000644000176200001440000005215114510771615012044 0ustar liggesusersChanges in 3.0.0 (2023-10-09) ----------------------------- Other changes: - Removed installXLSXsupport(), read.xls(), sheetCount(), sheetNames(), xls2csv(), xls2tab(), xls2tsv(), xls2sep(), and xlsFormats(). See gdata 2.19.0 NEWS entry announcing their deprecation. - Added aliases n_obs(), object_size(), and starts_with(). Deprecated gdata::object.size(). Changes in 2.19.0 (2023-05-06) ------------------------------ New functions: - Added update.data.frame() to replace rows of a data frame. New features: - Added argument 'add.col.nums' to left() and right(). Other changes: - Improved ll() so it handles S4 objects. Also accepts unit="GB" (contributed by Michael Chirico) and unit="B", now case-insensitive. - Improved right() so it returns the rightmost columns of a matrix or data frame. - Renamed first two arguments of startsWith() to 'x' and 'prefix'. - Removed elem() - was deprecated in gregmisc/gdata 2.0.3 (2005-02-25). - Excel file support is now deprecated, to be removed in the near future. At the user level, the functions installXLSXsupport(), read.xls(), sheetCount(), sheetNames(), xls2csv(), xls2sep(), xls2tab(), xls2tsv(), and xlsFormats() now raise a warning about the functionality being deprecated. Excel file support was first introduced in gregmisc/gdata 1.11.0 back in 2004, but today we have packages such as openxlsx, readxl, XLConnect, and xlsx offering dedicated Excel file support with more features. When Excel file support will be removed from the gdata package, it will result in lighter package maintenance and no more Perl warnings on the user side. - Package maintainer is Arni Magnusson. Changes in 2.18.0.1 (2022-05-10) -------------------------------- Other changes: - Syntax improvements to pass CRAN checks, packaged by Brian Ripley. Changes in 2.18.0 (2017-06-05) ------------------------------ New functions: - Add update.list() function to replace named elements a list. - Add mv() function to rename an object. - Add first(), last(), first<-() and last<-() functions to extract or replace first or last vector/list elements. New features: - Add 'byrow' argument to lowerTriangle() and upperTriangle() functions. Other changes: - humanReadable() now properly handles a single value for the argument 'justify'. - Improve logging and error reporting for remove.vars(). - read.xls() now handles latin-1 files properly on MS Windows. - write.fwf() now properly handles matrix arguments. Changes in 2.17.0 (2015-07-02) ------------------------------ New features: - Add new argument 'byrow' to upperTriangle(), lowerTriangle(), upperTriangle<-(), and lowerTriangle<-() to specify by row rather than by column order. This makes it simpler to copy values between the lower and upper triangular areas, e.g. to construct a symmetric matrix. Other changes: - Add inline comments to tests to alert reviewers of expected diffs on systems lacking the libraries for read.xls() to support XLSX formatted files. Changes in 2.16.1 (2015-04-28) ----------------------------- Bug fixes: - mapLevels() no longer generates warnings about conversion of lists to vectors. Other changes: - Requirement for Perl version 5.10.0 or later is specified in the package DESCRITION. - first() and last() are now simply wrappers for calls to 'head(x, n=1)' and 'tail(x, n=1)', respectively. Changes in 2.16.0 (2015-04-25) ------------------------------ New features: - New functions first() and last() to return the first or last element of an object. - New functions left() and right() to return the leftmost or rightmost n (default to 6) columns of a matrix or data frame. - New 'scientific' argument to write.fwf(). Set 'scientific=FALSE' to prevent numeric columns from being displayed using scientific notification. - The 'standard' argument to humanReadable() now accepts three values, 'SI' for base 1000 ('MB'), 'IEC' for base 1024 ('MiB'), and 'Unix' for base 1024 and single-character units ('M') - object.size() now returns objects with S3 class 'object_sizes' (note the final 's') to avoid conflicts with methods in utils for class 'object_size' provided by package 'utils' which can only handle a scalar size. - New 'units' argument to humanReadable()--and hence to print.object_sizes() and format.object_sizes()--that permits specifying the unit to use for all values. Use 'bytes' to display all values with the unit 'bytes', use 'auto' (or leave it missing) to automatically select the best unit, and use a unit from the selected standard to use that unit (i.e. 'MiB'). - The default arguments to humanReadable() have changed. The defaults are now 'width=NULL' and 'digits=1', so that the default behavior is now to show digit after the decimal for all values. Bug fixes: - reorder.factor() was ignoring the argument 'X' unless 'FUN' was supplied, making it incompatible with the behavior of stats:::reorder.default(). This has been corrected, so that calling reorder on a factor with arguments 'X' and/or 'FUN' should now return the same results whether gdata is loaded or not. (Reported by Sam Hunter.) - write.fwf() now properly supports matrix objects, including matrix objects without column names. (Reported by Carl Witthoft.) Other changes: - Replaced deprecated PERL function POSIX::isdigit in xls2csv.pl (which is used by read.xls() ) with an equivalent regular expression. (Reported by both Charles Plessy, Gerrit-jan Schutten, and Paul Johnson. Charles also provided a patch to correct the issue.) - aggregate.table(), which has been defunct gdata 2.13.3 (2014-04-04) has now been completely removed. Changes in 2.14.0 (2014-08-27) ------------------------------ Bug Fixes: - read.xls() can now properly process XLSX files with up to 16385 columns (the maximum generated by Microsoft Excel). - read.xls() now properly handles XLS/XLSX files that use 1904-01-01 as the reference value for dates instead of 1900-01-01 (the default for MS-Excel files created on the Mac). Other changes: - Updated perl libraries and code underlying read.xls() to the latest version, including switching from Spreadsheet::XLSX to Spreadsheet::ParseXLSX. Changes in 2.13.3 (2014-04-04) ------------------------------ Bug Fixes: - Unit tests were incorrectly checking for equality of optional POSIXlt components. (Bug reported by Brian Ripley). Other Changes: - 'aggregate.table' is now defunct. See '?gdata-defunct' for details. - Unit tests and vignettes now follow R standard practice. - Minor changes to clean up R CMD check warnings. Changes in 2.13.2 (2013-06-28) ------------------------------ Enhancements: - Simplify ll() by converting a passed list to an environment, avoiding the need for special casing and the use of attach/detach. - Working of deprecation warning message in aggregate.table clarified. Changes in 2.13.1 (2013-03-24) ------------------------------ Enhancements: - Replaced calls to depreciated function ".path.package" with the new public function "path.package". Changes in 2.13.0 (2012-09-20) ----------------------------- New features: - New 'duplicated2' function which returns TRUE for *all* elements that are duplicated, including the first, contributed by Liviu Andronic. This differs from 'duplicated', which only returns the second and following (second-to last and previous when 'fromLast=TRUE') duplicate elements. - New 'ans' functon to return the value of the last evaluated top-level function (a convenience function for accessing .Last.value), contributed by Liviu Andonic. Bug Fixes: - On windows, warning messages printed to stdout by perl were being included in the return value from 'system', resulting in errors in 'sheetCount' and 'sheetNames'. Corrected. - The 'MedUnits' column names 'SIUnits' and 'ConventionalUnits' were reversed and misspelled. Changes in 2.12.0 (2012-09-12) ------------------------------ Other Changes: - 'stats::aggregate' was made into a generic on 27-Jan-2010, so that attempting to call 'aggregate' on a 'table' object will now incorrectly call 'aggregate.table'. Since 'aggregate.table' can be replaced by a call to tapply using two index vectors, e.g. aggregate.table(x, by1=a, by2=b, mean) can be replaced by tapply(x, INDEX=list(a, b), FUN=mean), the 'aggregate.table' function will now display a warning that it is depreciated and recommending the equivalent call to tapply. It will be removed entirely in a future version of gdata. Changes in 2.11.1 (2012-08-22) ------------------------------ Enhancements: - read.xls() now supports fileEncoding argument to allow non-ascii encoded data to be handled. See the manual page for an example. Bug Fixes: - The perl script utilized by read.xls() was incorrectly appending a space character at the end of each line, causing problems with character and NA entries in the final column. Changes in 2.11.0 (2012-06-18) ------------------------------ New Features: - read.xls() and supporting functions now allow blank lines to be preserved, rather than skipped, by supplying the argument "blank.lines.skip=FALSE". The underlying perl function has been extended to suppor this via an optional "-s" argument which, when present, *preserves* blank lines during the conversion. (The default behavior remains unchanged.) Other Changes: - Add SystemRequirements field specifying that perl is necessary for gdata to function fully. Changes in 2.10.6 (2012-06-12) ------------------------------ Bug fixes: - gdata::nobs.default() needs to handle logical vectors in addition to numeric vectors. Changes in 2.10.5 (2012-06-08) ------------------------------ Bug fixes: - Mark example for installXLSsupport() as dontrun so R CMD check won't fail on systems where PERL is not fully functional. - Correct name of installXLSsupport() in tests/test.read.xls.R. Other Changes: - Add dependency on R 2.13.0, since that is when stats::nobs appeared. Changes in 2.10.2 (2012-06-06) ------------------------------ Bug fixes: - Fix issues in nobs.default identified in testing with the gmodels package. Changes in 2.10.1 (2012-06-06) ------------------------------ Bug fixes: - Undo removal of 'nobs' and 'nobs.lm'. Instead define aliases for 'nobs' and 'nobs.lm' to support backward compatibility for packages depending on gdata. Changes in 2.10.0 (2012-06-05) ------------------------------ New features: - New ls.funs() function to list all objects of class function in the specified environment. - New startsWith() function to determine if a string "starts with" the specified characters. Enhancements: - Add 'na.strings' argument to read.xls() to convert Excel's '#DIV/0!' to NA. Bug fixes: - Correct various R CMD check warnings Other changes: - Base S3 method for nobs() and nobs.lm() method removed since these are now provided in the stats package. Changes in 2.9.0 (2011-09-30) ----------------------------- New features: - Add centerText() function to center text strings for a specified width. - Add case() function, a vectorized variant of the base::switch() function, which is useful for converting numeric codes into factors. Enhancements: - Minor improvements to xls2csv() man page. Changes in 2.8.1 (2011-04-15) ----------------------------- Enhancements: - nPairs() gains a summary method that shows how many times each variable is known, while the other variable of a pair is not Bug fixes: - Fix errors on windows when R or Perl install path includes spaces by properly quoting the path. Changes in 2.8.1 (2010-11-12) ----------------------------- Enhancements: - Minor improvement to Args(), read.xls() man page. Bug fixes: - Modify write.fwf() to capture and pass on additional arguments for write.table(). This resolves a bug reported by Jan Wijffels. - Modify xls2sep.R to avoid use of file.access() which is unreliable on Windows network shares. Changes in 2.8.0 (2010-04-03) ----------------------------- Enhancements: - When loaded, gdata (via an .onAttach() function) now checks: 1) if perl is available 2) whether the perl libraries for XLS support are available 3) whether the perl libraries for XLSX support are available If perl is not available, an appropriate warning message is displayed. If necessary perl libraries are not available, a warning message is displayed, as is a message suggesting the user run the (new) installXLSXsupport() function to attempt to install the necessary perl libraries. - The function installXLSXsupport() has been provided to install the binary perl modules that read.xls needs to support Excel 2007+ 'XLSX' files. Changes in 2.7.3 (2010-04-02) ----------------------------- Enhancements: - New xlsFormats() command to determine which Excel formats are supported (XLS, XLSX). Bug Fixes: - No longer attempt to install perl modules Compress::Raw::Zlib and Spreadsheet::XLSX at build/compile time. This should resolve recent build issues, particularly on Windows. - All perl code can now operate (but generate warnings) when perl modules Compress::Raw::Zlib and Spreadsheet::XLSX when are not installed. - Also update Greg's email address. Changes in 2.7.1 (2010-02-19) ----------------------------- Enhancements: - on Windows attempts to locate ActiveState perl if perl= not specified and Rtools perl would have otherwise been used in read.xls and other perl dependent functions. Changes in 2.7.0 (2010-01-25) ----------------------------- Bug Fixes: - Fix building of Perl libraries on Win32 Changes in 2.7.0 (2010-01-25) ----------------------------- Enhancements: - read.xls() now supports Excel 2007 'xlsx' files. - read.xls() now allows specification of worksheet by name - read.xls() now supports ftp URLs. - Improved ll() so user can limit output to specified classes New Functions: - sheetCount() and sheetNames() to determine the number and names of worksheets in an Excel file, respectively. Bug Fixes: - Fix formatting warning in frameApply(). - Resolve crash of "ll(.GlobalEnv)" Changes in 2.6.1 (2009-07-15) ----------------------------- Bug Fixes - Modify unit tests to avoid issues related to time zones. Changes in 2.6.0 (2009-07-15) ----------------------------- Bug Fixes - Correct minor typos & issues in man pages for write.fwf(), resample() (Greg Warnes) - Correct calculation of object sizes in env() and ll() (Gregor Gorjanc) New Features - Add support for using tab for field separator during translation from xls format in read.xls (Greg Warnes) - Enhanced function object.size that returns the size of multiple objects. There is also a handy print method that can print size of an object in "human readable" format when options(humanReadable=TRUE) or print(object.size(x), humanReadable=TRUE). (Gregor Gorjanc) - New function wideByFactor that reshapes given dataset by a given factor - it creates a "multivariate" data.frame. (Gregor Gorjanc) - New function nPairs that gives the number of variable pairs in a data.frame or a matrix. (Gregor Gorjanc) - New functions getYear, getMonth, getDay, getHour, getMin, and getSec for extracting the date/time parts from objects of a date/time class. (Gregor Gorjanc) - New function bindData that binds two data frames into a multivariate data frame in a different way than merge. (Gregor Gorjanc) Other Changes - Correct Greg's email address Changes in 2.5.0 (2008-12-31) ----------------------------- - New function .runRUnitTestsGdata that enables run of all RUnit tests during the R CMD check as well as directly from within R. - Enhanced function object.size that returns the size of multiple objects. There is also a handy print method that can print size of an object in "human readable" format when options(humanReadable=TRUE) or print(x, humanReadable=TRUE). - New function bindData that binds two data frames into a multivariate data frame in a different way than merge. - New function wideByFactor that reshapes given dataset by a given factor - it creates a "multivariate" data.frame. - New functions getYear, getMonth, getDay, getHour, getMin, and getSec for extracting the date/time parts from objects of a date/time class. - New function nPairs that gives the number of variable pairs in a data.frame or a matrix. - New function trimSum that sums trimmed values. - New function cbindX that can bind objects with different number of rows. - write.fwf gains the width argument. The value for unknown can increase or decrease the width of the columns. Additional tests and documentation fixes. Changes in 2.4.2 (2008-05-11) ----------------------------- - Enhancements and bug fixes for read.xls() and xls2csv(): - More informative log messages when verbose=TRUE - File paths containing spaces or other non-traditional characters are now properly handled - Better error messages, particularly when perl fails to generate an output .csv file. - The 'shortcut' character "~" (meaning user's home directory) is now properly handled in file paths. - XLS files created by OpenOffice are now properly handled. Thanks to Robert Burns for pointing out the patch (http://rt.cpan.org/Public/Bug/Display.html?id=7206) Changes in 2.4.1 (2008-03-24) ----------------------------- - Update perl libraries needed by xls2csv() and read.xls() to latest available versions on CRAN. - Add read.xls() to exported function list - Correct iris.xls example file. It didn't contain the complete & properly formatted iris data set. Fixed. - Fix typo in win32 example for read.xls() Changes in 2.4.0 (2008-01-30) ----------------------------- - The keep() function now includes an 'all' argument to specify how objects with names starting with '.' are handled. - keep() now shows an informative warning message when a requested object does not exist - New vignette "Mapping Levels of a Factor" describing the use of mapLevels(). - New vignette "Working with Unknown Values" describing the use of isUnknown() and unknownToNA(). - Several enhancements to read.xls() (thanks to Gabor Grothendieck): - New function xls2csv(), which handles converting an xls file to a csv file and returns a connection to the temporary csv file - xls2csv() and read.xls() both allow a file or a url to be specified - read.xls() has a new 'pattern' argument which, if supplied, will ignore everything prior to the first line in th csv file that matches the pattern. This is typically used if there are a variable number of comment lines prior to the header in which case one can specify one of the column headings as the pattern. read.xls should be compatible with the old read.xls. - Minor fixes to drop.levels(), is.what(). - Implementation of unit tests for most functions. Changes in 2.3.1 (2006-10-29) ----------------------------- - Arguments as well as their position of reorder.factor have been changed to conform with reorder.factor method in stats package, due to collision bug. Argument 'make.ordered' is now 'order' and old argument 'order' is now 'new.order'! Therefore, you have to implicitly specify new.order i.e. reorder(trt, new.order=c("PLACEBO", "300 MG", "600 MG", "1200 MG")) - trim() gains ... argument. - Added "unknown" methods for matrices. - Added c() method for factors based on mapLevels() functions. - Added write.fwf, which writes file in *F*ixed *W*idth *F*ormat. Changes in 2.3.0 (2006-09-19) ----------------------------- - Added mapLevels(), which produces a map with information on levels and/or internal integer codes. Contributed by Gregor Gorjanc. - Extended dropLevels() to work on the factors contained in a data frame, as well as individual factors. - Add unknown(), which changes given unknown value to NA and vice versa. Contributed by Gregor Gorjanc. - Extended trim() to handle a variety of data types data.frames, lists, factors, etc. Code changes contributed by Gregor Gorjanc. - Added resample() command that acts like sample() except that it _always_ samples from the arguments provided, even if only a single argument is present. This differs from sample() which behaves differently in this case. - Updated my email address. Changes in 2.1.2 (2012-10-29) ----------------------------- - Fixed bug in interleave.R - option to covert 1-column matrices to vector (based on Andrew Burgess's suggestion) - Updated Greg and Jim's email adresses - ll.R: Suppressed warning message in attach() call. - frameApply.Rd, reorder.Rd: Remove explicit loading of gtools in examples, so that failure to import functions from gtools gets properly caught by running the examples. - upperTriangle.R, man/upperTriangle.Rd: Add functions for extracting and modifying the upper and lower trianglular components of matrices. - is.what.R: Replaced the "not.using" vector with a more robust try(get(test)) to find out whether a particular is.* function returns a logical of length one. - DESCRIPTION: Added Suggests field - Updated the example in frameApply Changes in 2.0.8 (2005-06-02) ----------------------------- - Added DESCRIPTION and removed DESCRIPTION.in - Updated ll.Rd documentation - Fixed bug in Args.R, is.what.R, ll.R gdata/R/0000755000176200001440000000000014510771613011540 5ustar liggesusersgdata/R/startsWith.R0000644000176200001440000000036714510771613014045 0ustar liggesusersstartsWith <- function(x, prefix, trim=FALSE, ignore.case=FALSE) { if(trim) x <- trim(x) if(ignore.case) { x <- toupper(x) prefix <- toupper(prefix) } base::startsWith(x, prefix) } starts_with <- function(...) startsWith(...) gdata/R/ll.R0000644000176200001440000000552114510771613012275 0ustar liggesusersll <- function(pos=1, unit="KB", digits=0, dim=FALSE, sort=FALSE, class=NULL, invert=FALSE, ...) { get.object.class <- function(object.name, pos) { object <- get(object.name, pos=pos) class <- class(object)[1] class(object)[1] } get.object.dim <- function(object.name, pos) { object <- get(object.name, pos=pos) if(class(object)[1] == "function") dim <- "" else if(!is.null(dim(object))) dim <- paste(dim(object), collapse=" x ") else dim <- length(object) dim } get.object.size <- function(object.name, pos) { object <- get(object.name, pos=pos) size <- try(unclass(utils::object.size(object)), silent=TRUE) if(inherits(size, "try-error")) size <- 0 size } ## 1 Set unit, denominator, original.rank unit <- match.arg(toupper(substring(unit,1,1)), c("B","KB","MB","GB")) denominator <- switch(unit, "KB"=1024, "MB"=1024^2, "GB"=1024^3, 1) original.rank <- NULL ## 2 Detect what 'pos' is like, then get class, size, dim if(is.character(pos)) # pos is an environment name pos <- match(pos, search()) if(isS4(pos)) # pos is an S4 object pos <- sapply(slotNames(pos), slot, object=pos, simplify=FALSE) if(is.list(pos)) # pos is a list-like object { if(is.null(names(pos))) stop("All elements of a list must be named") original.rank <- rank(names(pos)) pos <- as.environment(pos) } if(length(ls(pos,...)) == 0) # pos is an empty environment { object.frame <- data.frame() } else if(environmentName(as.environment(pos)) == "Autoloads") { object.frame <- data.frame(rep("function",length(ls(pos,...))), rep(0,length(ls(pos,...))), row.names=ls(pos,...)) if(dim) { object.frame <- cbind(object.frame, rep("",nrow(object.frame))) names(object.frame) <- c("Class", unit, "Dim") } else names(object.frame) <- c("Class", unit) } else { class.vector <- sapply(ls(pos,...), get.object.class, pos=pos) size.vector <- sapply(ls(pos,...), get.object.size, pos=pos) size.vector <- round(size.vector/denominator, digits) object.frame <- data.frame(class.vector=class.vector, size.vector=size.vector, row.names=names(size.vector)) names(object.frame) <- c("Class", unit) if(dim) object.frame <- cbind(object.frame, Dim=sapply(ls(pos,...),get.object.dim,pos=pos)) } ## 3 Retain original order of list elements if(!sort && !is.null(original.rank)) object.frame <- object.frame[original.rank,] ## 4 Filter results given class if(!is.null(class)) { include <- object.frame$Class %in% class if(invert) include <- !include object.frame <- object.frame[include,] } object.frame } gdata/R/write.fwf.R0000644000176200001440000001434714510771613013607 0ustar liggesuserswrite.fwf <- function(x, file="", append=FALSE, quote=FALSE, sep=" ", na="", rownames=FALSE, colnames=TRUE, rowCol=NULL, justify="left", formatInfo=FALSE, quoteInfo=TRUE, width=NULL, eol="\n", qmethod=c("escape", "double"), scientific=TRUE, ...) { ## Setup dapply <- function(x, FUN, ..., simplify=TRUE) { if(is.data.frame(x)) return(sapply(x, FUN, ..., simplify=simplify)) else if(is.matrix(x)) return(apply(x, 2, FUN, ...)) else stop("x must be a data.frame or a matrix") } if(!(is.data.frame(x) || is.matrix(x))) stop("'x' must be a data.frame or matrix") if(length(na) > 1) stop("only single value can be defined for 'na'") if(!scientific) { option.scipen <- getOption("scipen") on.exit(function() options("scipen"=option.scipen)) options("scipen"=100) } if(rownames) { x <- as.data.frame(x) x <- cbind(rownames(x), x) rowColVal <- ifelse(!is.null(rowCol), rowCol, "row") colnames(x)[1] <- rowColVal } colnamesMy <- colnames(x) if(length(colnamesMy) == 0) colnamesMy <- paste0("V", 1:ncol(x)) nRow <- nrow(x) nCol <- length(colnamesMy) widthNULL <- is.null(width) if(!widthNULL && length(width) != nCol) { warning("recycling 'width'") widthOld <- width width <- integer(length=nCol) width[] <- widthOld } ## Format info retFormat <- data.frame(colname=colnamesMy, nlevels=0, position=0, width=0, digits=0, exp=0, stringsAsFactors=FALSE) ## Which columns are numeric like isNum <- dapply(x, is.numeric) ## is.numeric picks also Date and POSIXt isNum <- isNum & !(dapply(x, inherits, what="Date") | dapply(x, inherits, what="POSIXt")) ## Which columns are factors -> convert them to character isFac <- dapply(x, is.factor) if(any(isFac)) { ## This conditional is necessary because if x is a matrix, even if ## all(isFAC==FALSE), this assignment will coerce it to mode ## character. This isn't a problem for data frames. x[, isFac] <- sapply(x[, isFac, drop=FALSE], as.character) } ## Collect information about how format() will format columns. ## We need this info since format will turn all columns to character tmp <- dapply(x, format.info, ..., simplify=FALSE) if(is.matrix(x)) tmp <- as.data.frame(tmp) tmp1 <- sapply(tmp, length) tmp <- t(as.data.frame(tmp)) retFormat$width <- tmp[, 1] ## Collect other details for numeric columns if(any(isNum)) { ## Numeric columns with digits test <- tmp1 > 1 if(any(test)) { retFormat[test, c("digits", "exp")] <- tmp[test, c(2, 3)] ## Numeric columns with scientific notation test2 <- tmp[test, 3] > 0 if(any(test2)) # adding +1; see ?format.info retFormat[test, ][test2, "exp"] <- retFormat[test, ][test2, "exp"] + 1 } } ## Format ## Store original object in 'y' y <- x ## Formatting (to character) for(i in 1:nCol) { if(widthNULL) { tmp <- NULL } else { tmp <- width[i] } ## Due to na.encode bug in format() in 2.7.1; na.encode=TRUE should ## return NA values and not "NA", but even then we rely on the ## following test to "fiddle" with the value in 'na' argument since - ## NA should not increase the width of column with width 1, while wider ## value for 'na' should increase the width test <- is.na(y[, i]) ## Make a copy to make sure we get character after first format() ## Date class caused problems x2 <- character(length=nRow) ## Add formatted values x2[!test] <- format(y[!test, i], justify=justify, width=tmp, ...) ## Add 'na' value x2[test] <- na ## Replace the original x[, i] <- x2 ## Collect width (again) tmp2 <- format.info(x2, ...)[1] ## Reformat if 'na' value change the width of the column if(tmp2 != retFormat[i, "width"]) { retFormat[i, "width"] <- tmp2 ## ifelse() makes sure that numeric columns are justified to right x[, i] <- format(x[, i], justify=ifelse(isNum[i], "right", justify), width=tmp, ...) } ## Reformat 'na' value if it is narrower than the width of the column if(nchar(na) < retFormat[i, "width"]) { x[test, i] <- format(na, justify=ifelse(isNum[i], "right", justify), width=retFormat[i, "width"], ...) } } ## Number of levels for "non-numeric"" columns if(any(!isNum)) { retFormat[!isNum, "nlevels"] <- dapply(x[, !isNum, drop=FALSE], function(z) length(unique(z))) } ## Check that width was not to small if(!widthNULL) { test <- retFormat$width > width if(any(test)) { tmpCol <- paste(colnamesMy[test], collapse=", ") tmpWidth <- paste(width[test], collapse=", ") tmpNeed <- paste(retFormat$width[test], collapse=", ") stop(paste0("'width' (", tmpWidth, ") was too small for columns: ", tmpCol, "\n 'width' should be at least (", tmpNeed, ")")) } } ## Write if(colnames) { if(rownames && is.null(rowCol)) colnamesMy <- colnamesMy[-1] write.table(t(as.matrix(colnamesMy)), file=file, append=append, quote=quote, sep=sep, eol=eol, na=na, row.names=FALSE, col.names=FALSE, qmethod=qmethod) } write.table(x=x, file=file, append=(colnames || append), quote=quote, sep=sep, eol=eol, na=na, row.names=FALSE, col.names=FALSE, qmethod=qmethod) ## Return format and fixed width information if(formatInfo) { ## Be careful with these ifelse constructs retFormat$position[1] <- ifelse(quote, ifelse(quoteInfo, 1, 2), 1) if(ifelse(quote, quoteInfo, FALSE)) retFormat$width <- retFormat$width + 2 N <- nrow(retFormat) if(N > 1) { for(i in 2:N) { retFormat$position[i] <- retFormat$position[i - 1] + retFormat$width[i - 1] + nchar(x=sep, type="chars") + ifelse(quote, ifelse(quoteInfo, 0, 1), 0) } } if(rownames && is.null(rowCol)) { retFormat <- retFormat[-1,] rownames(retFormat) <- 1:(N-1) } return(retFormat) } } gdata/R/is.what.R0000644000176200001440000000133014441446535013242 0ustar liggesusersis.what <- function(object, verbose=FALSE) { do.test <- function(test, object) { result <- try(get(test)(object), silent=TRUE) if(length(result)!=1 || !is.logical(result) || is.na(result)) result <- NULL result } ## Get all names starting with "is." is.names <- unlist(sapply(search(), function(name) ls(name,pattern="^is\\."))) ## Narrow to functions is.functions <- is.names[sapply(is.names, function(x) is.function(get(x)))] tests <- sort(unique(is.functions[is.functions!="is.what"])) results <- suppressWarnings(unlist(sapply(tests, do.test, object=object))) if(verbose) output <- data.frame(is=ifelse(results,"T",".")) else output <- names(results)[results] output } gdata/R/combine.R0000644000176200001440000000101314441446535013277 0ustar liggesuserscombine <- function(..., names=NULL) { tmp <- list(...) if(is.null(names)) names <- names(tmp) if(is.null(names)) names <- sapply(as.list(match.call()), deparse)[-1] if(any(sapply(tmp, is.matrix) | sapply(tmp, is.data.frame))) { len <- sapply(tmp, function(x) c(dim(x),1)[1]) len[is.null(len)] <- 1 data <- rbind(...) } else { len <- sapply(tmp,length) data <- unlist(tmp) } namelist <- factor(rep(names, len), levels=names) return(data.frame(data, source=namelist)) } gdata/R/update.list.R0000644000176200001440000000052114441446535014122 0ustar liggesusersupdate.list <- function(object, new, unnamed=FALSE, ...) { retval <- object for(name in names(new)) retval[[name]] <- new[[name]] if(unnamed) { if(is.null(names(new))) names(new) <- rep("", length=length(new)) for(i in (1:length(new))[names(new)==""]) retval <- append(retval, new[[i]]) } retval } gdata/R/Args.R0000644000176200001440000000121114441446535012557 0ustar liggesusersArgs <- function(name, sort=FALSE) { a <- formals(get(as.character(substitute(name)), pos=1)) if(is.null(a)) return(NULL) arg.labels <- names(a) arg.values <- as.character(a) char <- sapply(a, is.character) arg.values[char] <- paste("\"", arg.values[char], "\"", sep="") if(sort) { ord <- order(arg.labels) if(any(arg.labels == "...")) ord <- c(ord[-which(arg.labels[ord]=="...")], which(arg.labels=="...")) arg.labels <- arg.labels[ord] arg.values <- arg.values[ord] } output <- data.frame(value=I(arg.values), row.names=arg.labels) print(output, right=FALSE) invisible(output) } gdata/R/wideByFactor.R0000644000176200001440000000203514441446535014252 0ustar liggesuserswideByFactor <- function(x, factor, common, sort=TRUE, keepFactor=TRUE) { ## Setup if(!is.data.frame(x)) stop("'x' must be a data frame") if(length(factor) != 1) stop("'factor' can be only of length one") if(!is.factor(x[[factor]])) stop("column defined in 'factor' must be a factor") if(sort) x <- x[order(x[[factor]]), ] ## Extend by factors levels y <- x[common] if(keepFactor) y[factor] <- x[factor] levs <- levels(x[[factor]]) ## Remove common and factor from the list of column names other <- names(x) other <- other[!(other %in% common) & !(other %in% factor)] ## Add all other columns but as a set for each level of a factor for(level in levs) { for(col in other) { ## Add a column col y[paste(col, level, sep=".")] <- x[col] ## Fill with NA for other levels than level y[x[factor] != level, paste(col, level, sep=".")] <- NA ## This filling might be inefficient if there is large number ## of levels, since there will be quite a lot of filling. } } y } gdata/R/object_size.R0000644000176200001440000000342014510771613014162 0ustar liggesusersobject_size <- function(...) { structure(sapply(list(...), utils::object.size), class=c("object_sizes", "numeric")) } print.object_sizes <- function(x, quote=FALSE, humanReadable=getOption("humanReadable"), standard="IEC", units, digits=1, width=NULL, sep=" ", justify = c("right", "left"), ...) { print(format(x, humanReadable=humanReadable, standard=standard, units=units, digits=digits, width=width, sep=sep, justify=justify), quote=quote, ...) invisible(x) } format.object_sizes <- function(x, humanReadable=getOption("humanReadable"), standard="IEC", units, digits=1, width=NULL, sep=" ", justify = c("right", "left"), ...) { if(!missing(units)) { if (units=="bytes") paste(x, "bytes") else humanReadable(x, standard=standard, units=units, digits=digits, width=width, sep=sep, justify=justify) } else if(is.null(humanReadable) || humanReadable==FALSE) { paste(x, "bytes") } else { humanReadable(x, standard=standard, units=units, digits=digits, width=width, sep=sep, justify=justify) } } is.object_sizes <- function(x) inherits(x, what="object_sizes") as.object_sizes <- function(x) { if(!is.numeric(x) || any(x<0)) stop("'x' must be a positive numeric vector") class(x) <- c("object_sizes", "numeric") x } c.object_sizes <- function(..., recursive=FALSE) { x <- NextMethod() if(is.numeric(x)) class(x) <- c("object_sizes", "numeric") x } object.size <- function(...) { .Deprecated(old="gdata::object.size", new="object_size() or utils::object.size()") object_size(...) } gdata/R/nobs.R0000644000176200001440000000111014510771613012615 0ustar liggesusers## Redefine here, so that the locally defined methods (particularly ## nobs.default) take precedence over the ones now defined in the ## stats package nobs <- function(object, ...) UseMethod("nobs") nobs.default <- function(object, ...) { if(is.numeric(object) || is.logical(object)) sum(!is.na(object)) else stats::nobs(object, ...) } nobs.data.frame <- function(object, ...) sapply(object, nobs.default) ## Now provided by 'stats' package, so provide alias to satisfy ## dependencies nobs.lm <- stats:::nobs.lm n_obs <- function(object, ...) nobs(object, ...) gdata/R/unknown.R0000644000176200001440000001254114441446535013372 0ustar liggesusersisUnknown <- function(x, unknown=NA, ...) UseMethod("isUnknown") isUnknown.default <- function(x, unknown=NA, ...) { if(is.list(unknown)) unknown <- unlist(unknown) ret <- x %in% unknown if(any(is.na(unknown))) ret <- ret | is.na(x) ret } isUnknown.POSIXlt <- function(x, unknown=NA, ...) { ## FIXME: codetools say ## isUnknown.POSIXlt: wrong number of arguments to as.character if(is.list(unknown) && !inherits(x=unknown, what="POSIXlt")) { unknown <- lapply(unknown, FUN=as.character, ...) } else { unknown <- as.character(x=unknown, ...) } if(is.list(x) && !inherits(x=x, what="POSIXlt")) { x <- lapply(x, FUN=as.character, ...) } else { x <- as.character(x=x, ...) } isUnknown.default(x=as.character(x), unknown=as.character(unknown)) } isUnknown.list <- function(x, unknown=NA, ...) { unknown <- .unknownList(x=x, unknown=unknown) x <- mapply(FUN="isUnknown", x=x, unknown=unknown, ..., SIMPLIFY=FALSE) x } isUnknown.data.frame <- function(x, unknown=NA, ...) { x[] <- isUnknown.list(x, unknown=unknown, ...) x } isUnknown.matrix <- function(x, unknown=NA, ...) apply(X=x, MARGIN=ifelse(ncol(x) > nrow(x), 1, 2), FUN=isUnknown, unknown=unknown) unknownToNA <- function(x, unknown, warning=FALSE, ...) UseMethod("unknownToNA") unknownToNA.default <- function(x, unknown, warning=FALSE, ...) { if(warning) { if(any(is.na(x))) warning("'x' already has NA") } is.na(x) <- isUnknown(x=x, unknown=unknown) x } unknownToNA.factor <- function(x, unknown, warning=FALSE, ...) { ## could put this func into default method, but I need unlisted unknown ## for levels handling if(warning) { if(any(is.na(x))) warning("'x' already has NA") } if(is.list(unknown)) unknown <- unlist(unknown) ## Levels handling - read help page on this levs <- levels(x) levs <- levs[!(levs %in% unknown)] factor(x, levels=levs) } unknownToNA.list <- function(x, unknown, warning=FALSE, ...) { unknown <- .unknownList(x=x, unknown=unknown) x <- mapply(FUN="unknownToNA", x=x, unknown=unknown, warning=warning, SIMPLIFY=FALSE) return(x) } unknownToNA.data.frame <- function(x, unknown, warning=FALSE, ...) { x[] <- unknownToNA.list(x=x, unknown=unknown, warning=warning) x } NAToUnknown <- function(x, unknown, force=FALSE, call.=FALSE, ...) UseMethod("NAToUnknown") NAToUnknown.default <- function(x, unknown, force=FALSE, call.=FALSE, ...) { if(length(as.character(unknown)) != 1) # as.character allows also POSIXlt stop("'unknown' must be a single value") if(any(isUnknown(x, unknown=unknown)) && !force) stop(sprintf("'x' already has value %s", dQuote(unknown))) classX <- class(x)[1] classUnk <- class(unknown)[1] if(classX != classUnk) { tmp <- c("integer", "numeric") if(!(classX %in% tmp && classUnk %in% tmp)) { warning(sprintf("'unknown' should be %s for %s 'x' - will try to coerce", dQuote(classX), dQuote(classX)), call.=call.) } unknown <- do.call(paste("as.", classX, sep=""), args=list(unknown)) } x[is.na(x)] <- unknown x } NAToUnknown.factor <- function(x, unknown, force=FALSE, call.=FALSE, ...) { if(length(unknown) != 1) stop("'unknown' must be a single value") if(any(isUnknown(x, unknown=unknown))) { if(!force) stop(sprintf("'x' already has level %s", dQuote(unknown))) } else { mapLevels(x) <- c(mapLevels(x, codes=FALSE), mapLevels(as.character(unknown), codes=FALSE)) } x[is.na(x)] <- unknown if(!force) warning(sprintf("new level is introduced: %s", unknown), call.=call.) x } NAToUnknown.list <- function(x, unknown, force=FALSE, call.=FALSE, ...) { unknown <- .unknownList(x=x, unknown=unknown) x <- mapply(FUN="NAToUnknown", x=x, unknown=unknown, force=force, call.=call., SIMPLIFY=FALSE) x } NAToUnknown.data.frame <- function(x, unknown, force=FALSE, call.=FALSE, ...) { x[] <- NAToUnknown.list(x=x, unknown=unknown, force=force, call.=call.) x } .unknownList <- function(x, unknown) { ## Setup n <- length(x) unkN <- length(unknown) namesX <- names(x) namesXNullTest <- is.null(namesX) unkNames <- names(unknown) unkNamesNullTest <- is.null(unkNames) defInNames <- ".default" %in% unkNames defInd <- unkNames %in% ".default" def <- unknown[defInd] if(defInNames) { # remove default unkN <- unkN - 1 unkNames <- unkNames[!defInd] unknown <- unknown[!defInd] } if(!namesXNullTest) { # check for nonexistent name test <- !(unkNames %in% namesX) if(any(test)) stop(sprintf("name(s) %s not in names of 'x'", paste(sQuote(unkNames[test]), collapse=" "))) } ## Recycle if(unkN < n) { if(unkNamesNullTest | defInNames) { if(defInNames) { # handling .default names(def) <- NULL unknownDef <- rep(def, length=(n - unkN)) names(unknownDef) <- namesX[!(namesX %in% unkNames)] unknown <- c(unknownDef, unknown) } else { unknownDef <- unknown unknown <- rep(unknownDef, length=n) } } else { stop("can not propely recycle named 'unknown'") } } ## Names if(!namesXNullTest) { # no need if namesX NULL if(unkNamesNullTest) { # missing unkNames names(unknown) <- namesX } else { # unkNames known unknown <- unknown[match(namesX, names(unknown))] } } unknown } gdata/R/duplicated2.R0000644000176200001440000000030514441446535014066 0ustar liggesusersduplicated2 <- function(x, bothWays=TRUE, ...) { if(!bothWays) { return(duplicated(x, ...)) } else if(bothWays) { return((duplicated(x, ...) | duplicated(x, fromLast=TRUE, ...))) } } gdata/R/rename.vars.R0000644000176200001440000000244714441446535014120 0ustar liggesusersrename.vars <- function(data, from="", to="", info=TRUE) { dsn <- deparse(substitute(data)) dfn <- names(data) if (length(from) != length(to)) { cat('--------- from and to not same length ---------\n') stop() } if (length(dfn) < length(to)) { cat('--------- too many new names ---------\n') stop() } chng <- match(from, dfn) frm.in <- from %in% dfn if (!all(frm.in)) { cat('---------- some of the from names not found in', dsn, '\n') stop() } if (length(to) != length(unique(to))) { cat('---------- New names not unique\n') stop() } dfn.new <- dfn dfn.new[chng] <- to if (info) cat('\nChanging in', dsn) tmp <- rbind(from, to) dimnames(tmp)[[1]] <- c('From:', 'To:') dimnames(tmp)[[2]] <- rep('', length(from)) if (info) { print(tmp,quote=FALSE) cat("\n") } names(data) <- dfn.new data } remove.vars <- function(data, names, info=TRUE) { dsn <- deparse(substitute(data)) if (info) cat('\nChanging in', dsn, "\n") flag <- names %in% colnames(data) if(any(!flag)) warning("Variable(s) not found: ", paste(names[!flag], collapse=", ")) if(any(flag)) { if(info) cat("Dropping variables:", paste(names[flag], collapse=", "), "\n\n") for(var in names[flag]) data[[var]] <- NULL } data } gdata/R/humanReadable.R0000644000176200001440000000424514441446535014425 0ustar liggesusershumanReadable <- function(x, units="auto", standard=c("IEC", "SI", "Unix"), digits=1, width=NULL, sep=" ", justify = c("right", "left")) { ## Setup suffix.SI <- c("B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") suffix.IEC <- c("B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB") suffix.Unix <- c("B" , "K", "M", "G", "T", "P", "E", "Z", "Y") standard <- match.arg(standard) if(length(justify) == 1) justify <- c(justify, justify) ## Functions .applyHuman <- function(x, base, suffix, digits, width, sep) { ## Which suffix should we use? n <- length(suffix) i <- pmax(pmin(floor(log(x, base)), n-1),0) if(!is.finite(i)) i <- 0 x <- x / base^i ## Formatting if(is.null(width)) { ## the same formatting for all x <- format(round(x=x, digits=digits), nsmall=digits) } else { ## similar to ls, du, and df lenX <- nchar(x) if(lenX > width) { digits <- pmax(width - nchar(round(x)) - 1, 0) } if(i == 0) digits <- 0 x <- round(x, digits=digits) } c(x, suffix[i+1]) } ## Work if(any(x < 0)) stop("'x' must be positive") if(standard == "SI") { suffix <- suffix.SI base <- 10^3 } else if (standard=="IEC") { suffix <- suffix.IEC base <- 2^10 } else # (standard=="Unix) { suffix <- suffix.Unix base <- 2^10 } if(!missing(units) && units=="bytes") { retval <- rbind(x, "bytes") } else if(!missing(units) && units!="auto") { units <- suffix[match(toupper(units), toupper(suffix))] power <- match(units, suffix) -1 X <- x / (base^power) X <- format.default(x=X, digits=digits, nsmall=digits) retval <- rbind(X, rep(units, length(X))) } else { retval <- sapply(X=x, FUN=".applyHuman", base=base, suffix=suffix, digits=digits, width=width, sep=sep) } if(all(justify == "none")) { paste(trim(retval[1,]), trim(retval[2,]), sep=sep) } else { paste(format(trim(retval[1,]), justify=justify[1]), format(trim(retval[2,]), justify=justify[2]), sep=sep) } } gdata/R/getDateTimeParts.R0000644000176200001440000000254614441446535015105 0ustar liggesusersgetYear <- function(x, format, ...) UseMethod("getYear") getYear.default <- function(x, format, ...) stop("'getYear' can only be used on objects of a date/time class") getYear.Date <- getYear.POSIXct <- getYear.POSIXlt <- function(x, format="%Y", ...) format(x=x, format=format, ...) getMonth <- function(x, format, ...) UseMethod("getMonth") getMonth.default <- function(x, format, ...) stop("'getMonth' can only be used on objects of a date/time class") getMonth.Date <- getMonth.POSIXct <- getMonth.POSIXlt <- function(x, format="%m", ...) format(x=x, format=format) getDay <- function(x, format, ...) UseMethod("getDay") getDay.default <- function(x, format, ...) stop("'getDay' can only be used on objects of a date/time class") getDay.Date <- getDay.POSIXct <- getDay.POSIXlt <- function(x, format="%d", ...) format(x=x, format=format) getHour <- function(x, format, ...) UseMethod("getHour") getHour.default <- function(x, format, ...) stop("'getHour' can only be used on objects of a date/time class") getMin <- function(x, format, ...) UseMethod("getMin") getMin.default <- function(x, format, ...) stop("'getMin' can only be used on objects of a date/time class") getSec <- function(x, format, ...) UseMethod("getSec") getSec.default <- function(x, format, ...) stop("'getSec' can only be used on objects of a date/time class") gdata/R/frameApply.R0000644000176200001440000000265514441446535014000 0ustar liggesusersframeApply <- function(x, by = NULL, on = by[1], fun = function(xi) c(Count = nrow(xi)) , subset = TRUE, simplify = TRUE, byvar.sep = "\\$\\@\\$", ...) { subset <- eval(substitute(subset), x, parent.frame()) x <- x[subset, , drop = FALSE] if(!is.null(by)) { x[by] <- drop.levels(x[by]) for(i in seq(along = by)) if(length(grep(byvar.sep, as.character(x[[by[i]]])))) stop("Choose a different value for byvar.sep.") byvars <- unique(x[by]) BYVAR <- do.call("paste", c(as.list(x[by]), sep = byvar.sep)) byvars <- byvars[order(unique(BYVAR)), , drop = FALSE] splx <- split(x[on], BYVAR) splres <- lapply(splx, fun, ...) if(!simplify) out <- list(by = byvars, result = splres) else { i <- 1 ; nres <- length(splres) while(inherits(splres[[i]], "try-error") & i < nres) i <- i + 1 nms <- names(splres[[i]]) splres <- lapply(splres, function(xi) { if(inherits(xi, "try-error")) { return(rep(NA, length(nms))) } else xi }) res <- do.call("rbind", splres) res <- as.data.frame(res) names(res) <- nms if(length(intersect(names(byvars), names(res)))) stop("names of 'by' variables are the same as names of result elements") out <- data.frame(byvars, res) } } else { out <- fun(x[on]) if(simplify) out <- as.data.frame(as.list(out)) } out } gdata/R/case.R0000644000176200001440000000052014441446535012600 0ustar liggesuserscase <- function(x, ..., default=NA) { magic <- "....default...." alternatives <- c(..., "....default...."=magic) x <- as.character(x) retval <- factor(x, levels=alternatives, labels=names(alternatives)) levels(retval)[length(alternatives)] <- as.character(default) retval[is.na(retval) & !is.na(x)] <- default retval } gdata/R/cbindX.R0000644000176200001440000000147514441446535013106 0ustar liggesuserscbindX <- function(...) { ## Setup x <- list(...) ## Are all objects matrices or data.frames? test <- sapply(x, function(z) is.matrix(z) | is.data.frame(z)) if(any(!test)) stop("only matrices and data.frames can be used") ## Get maximum number of rows tmp <- sapply(x, nrow) maxi <- which.max(tmp) test <- tmp < tmp[maxi] ## Core ## Adding additional 'empty' rows so all objects have same number of rows for(i in 1:length(tmp)) { if(test[i]) { add <- matrix(nrow=tmp[maxi] - tmp[i], ncol=ncol(x[[i]])) if(is.data.frame(x[[i]])) { add <- as.data.frame(add) } colnames(add) <- colnames(x[[i]]) x[[i]] <- rbind(x[[i]], add) } } ## Column-bind all objects ret <- x[[1]] for(i in 2:length(tmp)) { ret <- cbind(ret, x[[i]]) } ## Return ret } gdata/R/matchcols.R0000644000176200001440000000132614441446535013647 0ustar liggesusersmatchcols <- function(object, with, without, method=c("and","or"), ...) { method <- match.arg(method) cols <- colnames(object) # Include columns matching 'with' pattern(s) if(method == "and") { for(i in 1:length(with)) { if(length(cols)>0) cols <- grep(with[i], cols, value=TRUE, ...) } } else if(!missing(with)) { if(length(cols)>0) cols <- sapply(with, grep, x=cols, value=TRUE, ...) } # Exclude columns matching 'without' pattern(s) if(!missing(without)) { for(i in 1:length(without)) { if(length(cols) > 0) { omit <- grep(without[i], cols, ...) if(length(omit) > 0) cols <- cols[-omit] } } } cols } gdata/R/drop.levels.R0000644000176200001440000000073014441446535014125 0ustar liggesusersdrop.levels <- function(x, reorder=TRUE, ...) UseMethod("drop.levels") drop.levels.default <- function(x, reorder=TRUE, ...) x drop.levels.factor <- function(x, reorder=TRUE, ...) { x <- x[, drop=TRUE] if(reorder) x <- reorder(x, ...) x } drop.levels.list <- function(x, reorder=TRUE, ...) { lapply(x, drop.levels, reorder=reorder, ...) } drop.levels.data.frame <- function(x, reorder=TRUE, ...) { x[] <- drop.levels.list(x, reorder=reorder, ...) x } gdata/R/interleave.R0000644000176200001440000000170014441446535014024 0ustar liggesusersinterleave <- function(..., append.source=TRUE, sep=": ", drop=FALSE) { sources <- list(...) sources[sapply(sources, is.null)] <- NULL sources <- lapply(sources, function(x) if(is.matrix(x) || is.data.frame(x)) x else t(x)) nrows <- sapply(sources, nrow) mrows <- max(nrows) if(any(nrows!=mrows & nrows!=1)) stop("arguments have differing numbers of rows") sources <- lapply(sources, function(x) if(nrow(x)==1) x[rep(1,mrows),,drop=drop] else x) tmp <- do.call("rbind", sources) nsources <- length(sources) indexes <- outer((0:(nsources-1)) * mrows, 1:mrows, "+") retval <- tmp[indexes,,drop=drop] if(append.source && !is.null(names(sources))) { if(!is.null(row.names(tmp))) { row.names(retval) <- paste(format(row.names(retval)), format(names(sources)), sep=sep) } else { row.names(retval) <- rep(names(sources), mrows) } } retval } gdata/R/first.R0000644000176200001440000000044014441446535013015 0ustar liggesusersfirst <- function(x, n=1, ...) head(x, n=n, ...) last <- function(x, n=1, ...) tail(x, n=n, ...) "first<-" <- function(x, n=1, ..., value) { x[1:n] <- value[1:n] x } "last<-" <- function(x, n=1, ..., value) { index <- seq(length(x)-n+1, length(x)) x[index] <- value[1:n] x } gdata/R/resample.R0000644000176200001440000000162714441446535013506 0ustar liggesusers## The base R 'sample' function behaves differently if it is passed a ## sampling vector of length 1 than if it is passed a ## vector of length greater than 1. For the 1-element ## case it samples from the list 1:x, instead of from the contents ## of x. This function remove the special case: it always samples from ## the provided argument, no matter the length. resample <- function(x, size, replace = FALSE, prob = NULL) { if(length(x)<1) { if(!missing(size) && size>0) stop("Requested sample of size ", size, " from list of length 0") else x[FALSE] } else if(length(x)==1) { if(missing(size) || size==1) x else if(size>=1 && replace==TRUE) rep(x, size) else if(size < 1) x[FALSE] else stop("cannot cannot take a sample larger than the population", " when 'replace = FALSE'") } else { sample(x, size, replace, prob) } } gdata/R/trim.R0000644000176200001440000000140114441446535012637 0ustar liggesuserstrim <- function(s, recode.factor=TRUE, ...) UseMethod("trim", s) trim.default <- function(s, recode.factor=TRUE, ...) s trim.character <- function(s, recode.factor=TRUE, ...) { s <- sub(pattern="^[[:blank:]]+", replacement="", x=s) s <- sub(pattern="[[:blank:]]+$", replacement="", x=s) s } trim.factor <- function(s, recode.factor=TRUE, ...) { levels(s) <- trim(levels(s)) if(recode.factor) { dots <- list(x=s, ...) if(is.null(dots$sort)) dots$sort <- sort s <- do.call(what="reorder.factor", args=dots) } s } trim.list <- function(s, recode.factor=TRUE, ...) lapply(s, trim, recode.factor=recode.factor, ...) trim.data.frame <- function(s, recode.factor=TRUE, ...) { s[] <- trim.list(s, recode.factor=recode.factor, ...) s } gdata/R/nPairs.R0000644000176200001440000000233314441446535013125 0ustar liggesusers## Number of variable pairs nPairs <- function(x, margin=FALSE, names=TRUE, abbrev=TRUE, ...) { ## Setup if(!is.data.frame(x) & !is.matrix(x)) stop("'x' must be a data.frame or a matrix") k <- ncol(x) if(!margin) { ret <- matrix(nrow=k, ncol=k) } else { ret <- matrix(nrow=k, ncol=k + 1) } ## Count diag(ret)[1:k] <- apply(X=x, MARGIN=2, FUN=function(x) sum(!is.na(x))) for(i in 1:k) { for(j in i:k) { ret[i, j] <- ret[j, i] <- sum(!is.na(x[, i]) & !is.na(x[, j])) if(margin) { if(i == 1) { ret[i, (k + 1)] <- ret[1, 1] } else { ret[i, (k + 1)] <- sum(rowSums(!is.na(x[, c(1:i)])) == i) } } } } ## Names if(names) { tmp <- colnames(x) if(abbrev) tmp <- as.character(abbreviate(tmp, ...)) rownames(ret) <- tmp if(margin) { colnames(ret) <- c(tmp, "all") } else { colnames(ret) <- tmp } } class(ret) <- c("nPairs", class(ret)) ret } summary.nPairs <- function(object, ...) { n <- nrow(object) ret <- matrix(data=0, nrow=n, ncol=n) for(i in 1:n) { tmp <- 1:n tmp <- tmp[!(tmp == i)] ret[i, tmp] <- object[i, i] - object[i, tmp] } dimnames(ret) <- dimnames(object) ret } gdata/R/bindData.R0000644000176200001440000000164414441446535013403 0ustar liggesusersbindData <- function(x, y, common) { ## Setup if(!is.data.frame(x)) stop("'x' must be a data frame") if(!is.data.frame(y)) stop("'y' must be a data frame") ## New data frame ## First add common column and a dataset indicator column z <- rbind(x[common], y[common]) ## Other columns ## Remove common columns in x and y namesz <- names(z) otherx <- names(x) otherx <- otherx[!(otherx %in% namesz)] othery <- names(y) othery <- othery[!(othery %in% namesz)] ## Add all other columns but as a set for each input data frame rx <- nrow(x); cx <- length(otherx) ry <- nrow(y); cy <- length(othery) z <- cbind(z, rbind(x[otherx], matrix(rep(NA, times=(ry * cx)), nrow=ry, ncol=cx, dimnames=list(NULL, otherx)))) z <- cbind(z, rbind(matrix(rep(NA, times=(rx * cy)), nrow=rx, ncol=cy, dimnames=list(NULL, othery)), y[othery])) z } gdata/R/update.data.frame.R0000644000176200001440000000162114441446535015153 0ustar liggesusersupdate.data.frame <- function(object, new, by, by.x=by, by.y=by, append=TRUE, verbose=FALSE, ...) { x <- object y <- new retval <- x x.by <- x[[by.x]] y.by <- y[[by.y]] matches.x <- match(y.by, x.by) matches.y <- which(!is.na(matches.x)) nomatch.y <- which(is.na(matches.x)) matches.x <- matches.x[!is.na(matches.x)] if(length(matches.x)>0) retval[matches.x, ] <- y[matches.y,] if(length(nomatch.y) && append) retval <- rbind(retval, y[nomatch.y,]) if(verbose) { cat("\n") cat("Number of rows in x :", nrow(x), "\n") cat("Number of rows in y :", nrow(y), "\n") cat("\n") cat("Number of rows replaced :", length(matches.x), "\n") cat("Number of rows appended :", length(nomatch.y), "\n") cat("\n") cat("Number of rows in result:", nrow(retval), "\n") cat("\n") } retval } gdata/R/upperTriangle.R0000644000176200001440000000134114441446535014510 0ustar liggesusersupperTriangle <- function(x, diag=FALSE, byrow=FALSE) { if(byrow) t(x)[rev(upper.tri(x, diag=diag))] else x[upper.tri(x, diag=diag)] } "upperTriangle<-" <- function(x, diag=FALSE, byrow=FALSE, value) { if(byrow) { ret <- t(x) ret[rev(upper.tri(x, diag=diag))] <- value t(ret) } else { x[upper.tri(x, diag=diag)] <- value x } } lowerTriangle <- function(x, diag=FALSE, byrow=FALSE) { if(byrow) t(x)[rev(lower.tri(x, diag=diag))] else x[lower.tri(x, diag=diag)] } "lowerTriangle<-" <- function(x, diag=FALSE, byrow=FALSE, value) { if(byrow) { ret <- t(x) ret[rev(lower.tri(x, diag=diag))] <- value t(ret) } else { x[lower.tri(x, diag=diag)] <- value x } } gdata/R/ConvertMedUnits.R0000644000176200001440000000310114441446535014754 0ustar liggesusersConvertMedUnits <- function(x, measurement, abbreviation, to=c("Conventional","SI","US"), exact=!missing(abbreviation)) { MedUnits <- NULL # define to avoid R CMD check warning data(MedUnits, package='gdata', envir=environment()) to=match.arg(to) if(!missing(measurement) && missing(abbreviation)) { if(exact) matchUnits <- MedUnits[tolower(MedUnits$Measurement) == tolower(measurement),] else matchUnits <- MedUnits[grep(measurement, MedUnits$Measurement, ignore.case=TRUE),] } else if(missing(measurement) && !missing(abbreviation)) { if(exact) matchUnits <- MedUnits[tolower(MedUnits$Abbreviation) == tolower(abbreviation),] else matchUnits <- MedUnits[grep(match, MedUnits$Abbrevation, ignore.case=TRUE),] } else # both missing or both specified stop("one of `measurement' or `abbreviation' must be specified") if(nrow(matchUnits) > 1) stop( paste("More than one matching row. Please use 'exact=TRUE' ", "and supply one of these matching strings:", paste('\t"',matchUnits$Measurement, '"', sep='', collapse="\n\t"), sep="\n\t")) else if (nrow(matchUnits) < 1) stop("No match") if (to %in% c("Convetional", "US")) { retval <- x / matchUnits$Conversion attr(retval,"units") <- matchUnits$ConventionalUnits } else { retval <- x * matchUnits$Conversion attr(retval,"units") <- matchUnits$SIUnits } retval } gdata/R/mapLevels.R0000644000176200001440000001642314510771613013621 0ustar liggesusersmapLevels <- function(x, codes=TRUE, sort=TRUE, drop=FALSE, combine=FALSE, ...) { UseMethod("mapLevels") } mapLevels.default <- function(x, codes=TRUE, sort=TRUE, drop=FALSE, combine=FALSE, ...) { stop(sprintf("mapLevels can only be used on %s and %s atomic 'x'", dQuote("factor"), dQuote("character"))) } mapLevels.character <- function(x, codes=TRUE, sort=TRUE, drop=FALSE, combine=FALSE, ...) { mapLevels.factor(x=x, codes=codes, sort=sort, drop=drop, ...) } ## Could coerce character to factor and then use factor method, but that ## is more expensive than simple unique and length used below in factor ## method mapLevels.factor <- function(x, codes=TRUE, sort=TRUE, drop=FALSE, combine=FALSE, ...) { ## Argument actions if(is.factor(x)) { # factor if(drop) x <- factor(x) nlevs <- nlevels(x) levs <- levels(x) } else { # character levs <- unique(x) nlevs <- length(levs) if(sort) levs <- sort(levs, ...) } ## Create a map map <- vector(mode="list", length=nlevs) names(map) <- levs if(codes) { map[1:nlevs] <- 1:nlevs } else { map[1:nlevs] <- levs } class(map) <- "levelsMap" map } mapLevels.list <- function(x, codes=TRUE, sort=TRUE, drop=FALSE, combine=FALSE, ...) { map <- lapply(x, mapLevels, codes=codes, sort=sort, drop=drop, ...) class(map) <- "listLevelsMap" if(combine) { if(!codes) { return(c(map, sort=sort, recursive=TRUE)) } else { stop(sprintf("can not combine integer %s", dQuote("levelsMaps"))) } } map } mapLevels.data.frame <- function(x, codes=TRUE, sort=TRUE, drop=FALSE, combine=FALSE, ...) { mapLevels.list(x, codes=codes, sort=sort, drop=drop, combine=combine, ...) } .unlistLevelsMap <- function(x, ind=FALSE) { y <- unlist(x, use.names=FALSE) len <- sapply(x, FUN=length) names(y) <- rep(names(x), times=len) if(ind) { return(list(y, rep(1:length(x), times=len), len)) } else { return(y) } } print.levelsMap <- function(x, ...) { x <- .unlistLevelsMap(x) print(x, ...) } print.listLevelsMap <- function(x, ...) { class(x) <- "list" print(x, ...) } ## We need these two since [.list method drops class "[.levelsMap" <- function(x, i) { classX <- class(x) class(x) <- "list" x <- x[i] class(x) <- classX x } "[.listLevelsMap" <- function(x, i) { classX <- class(x) class(x) <- "list" x <- x[i] class(x) <- classX x } is.levelsMap <- function(x) inherits(x=x, what="levelsMap") is.listLevelsMap <- function(x) inherits(x=x, what="listLevelsMap") .isCharacterMap <- function(x) { if(is(x) == "levelsMap") { return(inherits(x=unlist(x), what="character")) } else { stop(sprintf("can be used only on %s", dQuote("levelsMap"))) } } as.levelsMap <- function(x, check=TRUE, ...) { if(check) .checkLevelsMap(x, method="raw") class(x) <- "levelsMap" unique(x, ...) } as.listLevelsMap <- function(x, check=TRUE) { if(check) .checkListLevelsMap(x, method="raw") class(x) <- "listLevelsMap" x } .checkLevelsMap <- function(x, method) { xLab <- deparse(substitute(x)) also <- "\b" if(method == "class") { also <- "also" if(!is.levelsMap(x)) stop(sprintf("'%s' must be a %s", xLab, dQuote("levelsMap"))) } if(!is.list(x) || is.null(names(x))) stop(sprintf("'%s' must be %s a named list", xLab, also)) ## Components can be of different length ## if(!all(sapply(x, FUN=length) == 1)) ## stop(sprintf("all components of '%s' must have length 1", xLab)) } .checkListLevelsMap <- function(x, method) { xLab <- deparse(substitute(x)) also <- "\b" if(method == "class") { also <- "also" if(!is.listLevelsMap(x)) stop(sprintf("'%s' must be a %s", xLab, dQuote("listLevelsMap"))) } if(!is.list(x) || any(!sapply(x, FUN=is.levelsMap))) stop(sprintf("'%s' must be %s a list of %s", xLab, also, dQuote("levelsMap"))) lapply(x, FUN=.checkLevelsMap, method=method) } c.levelsMap <- function(..., sort=TRUE, recursive=FALSE) { x <- list(...) class(x) <- "listLevelsMap" ## We use recursive=TRUE here because ... is a lists of lists c(x, sort=sort, recursive=TRUE) } c.listLevelsMap <- function(..., sort=TRUE, recursive=FALSE) { x <- list(...) lapply(x, FUN=.checkListLevelsMap, method="class") x <- unlist(x, recursive=FALSE) if(!recursive) { class(x) <- "listLevelsMap" } else { if(any(!sapply(x, FUN=.isCharacterMap))) stop(sprintf("can not combine integer %s", dQuote("levelsMaps"))) if(!is.null(names(x))) names(x) <- NULL x <- unlist(x, recursive=FALSE) ## How to merge components with the same name? class(x) <- "levelsMap" if(sort) x <- sort(x) x <- unique(x) } x } sort.levelsMap <- function(x, decreasing=FALSE, na.last=TRUE, ...) x[order(names(x), na.last=na.last, decreasing=decreasing)] unique.levelsMap <- function(x, incomparables=FALSE, ...) { ## Find duplicates y <- .unlistLevelsMap(x, ind=TRUE) ## Duplicates for values and names combinations test <- duplicated(cbind(y[[1]], names(y[[1]])), incomparables=incomparables, ...) if(any(test)) { if(any(y[[3]] > 1)) { # work with the same structure as in x j <- 1 k <- y[[3]][1] empty <- NULL for(i in seq(along=x)) { # how slow is this loop? tmp <- !test[j:k] if(all(!tmp)) { # these components will be empty empty <- c(empty, i) } else { x[[i]] <- x[[i]][tmp] } j <- j + y[[3]][i] k <- k + y[[3]][i + 1] } if(!is.null(empty)) x[empty] <- NULL } else { # simple one-length components x <- x[!test] } } x } "mapLevels<-" <- function(x, value) UseMethod("mapLevels<-") "mapLevels<-.default" <- function(x, value) { ## Checks classX <- c("integer", "character", "factor") if(any(!(class(x) %in% classX))) stop(sprintf("'x' must be either: %s", paste(dQuote(classX), collapse=", "))) .checkLevelsMap(x=value, method="class") ## Mapping levels in x char <- all(sapply(value, is.character)) int <- all(sapply(value, is.integer)) if(int) { # codes=TRUE if(is.integer(x)) x <- factor(x) if(is.factor(x)) levels(x) <- value if(is.character(x)) stop(sprintf("can not apply integer %s to %s", dQuote("levelsMap"), dQuote("character"))) } else { # codes=FALSE if(!char) stop("all components of 'value' must be of the same class") if(is.character(x)) x <- factor(x) if(is.factor(x)) levels(x) <- value if(is.integer(x)) stop(sprintf("can not apply character %s to %s", dQuote("levelsMap"), dQuote("integer"))) } x } "mapLevels<-.list" <- function(x, value) { if(!is.listLevelsMap(value)) { if(is.levelsMap(value)) { value <- as.listLevelsMap(list(value), check=FALSE) ## No need for check as default method does checking anyway } else { stop(sprintf("'x' must be either %s or %s", dQuote("listLevelsMap"), dQuote("levelsMap"))) } } x <- mapply(FUN="mapLevels<-", x=x, value=value, SIMPLIFY=FALSE) x } "mapLevels<-.data.frame" <- function(x, value) { x[] <- "mapLevels<-.list"(x, value) x } gdata/R/keep.R0000644000176200001440000000132114441446535012611 0ustar liggesuserskeep <- function(..., list=character(), all=FALSE, sure=FALSE) { if(missing(...) && missing(list)) { warning("keep something, or use rm(list=ls()) to clear workspace - ", "nothing was removed") return(invisible(NULL)) } names <- as.character(substitute(list(...)))[-1] list <- c(list, names) keep.elements <- match(list, ls(1,all.names=all)) if(any(is.na(keep.elements))) { warning("you tried to keep '", list[which(is.na(keep.elements))[1]], "' which doesn't exist in workspace - nothing was removed") return(invisible(NULL)) } obj <- ls(1, all.names=all)[-keep.elements] if(sure) { rm(list=obj, pos=1) invisible(obj) } else { obj } } gdata/R/trimSum.R0000644000176200001440000000072414441446535013333 0ustar liggesuserstrimSum <- function(x, n, right=TRUE, na.rm=FALSE, ...) { ## Setup if(!is.vector(x) | is.list(x)) stop("'x' must be a vector - for now") if(!is.numeric(x)) stop("'x' must be numeric") if(length(x) <= n) stop("'n' must be smaller than the length of x") ## Trim N <- length(x) if(right) { x2 <- x[1:n] x2[n] <- sum(x[n:N], na.rm=na.rm) } else { k <- (N - n + 1) x2 <- x[k:N] x2[1] <- sum(x[1:k], na.rm=na.rm) } x2 } gdata/R/centerText.R0000644000176200001440000000056014441446535014016 0ustar liggesuserscenterText <- function(x, width=getOption("width")) { retval <- vector(length=length(x), mode="character") for(i in 1:length(x)) { text <- trim(x[i]) textWidth <- nchar(text) nspaces <- floor((width - textWidth)/2) spaces <- paste(rep(" ",nspaces), sep="", collapse="") retval[i] <- paste(spaces, text, sep="", collapse="\n") } retval } gdata/R/ans.R0000644000176200001440000000003614441446535012450 0ustar liggesusersans <- function() .Last.value gdata/R/mv.R0000644000176200001440000000057214441446535012316 0ustar liggesusersmv <- function(from, to, envir=parent.frame()) { if(!is.character(from) || !exists(from, envir=envir, inherits = TRUE)) stop("`from` must be a character string specifying the name of an object.") if(!is.character(to)) stop("`to` must be a characater string.") value <- get(from, envir=envir) assign(x=to, value=value, envir=envir) rm(list=from, envir=envir) } gdata/R/left.R0000644000176200001440000000162514441446535012626 0ustar liggesusersleft <- function(x, n=6L, ...) UseMethod("left") right <- function(x, n=6L, ...) UseMethod("right") .leftright <- function(x, n=6L, add.col.nums = TRUE, direction = c("left", "right"), ...) { stopifnot(length(n) == 1L) ncx <- ncol(x) if (add.col.nums && is.null(colnames(x))) colnames(x) <- paste0("[", 1:ncx, ",]") if (n < 0L) n <- max(ncx + n, 0L) else n <- min(n, ncx) if (direction == "left") sel <- seq.int(from=1, length.out = n) else # direction="right" sel <- seq.int(to = ncx, length.out = n) x[, sel, drop = FALSE] } left.data.frame <- function(x, n=6L, add.col.nums=TRUE, ...) .leftright(x, n=n, add.col.nums=add.col.nums, direction="left") right.data.frame <- function(x, n=6L, add.col.nums=TRUE, ...) .leftright(x, n=n, add.col.nums=add.col.nums, direction="right") left.matrix <- left.data.frame right.matrix <- right.data.frame gdata/R/env.R0000644000176200001440000000205214510771613012452 0ustar liggesusersenv <- function(unit="KB", digits=0) { get.object.size <- function(object.name, pos) { object <- get(object.name, pos=pos) size <- try(unclass(utils::object.size(object)), silent=TRUE) if(inherits(size, "try-error")) size <- 0 size } get.environment.size <- function(pos) { if(search()[pos]=="Autoloads" || length(ls(pos,all.names=TRUE))==0) size <- 0 else size <- sum(sapply(ls(pos,all.names=TRUE), get.object.size, pos=pos)) size } get.environment.nobjects <- function(pos) { length(ls(pos, all.names=TRUE)) } unit <- match.arg(unit, c("bytes","KB","MB")) denominator <- switch(unit, "KB"=1024, "MB"=1024^2, 1) size.vector <- sapply(seq(along=search()), get.environment.size) size.vector <- round(size.vector/denominator, digits) nobjects.vector <- sapply(seq(along=search()), get.environment.nobjects) env.frame <- data.frame(search(), nobjects.vector, size.vector) names(env.frame) <- c("Environment", "Objects", unit) print(env.frame, right=FALSE) invisible(env.frame) } gdata/R/ls.funs.R0000644000176200001440000000044014441446535013256 0ustar liggesusersls.funs <- function (...) { mycall <- match.call() mycall[[1]] <- as.name("ls") nameList <- eval.parent(mycall) if(length(nameList) > 0) { funcFlags <- sapply(nameList, function(x) is.function(get(x))) return(nameList[funcFlags]) } else { return(list()) } } gdata/R/unmatrix.R0000644000176200001440000000063014441446535013536 0ustar liggesusersunmatrix <- function(x, byrow=FALSE) { rnames <- rownames(x) cnames <- colnames(x) if(is.null(rnames)) rnames <- paste("r",1:nrow(x),sep='') if(is.null(cnames)) cnames <- paste("c",1:ncol(x),sep='') nmat <- outer(rnames, cnames, paste, sep=":") if(byrow) { vlist <- c(t(x)) names(vlist) <- c(t(nmat)) } else { vlist <- c(x) names(vlist) <- c(nmat) } return(vlist) } gdata/R/reorder.R0000644000176200001440000000161714441446535013337 0ustar liggesusersreorder.factor <- function(x, X, FUN, ..., order=is.ordered(x), new.order, sort=mixedsort) { constructor <- if (order) ordered else factor if(!missing(X) || !missing(FUN)) { if(missing(FUN)) FUN <- 'mean' ## I would prefer to call stats::reorder.default directly, ## but it is not exported from stats, so the relevant code is ## replicated here: ## --> scores <- tapply(X = X, INDEX = x, FUN = FUN, ...) levels <- names(base::sort(scores, na.last = TRUE)) if(order) ans <- ordered(x, levels=levels) else ans <- factor(x, levels=levels) attr(ans, "scores") <- scores ## <-- return(ans) } else if (!missing(new.order)) { if (is.numeric(new.order)) new.order <- levels(x)[new.order] else new.order <- new.order } else new.order <- sort(levels(x)) constructor(x, levels=new.order) } gdata/MD50000644000176200001440000001411014513307506011643 0ustar liggesusers6b6f69f4bbdc3e766be9fbdb28a2766c *ChangeLog 29486768224e0a2bb3cdd9115f18e4ec *DESCRIPTION 8832513b8bdfdc39ad73efebbf9919bf *NAMESPACE 65e7db3b585891f46431ceae9cfdb70d *NEWS 92e3ca5e31d594044b8325a441142c37 *R/Args.R e5651937af66e256b619a1e05c9d7533 *R/ConvertMedUnits.R 38de1344cd5bc79f32a0b42e48b43965 *R/ans.R e46bf54efe7d8029d1aaea9b397ddafd *R/bindData.R 1fe1f8ba256580187a1a5b069b5b51cc *R/case.R 3b94dada8a7538df60c3cd9e2d213ba5 *R/cbindX.R 86eb2f339983dcc4a78f4666df8a0a46 *R/centerText.R 250089de2f4b896f3719d8079555b07d *R/combine.R 9baa24f0d88a2058eaffb559a969bb52 *R/drop.levels.R 65f088f69a1f7a9c486498d04b398637 *R/duplicated2.R a029c9e4da594fb8c79123f209636acc *R/env.R 757e12fc9a28a4573dad388131df4ec5 *R/first.R ec30fcbd9f6c4b0cd4c6c5ebaed9e214 *R/frameApply.R 9712d51934599dcde7f678e689bf0003 *R/getDateTimeParts.R a8842b866687d6c18a1c31145d2a804d *R/humanReadable.R c5bdeb65e81954a49fec7d53d43ef244 *R/interleave.R 42f544fa6c4dc542ffde62ec141738a6 *R/is.what.R 45389f1cd1683f8e965c3f3eefcb6c2f *R/keep.R 7bf1a96d05ff617bc69bf9e41683cb85 *R/left.R 5d5878327a1ff1aea3a78394a4f94788 *R/ll.R 613631768fe2aa6b60c0fd2d9f14d356 *R/ls.funs.R 46bf26660dbfc273d929dcf78fcdc024 *R/mapLevels.R 714e97e1ee4f3d6f4fa338b15728d553 *R/matchcols.R d341f1f9f641e3072469e0512c227e2f *R/mv.R 99f0b1f60a25d2307ab31df482788aca *R/nPairs.R 85f339a9534d96289857f4f3d6bf77f4 *R/nobs.R d318c6ae2af047eb7e98290a874900d6 *R/object_size.R d1c93703bf4cb8fbedf7d8de3ba344d2 *R/rename.vars.R 49bebfa00df8beec594f4adfd6d31f13 *R/reorder.R f57521211daaaf62b53dde3ea4095e5e *R/resample.R 6d69b4261d1412396361f388e84d18fd *R/startsWith.R 6ff7e70b153cf189af5f517b5df071a1 *R/trim.R 3b239e0152e841660678d9de57cc52f8 *R/trimSum.R c7ae0254ce5265c8077257cfc5de3198 *R/unknown.R bede546800e176f693994feda498156e *R/unmatrix.R 6aeb92210c09687edf3f2c1ccc3e5e0c *R/update.data.frame.R 937af1ffde030658afdb021fbeb0851d *R/update.list.R 8402ec0c40ced3172df8e357c0acab8b *R/upperTriangle.R 65fbf5e16408d2e622bc0e3a72711895 *R/wideByFactor.R a3610bdc57e76b62acc32e7f1eeba4a6 *R/write.fwf.R a3a2e6cd0538e6977420f3f57749048a *build/vignette.rds 85489864d11f8d013d6d1b0467f06951 *data/MedUnits.rda b19ba078add1b84a300ae1adb5167567 *inst/doc/mapLevels.R ec3dc2f5438f43ccb71dddb2c1de513c *inst/doc/mapLevels.Rnw a30077ed571d6ff08b109303102a58bd *inst/doc/mapLevels.pdf 788f58d8791841c0dd0a9bddfa28b8fe *inst/doc/unknown.R 86db5cd05b30d8f4e83494a55edb308f *inst/doc/unknown.Rnw d4936406fffd281d915926e79ecdda76 *inst/doc/unknown.pdf c8f145e9ea96bc469fade5f31a616c6c *man/Args.Rd d019aa8a2e84fef5491e890666ff0f9f *man/ConvertMedUnits.Rd 34f00196ebc9a2d5b6d70d08a6b2970c *man/MedUnits.Rd af0b3ce697073c50a072fb394b3d368d *man/ans.Rd c26b42797bf1927ae5ae30b14e80c000 *man/bindData.Rd a5031b1de2894adde1ab0307c9fd33b6 *man/case.Rd 9f11b3bcfe818ab603a2e826d8d6c0ba *man/cbindX.Rd 2adfd067b34674dc8f31a6080e1e6471 *man/centerText.Rd d78d55e6f6485fbd24f8044fd08061d9 *man/combine.Rd eb8d8b527e55aea9ba89f2b970fec1a9 *man/drop.levels.Rd aa0e35fc950e8232fd49f23bf57ab725 *man/duplicated2.Rd c4649e98b6efaf49682292c493095418 *man/env.Rd b0a05c54d99ad9a209b210503671fb8a *man/first.Rd 087180e9debaad67a604ab947d4f748f *man/frameApply.Rd fc485f38a09dcb3a8d238806eec3fd78 *man/gdata-defunct.Rd 588ae95cc134be22372167ab8e53a279 *man/gdata-package.Rd 2f8fe8e68cbc380b860e2e99142f0b64 *man/getDateTimePart.Rd 4a7ace8994dd7747d99ad61904273d36 *man/humanReadable.Rd 143ef489b358b0ceab5bb148b9b7d81b *man/interleave.Rd c8deb45c2176c5d975b2a86e0627926e *man/is.what.Rd 0e8ad71b67de30adfd7619cce35a99b2 *man/keep.Rd 72ec6690ee9471d704ccc8b0c1fa018a *man/left.Rd c4e8c6a39a2ea78fe7cb7e24fc34467f *man/ll.Rd 9069c1cf6189d8ef66e0f6af167f5e10 *man/ls.funs.Rd b57657caa0a705646ebb0ef6c25fa515 *man/mapLevels.Rd 5bd5d60bac110184e6d45dcd7b72b9bd *man/matchcols.Rd 0a196ab50c3a32bcce116021ef86aa8b *man/mv.Rd e2be80f0fd9b253727d7832c70ac7d17 *man/nPairs.Rd d26c8b2afe6d62f89f9c3225ee9205b3 *man/nobs.Rd b2afcad4d45914d22e913353990ae64c *man/object_size.Rd c4fb4328f158efa0e1f345b0fedbc054 *man/rename.vars.Rd 0cc1b2f7f7a26460f97f1cc27d1b2bb4 *man/reorder.Rd a6d6f437a665cfc66c33854420ad3f88 *man/resample.Rd ee6e6ee66d4a5073338247ec12dcc357 *man/startsWith.Rd dc40531c6c7bad1838b81f89e564cbc5 *man/trim.Rd 813f7e2f4b14a269b620b8bf27271424 *man/trimSum.Rd 396c4089ac30322d2d9cca70c93c3e7c *man/unknown.Rd 2006c6ef35c1356381c76f01f25b77a4 *man/unmatrix.Rd 795838bb055d87c11f9691933466e4a9 *man/update.list.Rd df1d6b7314fb8f4205bba0b8b96354fe *man/upperTriangle.Rd 06c4a498180c876c9f244bd6726b923c *man/wideByFactor.Rd 6339aabb53b609eef67cbcd5d5eec598 *man/write.fwf.Rd 623c12086f1a54e186b40234ffeac7da *tests/runRUnitTests.R 9b929ccb1517cc109e25e81ce9c3016a *tests/test.humanReadable.R 3f5cc977cc864edb324ee9bf8c646668 *tests/test.humanReadable.Rout.save 38097a392eb64ca192984698d7a9cfc2 *tests/test.reorder.factor.R 1a35acdea8fe8693f7a6b26221e4ab26 *tests/test.reorder.factor.Rout.save dee3232474b92bcdf1ad75ca31080792 *tests/test.write.fwf.eol.R 5170ef9fcd9895aa8a85bdd7753a5b4a *tests/test.write.fwf.eol.Rout.save 3bbd1a18e54e73a0ae317bf16eae0a01 *tests/tests.write.fwf.R a4d1fcc74d626d7b2508a24476f87a45 *tests/tests.write.fwf.Rout.save 263cf2cf21a68e51ee2267fa9121f55f *tests/unitTests/Makefile 45e03a43cf845d07351f21d1968f0297 *tests/unitTests/runit.bindData.R 1c6480073863ef8b14645bdc1101857a *tests/unitTests/runit.cbindX.R 43eb8b00017ce4b075dc90bc28da73f7 *tests/unitTests/runit.drop.levels.R 9d4094b7064a700d14910843ecaa02f4 *tests/unitTests/runit.getDateTimeParts.R ed6159cd1daa279d51cc3a275ca3c3e5 *tests/unitTests/runit.mapLevels.R 59a1c806f771a342e095fd23aa241df3 *tests/unitTests/runit.nPairs.R ac86e711c1a0a6958f8dddd7e7ef825f *tests/unitTests/runit.reorder.factor.R e5c51d9263b90c048dc2d3bb789f2ca0 *tests/unitTests/runit.trim.R ce001d1738ebf20a5fb6a08e9dc9b125 *tests/unitTests/runit.trimSum.R b965670b22d55952992c87fab1dd6a00 *tests/unitTests/runit.unknown.R 0084ec1ddcceaa2218bfd85741f909d7 *tests/unitTests/runit.wideByFactor.R 87ec13f0096f4f7fe5a6effa3977514a *tests/unitTests/runit.write.fwf.R a7982b90f82857e34a253df2be42d7c1 *vignettes/Rnews.sty ec3dc2f5438f43ccb71dddb2c1de513c *vignettes/mapLevels.Rnw 86db5cd05b30d8f4e83494a55edb308f *vignettes/unknown.Rnw gdata/inst/0000755000176200001440000000000014511013460012302 5ustar liggesusersgdata/inst/doc/0000755000176200001440000000000014511013460013047 5ustar liggesusersgdata/inst/doc/unknown.pdf0000644000176200001440000033417214511013460015253 0ustar liggesusers%PDF-1.5 % 1 0 obj << /Length 370 >> stream concordance:unknown.tex:unknown.Rnw:1 59 1 1 2 1 0 2 1 6 0 1 2 5 1 1 2 7 0 1 2 3 1 1 2 7 0 1 2 6 1 1 2 7 0 1 2 4 1 1 2 7 0 1 2 4 1 1 2 7 0 1 2 9 1 1 2 7 0 1 1 5 0 1 1 5 0 1 1 5 0 1 1 5 0 1 1 5 0 1 2 6 0 1 1 7 0 1 2 29 1 1 2 10 0 1 1 9 0 1 2 3 1 1 2 10 0 1 2 6 1 1 4 13 0 1 2 3 1 1 3 12 0 1 2 7 1 1 7 1 4 3 0 1 2 11 0 1 2 4 1 1 2 1 0 1 1 1 2 1 0 1 2 1 0 1 1 10 0 1 2 47 1 endstream endobj 29 0 obj << /Length 4215 /Filter /FlateDecode >> stream x;s㶱d3 !@ :Mg.]rm9$@I%d] ٲs8 .$|W_ g\^MR i͝ȡ\N~~oϿ=S:~|~>O7?.J29jXdg$"uΏ\M\A|x?DʄͭDL9Td0m6m5auWnus-}"~aLI򦤗ŮX|*K~׌Db-<߾n|lUBm~dSF{%x ئUն<xK{GKI{-;Pq5)Ӽ5Ŷj0Y]qߊ3;\abKQo>tO1GB~FZMnړisjzSٱS#Ru^ e=g4#,nI[4i$0͎:o^;Yż.!a> RY:jlw'Njڶm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'Bp/u u+$bTy{!y1 GҢSX< {NmmXN;{}y[Dδt d\{?:1 kmn_~߼h!R,6ew*ؔb%k e+Kӄ$a"1x*s.$S56P>Ƅm„A Fs 5577vرϾ+uaя6R:!,əCxg+ѧy*JcL|*m:fvuiWUꧏɩ\g%<Ϛ"sÖ0_:3x0kjhyIYx0aCnOg3$cx0<<v5O#ܵu7A 6*sZ ZcΜ-ܠeYksL ?"@>qh|tngk;dGGMc endstream endobj 92 0 obj << /Producer (pdfTeX-1.40.22) /Author()/Title()/Subject()/Creator(LaTeX with hyperref)/Keywords() /CreationDate (D:20231010020728+11'00') /ModDate (D:20231010020728+11'00') /Trapped /False /PTEX.Fullbanner (This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian) kpathsea version 6.3.4/dev) >> endobj 3 0 obj << /Type /ObjStm /N 74 /First 575 /Length 3066 /Filter /FlateDecode >> stream xZYs۶~ׯc|;&`'ӹ'ne4iROh$*$8Kvбd!L 1,!Ih0L[vcPac2d& =:IlĤ0h& *3p2 &x!).EW1b`J11zIP`5, :#= 5Ƃ Z14b4&`SV(f SQaFV38-q3MbB"Z M`VA$a銤Cm{ċ1Ug?6K\OtZ ?J%yd7f\)EE`@Vw#Vꋮ/`g4W*|M? n^#g9?{xPg}XaB>gmH\FvزćYc2z? L,~$ F@CI[lrt0E*?([""p amF"!VmZ %ez~K q.fCHy /7I1MgJt hz!o7ɰ!j<>DkR+%.ݍT@;Z\Ex'RaP n"qaC}f/HQvQr]وi#HI`l"P,'r]Z]^a>}mӇЃ(v-`Z\9Q'jZu u\?5 RܰnRy:p"+Ĩ(p0'BTs||c??G{tYU9;ymϊ#yqGMӯe]!0lt!v$Ej3K;HcaV-jt(д6":7aLbįlepYM _` _.bTzD5ٯ,|O/IZlF}K~AKCæ;URXBXd@Hڸ"2d*H/"~8/jm?e udOB@ȧ) :_yAj-UìpҀWwZZ: Bf4†;PiCrld5ґ !]آ#a~sH"zU\G zWzn4}ڟt hNQ{c\R1 hHZ#7wt숏y*񋤤Z S{(!^~ yaK3;nhB K)R4>|peZ0!D&0nA-a; {HNGTuyhHϭxC}L%=k>S_OGoQFYw7/8+f\RkUKsyghftԼw;#*7E1^fͯ1v:7|AzQ4-wxY/žM^_&{^Mf,O4<9>sw5YZdW%|WØeW+_oioՒ0anU7PfEZF)=wTUq񊿆BJB)Iu^GIh7)-hRj6h'%HFCWSDa^W׊(h˓N޼N0Qnz #6ڜ|BHUg zt 44r9n@!P\p_8~{Eqd8aݖN׍n'a¾8&Kv' 2APmx2r=' _R~>nxx_>wf ڇ6IVcĿlC*{|*ɴ _2q':Z}WQ{Y%&"^@!'X-8$@r AN7cZ {uֳ 50e L ;?Oat\^z#kiYZGf`k05^P!.C]۶1pjjfͪC}`N.^};TuwZ@K0=.cc֫^I!lTv\wR0xuUk쐠5Sːtz{?d5/ۧ"B_uQl|NqEI֑Ex nnr3={472V-;Z!GOq}`HR^ <6FB4FE2EE9D0E6DD51260EB046431000>] /Length 244 /Filter /FlateDecode >> stream x%Y.q{ZTkh<PS͔T$݀H$!D,5wMy8WfiMz`YVOx*ʞo"*3֤Oyxm-pW GT+e8c ™ogf endstream endobj startxref 112267 %%EOF gdata/inst/doc/unknown.R0000644000176200001440000000627314511013460014701 0ustar liggesusers### R code from vignette source 'unknown.Rnw' ################################################### ### code chunk number 1: ex01 ################################################### library("gdata") xNum <- c(0, 6, 0, 7, 8, 9, NA) isUnknown(x=xNum) ################################################### ### code chunk number 2: ex02 ################################################### isUnknown(x=xNum, unknown=0) ################################################### ### code chunk number 3: ex03 ################################################### isUnknown(x=xNum, unknown=c(0, NA)) ################################################### ### code chunk number 4: ex04 ################################################### (xNum2 <- unknownToNA(x=xNum, unknown=0)) ################################################### ### code chunk number 5: ex05 ################################################### NAToUnknown(x=xNum2, unknown=999) ################################################### ### code chunk number 6: ex06 ################################################### NAToUnknown(x=xNum2, unknown=7, force=TRUE) ################################################### ### code chunk number 7: ex07 ################################################### (xFac <- factor(c(0, "BA", "RA", "BA", NA, "NA"))) isUnknown(x=xFac) isUnknown(x=xFac, unknown=0) isUnknown(x=xFac, unknown=c(0, NA)) isUnknown(x=xFac, unknown=c(0, "NA")) isUnknown(x=xFac, unknown=c(0, "NA", NA)) (xFac <- unknownToNA(x=xFac, unknown=0)) (xFac <- NAToUnknown(x=xFac, unknown=0)) ################################################### ### code chunk number 8: ex08 ################################################### (xList <- list(a=xNum, b=xFac)) isUnknown(x=xList, unknown=0) ################################################### ### code chunk number 9: ex09 ################################################### isUnknown(x=xList, unknown=c(0, NA)) ################################################### ### code chunk number 10: ex10 ################################################### (xList1 <- unknownToNA(x=xList, unknown=list(b=c(0, "NA"), a=0))) ################################################### ### code chunk number 11: ex11 ################################################### NAToUnknown(x=xList1, unknown=list(b="no", a=0)) ################################################### ### code chunk number 12: ex12 ################################################### df <- data.frame(col1=c(0, 1, 999, 2), col2=c("a", "b", "c", "unknown"), col3=c(0, 1, 2, 3), col4=c(0, 1, 2, 2)) ################################################### ### code chunk number 13: ex13 ################################################### tmp <- list(.default=0, col1=999, col2="unknown") (df2 <- unknownToNA(x=df, unknown=tmp)) ################################################### ### code chunk number 14: ex14 ################################################### df2 <- df cols <- c("col1", "col2") tmp <- list(col1=999, col2="unknown") df2[, cols] <- unknownToNA(x=df[, cols], unknown=tmp) df2 gdata/inst/doc/mapLevels.Rnw0000644000176200001440000002024214441446535015506 0ustar liggesusers%\VignetteIndexEntry{Mapping levels of a factor} %\VignettePackage{gdata} %\VignetteKeywords{levels, factor, manip} \documentclass[a4paper]{report} \usepackage{Rnews} \usepackage[round]{natbib} \bibliographystyle{abbrvnat} \usepackage{Sweave} \SweaveOpts{strip.white=all, keep.source=TRUE} \SweaveOpts{concordance=TRUE} \begin{document} \SweaveOpts{concordance=TRUE} \begin{article} \title{Mapping levels of a factor} \subtitle{The \pkg{gdata} package} \author{by Gregor Gorjanc} \maketitle \section{Introduction} Factors use levels attribute to store information on mapping between internal integer codes and character values i.e. levels. First level is mapped to internal integer code 1 and so on. Although some users do not like factors, their use is more efficient in terms of storage than for character vectors. Additionally, there are many functions in base \R{} that provide additional value for factors. Sometimes users need to work with internal integer codes and mapping them back to factor, especially when interfacing external programs. Mapping information is also of interest if there are many factors that should have the same set of levels. This note describes \code{mapLevels} function, which is an utility function for mapping the levels of a factor in \pkg{gdata} \footnote{from version 2.3.1} package \citep{WarnesGdata}. \section{Description with examples} Function \code{mapLevels()} is an (S3) generic function and works on \code{factor} and \code{character} atomic classes. It also works on \code{list} and \code{data.frame} objects with previously mentioned atomic classes. Function \code{mapLevels} produces a so called ``map'' with names and values. Names are levels, while values can be internal integer codes or (possibly other) levels. This will be clarified later on. Class of this ``map'' is \code{levelsMap}, if \code{x} in \code{mapLevels()} was atomic or \code{listLevelsMap} otherwise - for \code{list} and \code{data.frame} classes. The following example shows the creation and printout of such a ``map''. <>= library(gdata) (fac <- factor(c("B", "A", "Z", "D"))) (map <- mapLevels(x=fac)) @ If we have to work with internal integer codes, we can transform factor to integer and still get ``back the original factor'' with ``map'' used as argument in \code{mapLevels<-} function as shown bellow. \code{mapLevels<-} is also an (S3) generic function and works on same classes as \code{mapLevels} plus \code{integer} atomic class. <>= (int <- as.integer(fac)) mapLevels(x=int) <- map int identical(fac, int) @ Internally ``map'' (\code{levelsMap} class) is a \code{list} (see bellow), but its print method unlists it for ease of inspection. ``Map'' from example has all components of length 1. This is not mandatory as \code{mapLevels<-} function is only a wrapper around workhorse function \code{levels<-} and the later can accept \code{list} with components of various lengths. <>= str(map) @ Although not of primary importance, this ``map'' can also be used to remap factor levels as shown bellow. Components ``later'' in the map take over the ``previous'' ones. Since this is not optimal I would rather recommend other approaches for ``remapping'' the levels of a \code{factor}, say \code{recode} in \pkg{car} package \citep{FoxCar}. <>= map[[2]] <- as.integer(c(1, 2)) map int <- as.integer(fac) mapLevels(x=int) <- map int @ Up to now examples showed ``map'' with internal integer codes for values and levels for names. I call this integer ``map''. On the other hand character ``map'' uses levels for values and (possibly other) levels for names. This feature is a bit odd at first sight, but can be used to easily unify levels and internal integer codes across several factors. Imagine you have a factor that is for some reason split into two factors \code{f1} and \code{f2} and that each factor does not have all levels. This is not uncommon situation. <>= (f1 <- factor(c("A", "D", "C"))) (f2 <- factor(c("B", "D", "C"))) @ If we work with this factors, we need to be careful as they do not have the same set of levels. This can be solved with appropriately specifying \code{levels} argument in creation of factors i.e. \code{levels=c("A", "B", "C", "D")} or with proper use of \code{levels<-} function. I say proper as it is very tempting to use: <>= fTest <- f1 levels(fTest) <- c("A", "B", "C", "D") fTest @ Above example extends set of levels, but also changes level of 2nd and 3rd element in \code{fTest}! Proper use of \code{levels<-} (as shown in \code{levels} help page) would be: <>= fTest <- f1 levels(fTest) <- list(A="A", B="B", C="C", D="D") fTest @ Function \code{mapLevels} with character ``map'' can help us in such scenarios to unify levels and internal integer codes across several factors. Again the workhorse under this process is \code{levels<-} function from base \R{}! Function \code{mapLevels<-} just controls the assignment of (integer or character) ``map'' to \code{x}. Levels in \code{x} that match ``map'' values (internal integer codes or levels) are changed to ``map'' names (possibly other levels) as shown in \code{levels} help page. Levels that do not match are converted to \code{NA}. Integer ``map'' can be applied to \code{integer} or \code{factor}, while character ``map'' can be applied to \code{character} or \code{factor}. Result of \code{mapLevels<-} is always a \code{factor} with possibly ``remapped'' levels. To get one joint character ``map'' for several factors, we need to put factors in a \code{list} or \code{data.frame} and use arguments \code{codes=FALSE} and \code{combine=TRUE}. Such map can then be used to unify levels and internal integer codes. <>= (bigMap <- mapLevels(x=list(f1, f2), codes=FALSE, combine=TRUE)) mapLevels(f1) <- bigMap mapLevels(f2) <- bigMap f1 f2 cbind(as.character(f1), as.integer(f1), as.character(f2), as.integer(f2)) @ If we do not specify \code{combine=TRUE} (which is the default behaviour) and \code{x} is a \code{list} or \code{data.frame}, \code{mapLevels} returns ``map'' of class \code{listLevelsMap}. This is internally a \code{list} of ``maps'' (\code{levelsMap} objects). Both \code{listLevelsMap} and \code{levelsMap} objects can be passed to \code{mapLevels<-} for \code{list}/\code{data.frame}. Recycling occurs when length of \code{listLevelsMap} is not the same as number of components/columns of a \code{list}/\code{data.frame}. Additional convenience methods are also implemented to ease the work with ``maps'': \begin{itemize} \item \code{is.levelsMap}, \code{is.listLevelsMap}, \code{as.levelsMap} and \code{as.listLevelsMap} for testing and coercion of user defined ``maps'', \item \code{"["} for subsetting, \item \code{c} for combining \code{levelsMap} or \code{listLevelsMap} objects; argument \code{recursive=TRUE} can be used to coerce \code{listLevelsMap} to \code{levelsMap}, for example \code{c(llm1, llm2, recursive=TRUE)} and \item \code{unique} and \code{sort} for \code{levelsMap}. \end{itemize} \section{Summary} Functions \code{mapLevels} and \code{mapLevels<-} can help users to map internal integer codes to factor levels and unify levels as well as internal integer codes among several factors. I welcome any comments or suggestions. % \bibliography{refs} \begin{thebibliography}{1} \providecommand{\natexlab}[1]{#1} \providecommand{\url}[1]{\texttt{#1}} \expandafter\ifx\csname urlstyle\endcsname\relax \providecommand{\doi}[1]{doi: #1}\else \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi \bibitem[Fox(2006)]{FoxCar} J.~Fox. \newblock \emph{car: Companion to Applied Regression}, 2006. \newblock URL \url{http://socserv.socsci.mcmaster.ca/jfox/}. \newblock R package version 1.1-1. \bibitem[Warnes(2006)]{WarnesGdata} G.~R. Warnes. \newblock \emph{gdata: Various R programming tools for data manipulation}, 2006. \newblock URL \url{http://cran.r-project.org/src/contrib/Descriptions/gdata.html}. \newblock R package version 2.3.1. Includes R source code and/or documentation contributed by Ben Bolker, Gregor Gorjanc and Thomas Lumley. \end{thebibliography} \address{Gregor Gorjanc\\ University of Ljubljana, Slovenia\\ \email{gregor.gorjanc@bfro.uni-lj.si}} \end{article} \end{document} gdata/inst/doc/unknown.Rnw0000644000176200001440000002342314441446535015261 0ustar liggesusers %\VignetteIndexEntry{Working with Unknown Values} %\VignettePackage{gdata} %\VignetteKeywords{unknown, missing, manip} \documentclass[a4paper]{report} \usepackage{Rnews} \usepackage[round]{natbib} \bibliographystyle{abbrvnat} \usepackage{Sweave} \SweaveOpts{strip.white=all, keep.source=TRUE} \SweaveOpts{concordance=TRUE} \begin{document} \begin{article} \title{Working with Unknown Values} \subtitle{The \pkg{gdata} package} \author{by Gregor Gorjanc} \maketitle This vignette has been published as \cite{Gorjanc}. \section{Introduction} Unknown or missing values can be represented in various ways. For example SAS uses \code{.}~(dot), while \R{} uses \code{NA}, which we can read as Not Available. When we import data into \R{}, say via \code{read.table} or its derivatives, conversion of blank fields to \code{NA} (according to \code{read.table} help) is done for \code{logical}, \code{integer}, \code{numeric} and \code{complex} classes. Additionally, the \code{na.strings} argument can be used to specify values that should also be converted to \code{NA}. Inversely, there is an argument \code{na} in \code{write.table} and its derivatives to define value that will replace \code{NA} in exported data. There are also other ways to import/export data into \R{} as described in the {\emph R Data Import/Export} manual \citep{RImportExportManual}. However, all approaches lack the possibility to define unknown value(s) for some particular column. It is possible that an unknown value in one column is a valid value in another column. For example, I have seen many datasets where values such as 0, -9, 999 and specific dates are used as column specific unknown values. This note describes a set of functions in package \pkg{gdata}\footnote{ package version 2.3.1} \citep{WarnesGdata}: \code{isUnknown}, \code{unknownToNA} and \code{NAToUnknown}, which can help with testing for unknown values and conversions between unknown values and \code{NA}. All three functions are generic (S3) and were tested (at the time of writing) to work with: \code{integer}, \code{numeric}, \code{character}, \code{factor}, \code{Date}, \code{POSIXct}, \code{POSIXlt}, \code{list}, \code{data.frame} and \code{matrix} classes. \section{Description with examples} The following examples show simple usage of these functions on \code{numeric} and \code{factor} classes, where value \code{0} (beside \code{NA}) should be treated as an unknown value: <>= library("gdata") xNum <- c(0, 6, 0, 7, 8, 9, NA) isUnknown(x=xNum) @ The default unknown value in \code{isUnknown} is \code{NA}, which means that output is the same as \code{is.na} --- at least for atomic classes. However, we can pass the argument \code{unknown} to define which values should be treated as unknown: <>= isUnknown(x=xNum, unknown=0) @ This skipped \code{NA}, but we can get the expected answer after appropriately adding \code{NA} into the argument \code{unknown}: <>= isUnknown(x=xNum, unknown=c(0, NA)) @ Now, we can change all unknown values to \code{NA} with \code{unknownToNA}. There is clearly no need to add \code{NA} here. This step is very handy after importing data from an external source, where many different unknown values might be used. Argument \code{warning=TRUE} can be used, if there is a need to be warned about ``original'' \code{NA}s: <>= (xNum2 <- unknownToNA(x=xNum, unknown=0)) @ Prior to export from \R{}, we might want to change unknown values (\code{NA} in \R{}) to some other value. Function \code{NAToUnknown} can be used for this: <>= NAToUnknown(x=xNum2, unknown=999) @ Converting \code{NA} to a value that already exists in \code{x} issues an error, but \code{force=TRUE} can be used to overcome this if needed. But be warned that there is no way back from this step: <>= NAToUnknown(x=xNum2, unknown=7, force=TRUE) @ Examples below show all peculiarities with class \code{factor}. \code{unknownToNA} removes \code{unknown} value from levels and inversely \code{NAToUnknown} adds it with a warning. Additionally, \code{"NA"} is properly distinguished from \code{NA}. It can also be seen that the argument \code{unknown} in functions \code{isUnknown} and \code{unknownToNA} need not match the class of \code{x} (otherwise factor should be used) as the test is internally done with \code{\%in\%}, which nicely resolves coercing issues. <>= (xFac <- factor(c(0, "BA", "RA", "BA", NA, "NA"))) isUnknown(x=xFac) isUnknown(x=xFac, unknown=0) isUnknown(x=xFac, unknown=c(0, NA)) isUnknown(x=xFac, unknown=c(0, "NA")) isUnknown(x=xFac, unknown=c(0, "NA", NA)) (xFac <- unknownToNA(x=xFac, unknown=0)) (xFac <- NAToUnknown(x=xFac, unknown=0)) @ These two examples with classes \code{numeric} and \code{factor} are fairly simple and we could get the same results with one or two lines of \R{} code. The real benefit of the set of functions presented here is in \code{list} and \code{data.frame} methods, where \code{data.frame} methods are merely wrappers for \code{list} methods. We need additional flexibility for \code{list}/\code{data.frame} methods, due to possibly having multiple unknown values that can be different among \code{list} components or \code{data.frame} columns. For these two methods, the argument \code{unknown} can be either a \code{vector} or \code{list}, both possibly named. Of course, greater flexibility (defining multiple unknown values per component/column) can be achieved with a \code{list}. When a \code{vector}/\code{list} object passed to the argument \code{unknown} is not named, the first value/component of a \code{vector}/\code{list} matches the first component/column of a \code{list}/\code{data.frame}. This can be quite error prone, especially with \code{vectors}. Therefore, I encourage the use of a \code{list}. In case \code{vector}/\code{list} passed to argument \code{unknown} is named, names are matched to names of \code{list} or \code{data.frame}. If lengths of \code{unknown} and \code{list} or \code{data.frame} do not match, recycling occurs. The example below illustrates the application of the described functions to a list which is composed of previously defined and modified numeric (\code{xNum}) and factor (\code{xFac}) classes. First, function \code{isUnknown} is used with \code{0} as an unknown value. Note that we get \code{FALSE} for \code{NA}s as has been the case in the first example. <>= (xList <- list(a=xNum, b=xFac)) isUnknown(x=xList, unknown=0) @ We need to add \code{NA} as an unknown value. However, we do not get the expected result this way! <>= isUnknown(x=xList, unknown=c(0, NA)) @ This is due to matching of values in the argument \code{unknown} and components in a \code{list}; i.e., \code{0} is used for component \code{a} and \code{NA} for component \code{b}. Therefore, it is less error prone and more flexible to pass a \code{list} (preferably a named list) to the argument \code{unknown}, as shown below. <>= (xList1 <- unknownToNA(x=xList, unknown=list(b=c(0, "NA"), a=0))) @ Changing \code{NA}s to some other value (only one per component/column) can be accomplished as follows: <>= NAToUnknown(x=xList1, unknown=list(b="no", a=0)) @ A named component \code{.default} of a \code{list} passed to argument \code{unknown} has a special meaning as it will match a component/column with that name and any other not defined in \code{unknown}. As such it is very useful if the number of components/columns with the same unknown value(s) is large. Consider a wide \code{data.frame} named \code{df}. Now \code{.default} can be used to define unknown value for several columns: <>= df <- data.frame(col1=c(0, 1, 999, 2), col2=c("a", "b", "c", "unknown"), col3=c(0, 1, 2, 3), col4=c(0, 1, 2, 2)) @ <>= tmp <- list(.default=0, col1=999, col2="unknown") (df2 <- unknownToNA(x=df, unknown=tmp)) @ If there is a need to work only on some components/columns you can of course ``skip'' columns with standard \R{} mechanisms, i.e., by subsetting \code{list} or \code{data.frame} objects: <>= df2 <- df cols <- c("col1", "col2") tmp <- list(col1=999, col2="unknown") df2[, cols] <- unknownToNA(x=df[, cols], unknown=tmp) df2 @ \section{Summary} Functions \code{isUnknown}, \code{unknownToNA} and \code{NAToUnknown} provide a useful interface to work with various representations of unknown/missing values. Their use is meant primarily for shaping the data after importing to or before exporting from \R{}. I welcome any comments or suggestions. % \bibliography{refs} \begin{thebibliography}{1} \providecommand{\natexlab}[1]{#1} \providecommand{\url}[1]{\texttt{#1}} \expandafter\ifx\csname urlstyle\endcsname\relax \providecommand{\doi}[1]{doi: #1}\else \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi \bibitem[Gorjanc(2007)]{Gorjanc} G.~Gorjanc. \newblock Working with unknown values: the gdata package. \newblock \emph{R News}, 7\penalty0 (1):\penalty0 24--26, 2007. \newblock URL \url{http://CRAN.R-project.org/doc/Rnews/Rnews_2007-1.pdf}. \bibitem[{R Development Core Team}(2006)]{RImportExportManual} {R Development Core Team}. \newblock \emph{R Data Import/Export}, 2006. \newblock URL \url{http://cran.r-project.org/manuals.html}. \newblock ISBN 3-900051-10-0. \bibitem[Warnes (2006)]{WarnesGdata} G.~R. Warnes. \newblock \emph{gdata: Various R programming tools for data manipulation}, 2006. \newblock URL \url{http://cran.r-project.org/src/contrib/Descriptions/gdata.html}. \newblock R package version 2.3.1. Includes R source code and/or documentation contributed by Ben Bolker, Gregor Gorjanc and Thomas Lumley. \end{thebibliography} \address{Gregor Gorjanc\\ University of Ljubljana, Slovenia\\ \email{gregor.gorjanc@bfro.uni-lj.si}} \end{article} \end{document} gdata/inst/doc/mapLevels.R0000644000176200001440000000346014511013460015125 0ustar liggesusers### R code from vignette source 'mapLevels.Rnw' ################################################### ### code chunk number 1: ex01 ################################################### library(gdata) (fac <- factor(c("B", "A", "Z", "D"))) (map <- mapLevels(x=fac)) ################################################### ### code chunk number 2: ex02 ################################################### (int <- as.integer(fac)) mapLevels(x=int) <- map int identical(fac, int) ################################################### ### code chunk number 3: ex03 ################################################### str(map) ################################################### ### code chunk number 4: ex04 ################################################### map[[2]] <- as.integer(c(1, 2)) map int <- as.integer(fac) mapLevels(x=int) <- map int ################################################### ### code chunk number 5: ex05 ################################################### (f1 <- factor(c("A", "D", "C"))) (f2 <- factor(c("B", "D", "C"))) ################################################### ### code chunk number 6: ex06 ################################################### fTest <- f1 levels(fTest) <- c("A", "B", "C", "D") fTest ################################################### ### code chunk number 7: ex07 ################################################### fTest <- f1 levels(fTest) <- list(A="A", B="B", C="C", D="D") fTest ################################################### ### code chunk number 8: ex08 ################################################### (bigMap <- mapLevels(x=list(f1, f2), codes=FALSE, combine=TRUE)) mapLevels(f1) <- bigMap mapLevels(f2) <- bigMap f1 f2 cbind(as.character(f1), as.integer(f1), as.character(f2), as.integer(f2)) gdata/inst/doc/mapLevels.pdf0000644000176200001440000031677314511013460015513 0ustar liggesusers%PDF-1.5 % 1 0 obj << /Length 282 >> stream concordance:mapLevels.tex:mapLevels.Rnw:1 51 1 1 2 1 0 1 1 6 0 1 1 7 0 1 2 6 1 1 2 6 0 2 1 6 0 1 1 6 0 1 2 7 1 1 2 12 0 1 2 6 1 1 2 1 0 1 1 6 0 3 1 7 0 1 2 9 1 1 2 7 0 1 1 7 0 1 2 6 1 1 2 1 0 2 1 7 0 1 2 4 1 1 2 1 0 1 2 1 0 1 1 7 0 1 2 17 1 1 4 9 0 3 1 6 0 1 1 6 0 1 2 10 0 1 2 68 1 endstream endobj 27 0 obj << /Length 3580 /Filter /FlateDecode >> stream xn_!yChxܚuZ <-+*IY /k&@9s83guj̾xys7I8h3iQ6KOM:Yy_\ux߽2.xsD7*~o/^\BdL2 c?Hlx{0[¿ogf@-(U~E0Yo4ӑ1Џ]YxQش w\\勮np4@`6ס)f]p2._W5}cYwA+uZ#0^U+JGi GƭО`ax@@D@duMyWW3ER]VwuiRϓtJbnۓ:Jۢ;E 芦7 kʢ^-ʫy/9:&}SGKaaA,{ޔMq #hR:j%øoȮs<^0Jh ).h5u06ݺޯV:y][jX|oS/b&m_\Σ uQ67ajV~ (J-+.aֵ!Ɉ}.W澠u"y'l.R ɮ~ 8s\Cw*!ȼۼ?s@}#/e׈GԲO aWq{o$r[?NUEddzJl h5bݳR6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APyt4sk)$Q "7A?g@c(3jok9E u9/d86dq/@cNiЃ9eyDH{f@/Z`~G. И!`DoSc_ BZ }%m<;4x{[W<Q $R1R R2R:dA3NUAUI5'ZG-^GGGG$zE"ZGmΉ..h$q41q1//fm|T ֵiKN" endstream endobj 74 0 obj << /Length 672 /Filter /FlateDecode >> stream xmTn0C6*drضj^pHA@Cfy'n`g#govh/}eg羋򶺜m=Ooٽ[׌uRۉ=Iۏw{VQҜ8ߛIߞ3d_ ~~hZ# W c *'qU;HHV7xwuɻa;zopO_`_ݥNd0m6G_?[6vLClw6ZsaD%!p%blcä  PP[ u_g_x4$O<X^\NB8 \;cBbMx y%P 3jok:E q:/d48Q4A2="\šY+ːs(5$Y r~+A\HȕWr{Nxo $TL~K//p1sQ*GG-G-GzA>|)3Q/G""&!uN>|%h8hh$hb,n~ᰏnˣ+p]h \2 M endstream endobj 75 0 obj << /Length 663 /Filter /FlateDecode >> stream xmTMo0WxvB+8l[jWHL7RI;onDo3ތ?n~<&Y$ŝK_IsE77E[^N\5sߖ;7|[lzmS_*7F?h3ONL7u]~l+l+w͛R.bYFr8)9>*QKr7P:MȡQ^s$LD6aȑ*s.$S56`>ƄmÁ#TL 5kd}WXssc*{Rh/#? bE$L|ږ8^y>eSQc̯bV̯cNa'_OAJ195kd3EH@8ܰ%~As*=F 0`{RLPh33Y$LƹǬ oqMsȼ tx\ \cΜ-eksL ?"@>qhx ׷=l~1֍>*]!Ma@ endstream endobj 76 0 obj << /Length 663 /Filter /FlateDecode >> stream xmTMo0WxvB+8l[+ML7RI;onDo3ތ?n~<&YվI|/ŋ;t硋nn\3<:Wj\=?-wn6pGۦ|Tnʽgxt{o $Nߗj s6BK)ɱn=A9n1 9Ң!X-O4$>΃;mc-bB`ew\_7o Y KQ#^''ߛ.?:'4ʫ)ʝCC梅Klkok*ؔb%9v r(CXYh&(9O&"f0H9)Dhbc6a@*&GY52־+vĎ]=\ ~ҟ"t&g>mK z> stream xmTn0C6U@"mTt@;olvR3ތm~<&YվI|+œs_IsEWWE[9;Wj|;܉Ǿ-w$mm o\1A+Z7g{uo}m $|{'Bp/u u+$bTy{!y1 GҢSX< {NmmXN;{}y[Dδt d\{?:1 kmn_~߼h!R,6ew*ؔb%k e+Kӄ$a"1x*s.$S56P>Ƅm„A Fs 5577vرϾ+uaя6R:!,əCxg+ѧy*JcL|*m:fvuiWUꧏɩ\g%<Ϛ"sÖ0_:3x0kjhyIYx0aCnOg3$cx0<<v5O#ܵu7A 6*sZ ZcΜ-ܠeYksL ?"@>qh|tngk;dGGMc endstream endobj 78 0 obj << /Length 664 /Filter /FlateDecode >> stream xmTn0C6U@"mTt@;olvR3ތm~<&YվI|+œs_IsEWWE[9;Wj|;܉Ǿ-w$mm o\1A+Z7g{uo}k $|{'Bp/u u+$bTy{!y1 GҢSX< {NmmXN;{}y[Dδt d\{?:1 kmn_~߼h!R,6ew*ؔb%k e+Kӄ$a"1x*s.$S56P>Ƅm„A Fs 5577vرϾ+uaя6R:!,əCxg+ѧy*JcL|*m:fvuiWUꧏɩ\g%<Ϛ"sÖ0_:3x0kjhyIYx0aCnOg3$cx0<<v5O#ܵu7A 6*sZ ZcΜ-ܠeYksL ?"@>qh|tngk;dGGMc endstream endobj 86 0 obj << /Producer (pdfTeX-1.40.22) /Author()/Title()/Subject()/Creator(LaTeX with hyperref)/Keywords() /CreationDate (D:20231010020727+11'00') /ModDate (D:20231010020727+11'00') /Trapped /False /PTEX.Fullbanner (This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian) kpathsea version 6.3.4/dev) >> endobj 3 0 obj << /Type /ObjStm /N 68 /First 521 /Length 2862 /Filter /FlateDecode >> stream xZrF}W5SBt7Rhlg$ۥ%N``@<_?6If!.}d!3L fpI1!t TDLG1ꙎC&b)d"F=LJt̤bA[Qb 6 ͔hPh$h`D$P`l MPc,4q06 CFP2 '-@HAƊE `K 4 HBJ(b*rEM!.OB0gE.a0(^`тabD E$Z *b;l ڕb.t΁clL\\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