r-gregmisc-users Mailing List for R gregmisc package (Page 40)
Brought to you by:
warnes
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(12) |
Apr
(5) |
May
(3) |
Jun
(5) |
Jul
(2) |
Aug
(5) |
Sep
(7) |
Oct
(15) |
Nov
(34) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(3) |
Feb
(16) |
Mar
(28) |
Apr
(5) |
May
|
Jun
(5) |
Jul
(9) |
Aug
(50) |
Sep
(29) |
Oct
(9) |
Nov
(25) |
Dec
(7) |
2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(8) |
May
(26) |
Jun
(11) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
2009 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
(26) |
Jun
|
Jul
(10) |
Aug
(6) |
Sep
|
Oct
(7) |
Nov
(3) |
Dec
(2) |
2010 |
Jan
(45) |
Feb
(11) |
Mar
|
Apr
(1) |
May
(8) |
Jun
(7) |
Jul
(3) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(9) |
Dec
(1) |
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(14) |
Sep
(29) |
Oct
(3) |
Nov
|
Dec
(3) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
(6) |
Jun
(59) |
Jul
|
Aug
(8) |
Sep
(21) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
(10) |
Apr
|
May
(18) |
Jun
(25) |
Jul
(18) |
Aug
(1) |
Sep
(6) |
Oct
(28) |
Nov
(4) |
Dec
(13) |
2014 |
Jan
(7) |
Feb
(5) |
Mar
(4) |
Apr
(36) |
May
(3) |
Jun
(7) |
Jul
(46) |
Aug
(14) |
Sep
(12) |
Oct
(2) |
Nov
|
Dec
(12) |
2015 |
Jan
(4) |
Feb
|
Mar
|
Apr
(80) |
May
(36) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <wa...@us...> - 2006-11-14 18:29:54
|
Revision: 1011 http://svn.sourceforge.net/r-gregmisc/?rev=1011&view=rev Author: warnes Date: 2006-11-14 10:29:49 -0800 (Tue, 14 Nov 2006) Log Message: ----------- Create 2.3.2 tag Added Paths: ----------- tags/gdata-2.3.2/gdata/ Copied: tags/gdata-2.3.2/gdata (from rev 1010, trunk/gdata) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2006-11-14 18:29:38
|
Revision: 1010 http://svn.sourceforge.net/r-gregmisc/?rev=1010&view=rev Author: warnes Date: 2006-11-14 10:29:35 -0800 (Tue, 14 Nov 2006) Log Message: ----------- Update output file to match (trivial) changes in the test code. Modified Paths: -------------- trunk/gplots/tests/heatmap2Test.Rout.save Modified: trunk/gplots/tests/heatmap2Test.Rout.save =================================================================== --- trunk/gplots/tests/heatmap2Test.Rout.save 2006-11-14 18:13:02 UTC (rev 1009) +++ trunk/gplots/tests/heatmap2Test.Rout.save 2006-11-14 18:29:35 UTC (rev 1010) @@ -1,6 +1,7 @@ -R : Copyright 2005, The R Foundation for Statistical Computing -Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 +R version 2.4.0 (2006-10-03) +Copyright (C) 2006 The R Foundation for Statistical Computing +ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. @@ -11,12 +12,9 @@ '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 a HTML browser interface to help. +'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. -[1] "Repostitories set to: CRAN, CRANextra, BioC, Omegahat -> ~/.Rprofile" -> invisible(options(echo = TRUE)) -> .libPaths("~/Rlib") > library(gplots) Loading required package: gtools Loading required package: gdata @@ -29,13 +27,11 @@ lowess > -> #source("/home/jainn02/projects/gregmisc/gplots/R/heatmap.2.R") +> data(mtcars) +> x <- as.matrix(mtcars) +> rc <- rainbow(nrow(x), start=0, end=.3) +> cc <- rainbow(ncol(x), start=0, end=.3) > -> data(mtcars) -> x <- as.matrix(mtcars) -> rc <- rainbow(nrow(x), start=0, end=.3) -> cc <- rainbow(ncol(x), start=0, end=.3) -> > heatmap.2(x) ## default - dendrogram plotted and reordering done. > heatmap.2(x, dendrogram="none") ## no dendrogram plotted, but reordering done. > heatmap.2(x, dendrogram="row") ## row dendrogram plotted and row reordering done. @@ -108,6 +104,4 @@ $ rowInd: int [1:32] 31 17 16 15 5 25 29 24 7 6 ... $ colInd: int [1:11] 2 9 8 11 6 5 10 7 1 4 ... > -> proc.time() -[1] 3.65 0.47 6.82 0.01 0.00 > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2006-11-14 18:13:04
|
Revision: 1009 http://svn.sourceforge.net/r-gregmisc/?rev=1009&view=rev Author: warnes Date: 2006-11-14 10:13:02 -0800 (Tue, 14 Nov 2006) Log Message: ----------- Create 2.3.2 tag Added Paths: ----------- tags/gdata-2.3.2/ Copied: tags/gdata-2.3.2 (from rev 1008, trunk/gdata) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2006-11-14 18:09:04
|
Revision: 1008 http://svn.sourceforge.net/r-gregmisc/?rev=1008&view=rev Author: warnes Date: 2006-11-14 10:07:31 -0800 (Tue, 14 Nov 2006) Log Message: ----------- Update ChangeLog and NEWS files for release 2.3.2. Modified Paths: -------------- trunk/gplots/ChangeLog trunk/gplots/NEWS Modified: trunk/gplots/ChangeLog =================================================================== --- trunk/gplots/ChangeLog 2006-11-14 17:59:51 UTC (rev 1007) +++ trunk/gplots/ChangeLog 2006-11-14 18:07:31 UTC (rev 1008) @@ -1,200 +1,262 @@ +2006-11-14 17:56 warnes + + * man/heatmap.2.Rd: Correct problem with labeled correlation matrix + example. Thanks to Jean Vidal for reporting the error.. + +2006-08-02 22:21 warnes + + * trunk/BalloonPlotPaper/BalloonPlot.pdf, + trunk/BalloonPlotPaper/BalloonPlot.tex, + trunk/MSOfficeUtil/DESCRIPTION, + trunk/PathwayModeling/thesispaper/slides.tex, + trunk/RMCMC/DESCRIPTION, trunk/RMCMC/man/make.density.Rd, + trunk/Rlsf/DESCRIPTION, trunk/Rlsf/man/lsf.numcpu.Rd, + trunk/Rlsf/man/lsf.parRapply.Rd, trunk/Rlsf/man/scat.Rd, + trunk/bwRF/DESCRIPTION, trunk/bwRF/man/RF.Rd, + trunk/exp.ssize/inst/doc/ssize.pdf, + trunk/exp.ssize/inst/doc/ssize.tex, trunk/fork/DESCRIPTION, + trunk/fork/man/exit.Rd, trunk/fork/man/fork.Rd, + trunk/fork/man/getpid.Rd, trunk/fork/man/kill.Rd, + trunk/fork/man/signame.Rd, trunk/fork/man/wait.Rd, + trunk/gdata/inst/doc/gregmisc.tex, + trunk/gdata/man/ConvertMedUnits.Rd, + trunk/gdata/man/aggregate.table.Rd, trunk/gdata/man/combine.Rd, + trunk/gdata/man/interleave.Rd, trunk/gdata/man/matchcols.Rd, + trunk/gdata/man/nobs.Rd, trunk/gdata/man/read.xls.Rd, + trunk/gdata/man/rename.vars.Rd, trunk/gdata/man/reorder.Rd, + trunk/gdata/man/trim.Rd, trunk/gdata/man/unmatrix.Rd, + trunk/gdata/man/upperTriangle.Rd, + trunk/gmodels/man/fast.prcomp.Rd, + trunk/gmodels/man/fit.contrast.Rd, trunk/gmodels/man/glh.test.Rd, + trunk/gmodels/man/make.contrasts.Rd, inst/doc/BalloonPlot.pdf, + man/balloonplot.Rd, man/bandplot.Rd, man/boxplot.n.Rd, + man/colorpanel.Rd, man/hist2d.Rd, man/ooplot.Rd, man/overplot.Rd, + man/plot.lm2.Rd, man/plotCI.Rd, man/plotmeans.Rd, + man/residplot.Rd, man/sinkplot.Rd, man/smartlegend.Rd, + man/space.Rd, man/textplot.Rd, man/wapply.Rd, + trunk/gregmisc/DESCRIPTION, + trunk/gregmisc/gregmisc/DESCRIPTION.standalone, + trunk/gregmisc/inst/doc/gregmisc.tex, + trunk/gtools/man/addLast.Rd, trunk/gtools/man/assert.Rd, + trunk/gtools/man/capture.Rd, trunk/gtools/man/combinations.Rd, + trunk/gtools/man/defmacro.Rd, trunk/gtools/man/dirichlet.Rd, + trunk/gtools/man/foldchange.Rd, trunk/gtools/man/invalid.Rd, + trunk/gtools/man/logit.Rd, trunk/gtools/man/mixedsort.Rd, + trunk/gtools/man/oddeven.Rd, trunk/gtools/man/permute.Rd, + trunk/gtools/man/quantcut.Rd, trunk/gtools/man/running.Rd, + trunk/gtools/man/scat.Rd, trunk/gtools/man/setTCPNoDelay.Rd, + trunk/nws/DESCRIPTION, trunk/qvalue/DESCRIPTION, + trunk/qvalue/man/print.qvalue.Rd, trunk/ssize/DESCRIPTION, + trunk/ssize/man/pow.Rd: Update my email address + +2006-06-26 21:08 nj7w + + * R/heatmap.2.R: Fixed a bug which displayed warnings when Rowv and + Colv were specified as dendrograms + +2006-03-10 17:24 warnes + + * tests/heatmap2Test.R: Remove code that added a local path + +2006-03-09 22:53 nj7w + + * tests/heatmap2Test.R, tests/heatmap2Test.Rout.save: Added the + correct library path where gplots is installed locally and + corresponding .save file + +2006-03-09 22:40 nj7w + + * tests/heatmap2Test.R: Updated the tests file + +2006-03-09 22:39 nj7w + + * R/heatmap.2.R: Removed the condition Colv != Rowv as it has + already been taken care of + +2006-03-09 22:17 nj7w + + * rtPCR.rda: Deleted rtPCR.rda from the main directory + +2006-03-09 22:09 nj7w + + * ChangeLog: Added ChangeLog + +2006-03-07 18:18 nj7w + + * DESCRIPTION, NEWS: Updated ChangeLog and NEWS + +2006-03-07 18:10 nj7w + + * tests, tests/heatmap2Test.R, tests/heatmap2Test.Rout.save: Added + the tests and fixed corrupted files + 2006-03-07 16:22 nj7w - * trunk/gplots/data/rtPCR.rda: Replaced the corrupted rtPCR.rda - file in data directory + * data/rtPCR.rda: Replaced the corrupted rtPCR.rda file in data + directory 2006-03-07 16:14 nj7w - * trunk/gplots/tests: Removed the corrputed tests directory + * tests: Removed the corrputed tests directory 2006-03-07 16:12 nj7w - * trunk/gplots/data/rtPCR.rda, trunk/gplots/rtPCR.rda: Replaced - the corrupted rtPCR.rda file in data directory + * data/rtPCR.rda, rtPCR.rda: Replaced the corrupted rtPCR.rda file + in data directory 2006-03-03 21:03 nj7w - * trunk/gplots/R/heatmap.2.R, trunk/gplots/man/heatmap.2.Rd: - Updated the code and man page to make sure the Rowv and Colv - values are properly handled + * R/heatmap.2.R, man/heatmap.2.Rd: Updated the code and man page to + make sure the Rowv and Colv values are properly handled 2006-03-02 21:43 warnes - * trunk/gplots/R/balloonplot.R: Adjust row total placement to - adjust for width of the totals + * R/balloonplot.R: Adjust row total placement to adjust for width + of the totals 2006-03-02 21:26 warnes - * trunk/gplots/DESCRIPTION, trunk/gplots/R/balloonplot.R, - trunk/gplots/man/1: Row totals in ballonplot were in reverse - order. Fixed. + * DESCRIPTION, R/balloonplot.R, man/1: Row totals in ballonplot + were in reverse order. Fixed. 2006-02-23 22:00 nj7w - * trunk/gplots/R/heatmap.2.R, trunk/gplots/tests/heatmap2Test.R: - Add ability to scale the color key using the new 'keysize' - argument. + * R/heatmap.2.R, tests/heatmap2Test.R: Add ability to scale the + color key using the new 'keysize' argument. 2006-02-23 21:34 nj7w - * trunk/gplots/tests, trunk/gplots/tests/heatmap2Test.R, - trunk/gplots/tests/heatmap2Test.Rout.save: Add tests for - heatmap.2 + * tests, tests/heatmap2Test.R, tests/heatmap2Test.Rout.save: Add + tests for heatmap.2 2006-02-23 21:25 nj7w - * trunk/gplots/inst/doc/Figure1.eps, - trunk/gplots/inst/doc/Table.eps, trunk/gplots/inst/doc/bka.bst, - trunk/gplots/inst/doc/heatmap2.R, - trunk/gplots/inst/doc/heatmap2.tex, - trunk/gplots/inst/doc/regression_rank_image.Rda, - trunk/gplots/inst/doc/regression_rank_image_II.Rda: Move heatmap - and ballonplot paper source materials to their respective cvs - modules + * inst/doc/Figure1.eps, inst/doc/Table.eps, inst/doc/bka.bst, + inst/doc/heatmap2.R, inst/doc/heatmap2.tex, + inst/doc/regression_rank_image.Rda, + inst/doc/regression_rank_image_II.Rda: Move heatmap and + ballonplot paper source materials to their respective cvs modules 2006-02-23 21:20 nj7w - * trunk/gplots/inst/doc/BalloonPlot.R, - trunk/gplots/inst/doc/BalloonPlot.tex, - trunk/gplots/inst/doc/Figure1.pdf, - trunk/gplots/inst/doc/Figure2.pdf, - trunk/gplots/inst/doc/Figure3.pdf, - trunk/gplots/inst/doc/Figure4.pdf, - trunk/gplots/inst/doc/Rnews.sty, - trunk/gplots/inst/doc/SurvivedPop.pdf, - trunk/gplots/inst/doc/SurvivedPopWhite.pdf, - trunk/gplots/inst/doc/SurvivedProp.pdf, - trunk/gplots/inst/doc/TotalPop.pdf: Moved balloonplot paper - materials to BallonPlotPaper cvs module + * inst/doc/BalloonPlot.R, inst/doc/BalloonPlot.tex, + inst/doc/Figure1.pdf, inst/doc/Figure2.pdf, inst/doc/Figure3.pdf, + inst/doc/Figure4.pdf, inst/doc/Rnews.sty, + inst/doc/SurvivedPop.pdf, inst/doc/SurvivedPopWhite.pdf, + inst/doc/SurvivedProp.pdf, inst/doc/TotalPop.pdf: Moved + balloonplot paper materials to BallonPlotPaper cvs module 2006-02-23 21:18 nj7w - * trunk/gplots/inst/doc/colSeparator.pdf, - trunk/gplots/inst/doc/logData.pdf, - trunk/gplots/inst/doc/logDataColDendrogram.pdf, - trunk/gplots/inst/doc/logDataColOrd.pdf, - trunk/gplots/inst/doc/logDataColOrdNo.pdf, - trunk/gplots/inst/doc/logDataRowDendrogram.pdf, - trunk/gplots/inst/doc/origScale.pdf, - trunk/gplots/inst/doc/rowSeparator.pdf, - trunk/gplots/inst/doc/scaled.pdf: Remove heatmap paper files and - move them to the HeatmapPaper cvs module. + * inst/doc/colSeparator.pdf, inst/doc/logData.pdf, + inst/doc/logDataColDendrogram.pdf, inst/doc/logDataColOrd.pdf, + inst/doc/logDataColOrdNo.pdf, inst/doc/logDataRowDendrogram.pdf, + inst/doc/origScale.pdf, inst/doc/rowSeparator.pdf, + inst/doc/scaled.pdf: Remove heatmap paper files and move them to + the HeatmapPaper cvs module. 2006-02-23 19:57 nj7w - * trunk/gplots/inst/doc/colSeparator.pdf, - trunk/gplots/inst/doc/logData.pdf, - trunk/gplots/inst/doc/logDataColDendrogram.pdf, - trunk/gplots/inst/doc/logDataColOrd.pdf, - trunk/gplots/inst/doc/logDataColOrdNo.pdf, - trunk/gplots/inst/doc/logDataRowDendrogram.pdf, - trunk/gplots/inst/doc/origScale.pdf, - trunk/gplots/inst/doc/rowSeparator.pdf, - trunk/gplots/inst/doc/scaled.pdf: Added figures for heatmap2 - paper + * inst/doc/colSeparator.pdf, inst/doc/logData.pdf, + inst/doc/logDataColDendrogram.pdf, inst/doc/logDataColOrd.pdf, + inst/doc/logDataColOrdNo.pdf, inst/doc/logDataRowDendrogram.pdf, + inst/doc/origScale.pdf, inst/doc/rowSeparator.pdf, + inst/doc/scaled.pdf: Added figures for heatmap2 paper 2006-02-23 19:54 nj7w - * trunk/gplots/inst/doc/regression_rank_image.Rda, - trunk/gplots/inst/doc/regression_rank_image_II.Rda: Added the - .Rda files for the heatmap2 paper + * inst/doc/regression_rank_image.Rda, + inst/doc/regression_rank_image_II.Rda: Added the .Rda files for + the heatmap2 paper 2006-02-23 19:52 nj7w - * trunk/gplots/inst/doc/heatmap2.tex: Added the source - (tex - file) of the heatmap paper + * inst/doc/heatmap2.tex: Added the source - (tex file) of the + heatmap paper 2006-02-23 19:51 nj7w - * trunk/gplots/inst/doc/heatmap2.R: Added the code for the figures - of heatmap paper + * inst/doc/heatmap2.R: Added the code for the figures of heatmap + paper 2006-02-21 22:19 nj7w - * trunk/gplots/R/heatmap.2.R, trunk/gplots/man/heatmap.2.Rd: Minor - updates to heatmap.2 - fixed Rowv, Colv and dendrogram - behaviour. Now Rowv=NULL or FALSE both imply no dendrogram - computation. + * R/heatmap.2.R, man/heatmap.2.Rd: Minor updates to heatmap.2 - + fixed Rowv, Colv and dendrogram behaviour. Now Rowv=NULL or FALSE + both imply no dendrogram computation. 2006-01-12 23:10 warnes - * trunk/gplots/inst/doc/BalloonPlot.R, - trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/BalloonPlot.tex, - trunk/gplots/inst/doc/Figure1.pdf, - trunk/gplots/inst/doc/Figure2.pdf, - trunk/gplots/inst/doc/Figure3.pdf, - trunk/gplots/inst/doc/Figure4.pdf: more updates + * inst/doc/BalloonPlot.R, inst/doc/BalloonPlot.pdf, + inst/doc/BalloonPlot.tex, inst/doc/Figure1.pdf, + inst/doc/Figure2.pdf, inst/doc/Figure3.pdf, inst/doc/Figure4.pdf: + more updates 2006-01-12 23:01 warnes - * trunk/gplots/inst/doc/bka.bst: Add Biometrica bibliography style - file + * inst/doc/bka.bst: Add Biometrica bibliography style file 2006-01-12 22:34 warnes - * trunk/gplots/inst/doc/BalloonPlot.tex: A little more. + * inst/doc/BalloonPlot.tex: A little more. 2006-01-12 22:32 warnes - * trunk/gplots/inst/doc/BalloonPlot.tex: Updates to respond to - referee. + * inst/doc/BalloonPlot.tex: Updates to respond to referee. 2006-01-12 19:59 nj7w - * trunk/gplots/inst/doc/BalloonPlot.tex: Added references + * inst/doc/BalloonPlot.tex: Added references 2005-12-13 17:01 nj7w - * trunk/gplots/inst/doc/BalloonPlot.tex: Fixed Nitin's company name + * inst/doc/BalloonPlot.tex: Fixed Nitin's company name 2005-12-13 16:18 nj7w - * trunk/gplots/ChangeLog, trunk/gplots/NEWS, trunk/gtools/NEWS: - Updated NEWS and removed ChangeLog + * ChangeLog, NEWS, trunk/gtools/NEWS: Updated NEWS and removed + ChangeLog 2005-12-12 22:20 nj7w - * trunk/gplots/R/plotmeans.R: Fixed bug in plotmeans - based on - Stefano Calza's suggestion + * R/plotmeans.R: Fixed bug in plotmeans - based on Stefano Calza's + suggestion 2005-12-07 18:52 nj7w - * trunk/gplots/DESCRIPTION: Updated version number + * DESCRIPTION: Updated version number 2005-12-07 18:50 nj7w - * trunk/gplots/NAMESPACE, trunk/gplots/R/plot.lm.R, - trunk/gplots/man/plot.lm2.Rd: Added plot.lm + * NAMESPACE, R/plot.lm.R, man/plot.lm2.Rd: Added plot.lm 2005-12-07 18:48 nj7w - * trunk/gplots/man/barplot2.Rd: Changed the default grey colors to - heat colors, if height is matrix - * trunk/gplots/R/barplot2.R: Changed the default greay colors to - heat colors, if height is matrix + * man/barplot2.Rd: Changed the default grey colors to heat colors, + if height is matrix +2005-12-07 18:48 nj7w + + * R/barplot2.R: Changed the default greay colors to heat colors, if + height is matrix + 2005-12-06 22:41 nj7w - * trunk/gplots/man/barplot2.Rd: Fixed minor error in documentation - of barplot2 + * man/barplot2.Rd: Fixed minor error in documentation of barplot2 2005-12-02 21:11 warnes - * trunk/gplots/R/plot.lm.R: Remove .Alias calls, since .Alias is - defunct. + * R/plot.lm.R: Remove .Alias calls, since .Alias is defunct. 2005-12-01 16:54 nj7w * trunk/gmodels/man/ci.Rd, trunk/gmodels/man/coefFrame.Rd, trunk/gmodels/man/estimable.Rd, trunk/gmodels/man/fit.contrast.Rd, - trunk/gmodels/man/make.contrasts.Rd, - trunk/gplots/man/balloonplot.Rd, trunk/gplots/man/bandplot.Rd, - trunk/gplots/man/boxplot.n.Rd, trunk/gplots/man/colorpanel.Rd, - trunk/gplots/man/overplot.Rd, trunk/gplots/man/plotmeans.Rd, - trunk/gplots/man/textplot.Rd, trunk/gplots/man/wapply.Rd, - trunk/gtools/man/combinations.Rd, + trunk/gmodels/man/make.contrasts.Rd, man/balloonplot.Rd, + man/bandplot.Rd, man/boxplot.n.Rd, man/colorpanel.Rd, + man/overplot.Rd, man/plotmeans.Rd, man/textplot.Rd, + man/wapply.Rd, trunk/gtools/man/combinations.Rd, trunk/gtools/man/foldchange.Rd, trunk/gtools/man/invalid.Rd, trunk/gtools/man/logit.Rd, trunk/gtools/man/mixedsort.Rd, trunk/gtools/man/oddeven.Rd, trunk/gtools/man/quantcut.Rd, @@ -202,187 +264,179 @@ 2005-11-23 22:05 nj7w - * trunk/gplots/inst/doc/BalloonPlot.R, - trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/BalloonPlot.tex, - trunk/gplots/inst/doc/Figure2.pdf: Updated Figure 2 colors + * inst/doc/BalloonPlot.R, inst/doc/BalloonPlot.pdf, + inst/doc/BalloonPlot.tex, inst/doc/Figure2.pdf: Updated Figure 2 + colors 2005-11-18 20:40 warnes - * trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/Figure1.pdf, - trunk/gplots/inst/doc/Figure2.pdf, - trunk/gplots/inst/doc/Figure3.pdf, - trunk/gplots/inst/doc/Figure4.pdf: Latest version of the pdf - files + * inst/doc/BalloonPlot.pdf, inst/doc/Figure1.pdf, + inst/doc/Figure2.pdf, inst/doc/Figure3.pdf, inst/doc/Figure4.pdf: + Latest version of the pdf files 2005-11-18 20:37 warnes - * trunk/gplots/inst/doc/BalloonPlot.tex: Nitin works for the - Cambrige Group, not Pfizer. + * inst/doc/BalloonPlot.tex: Nitin works for the Cambrige Group, not + Pfizer. 2005-11-18 20:34 warnes - * trunk/gplots/inst/doc/BalloonPlot.tex: Minor text rewording. + * inst/doc/BalloonPlot.tex: Minor text rewording. 2005-11-18 20:31 warnes - * trunk/gplots/inst/doc/BalloonPlot.R, - trunk/gplots/inst/doc/BalloonPlot.tex: More edits. + * inst/doc/BalloonPlot.R, inst/doc/BalloonPlot.tex: More edits. 2005-11-18 19:50 warnes - * trunk/gplots/R/balloonplot.R: Recent changes to align row totals - with the overall total broke how + * R/balloonplot.R: Recent changes to align row totals with the + overall total broke how the marginal cumulative fractions were displayed. This patch fixes the problem. 2005-11-18 01:17 warnes - * trunk/gplots/DESCRIPTION, trunk/gplots/R/balloonplot.R, - trunk/gplots/R/plot.lm.R, trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/man/balloonplot.Rd: - Update documentation for - balloonplot to match the latest code. + * DESCRIPTION, R/balloonplot.R, R/plot.lm.R, + inst/doc/BalloonPlot.pdf, man/balloonplot.Rd: - Update + documentation for balloonplot to match the latest code. - Correct spelling of 'show.zeroes' to 'show.zeros' 2005-11-18 00:16 warnes - * trunk/gplots/R/colorpanel.R: More changes: colorpanel now allows - only 2 colors to be specified if + * R/colorpanel.R: More changes: colorpanel now allows only 2 colors + to be specified if no 'middle' color is desired. 2005-11-17 22:08 warnes - * trunk/gplots/R/balloonplot.R: Allow user to control removal of - duplicate entries in balloonplot. + * R/balloonplot.R: Allow user to control removal of duplicate + entries in balloonplot. 2005-11-17 22:06 warnes - * trunk/gplots/R/colorpanel.R, trunk/gplots/man/colorpanel.Rd: - Extend colorpanel to handle just two-colors in addition to three. + * R/colorpanel.R, man/colorpanel.Rd: Extend colorpanel to handle + just two-colors in addition to three. 2005-11-09 22:39 nj7w - * trunk/gplots/inst/doc/BalloonPlot.pdf: Updated the pdf file + * inst/doc/BalloonPlot.pdf: Updated the pdf file 2005-11-09 22:38 nj7w - * trunk/gplots/inst/doc/BalloonPlot.R, - trunk/gplots/inst/doc/BalloonPlot.tex: Updated the changes + * inst/doc/BalloonPlot.R, inst/doc/BalloonPlot.tex: Updated the + changes 2005-11-09 22:29 nj7w - * trunk/gplots/inst/doc/Figure4.pdf: Modified figure 4 - * trunk/gplots/inst/doc/BalloonPlot.R: Updated code + * inst/doc/Figure4.pdf: Modified figure 4 +2005-11-09 22:29 nj7w + + * inst/doc/BalloonPlot.R: Updated code + 2005-11-09 22:20 nj7w - * trunk/gplots/inst/doc/Figure3.pdf: Modified figure 3 - * trunk/gplots/inst/doc/Figure2.pdf: Modified figure 2 + * inst/doc/Figure3.pdf: Modified figure 3 +2005-11-09 22:20 nj7w + + * inst/doc/Figure2.pdf: Modified figure 2 + 2005-11-09 22:19 nj7w - * trunk/gplots/inst/doc/Figure1.pdf: Modified figure 1 + * inst/doc/Figure1.pdf: Modified figure 1 2005-11-08 16:19 nj7w - * trunk/gplots/man/plotCI.Rd: Updated Greg's email + * man/plotCI.Rd: Updated Greg's email 2005-11-07 16:58 nj7w - * trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/BalloonPlot.tex: Minor modifications to - fit the code properly on pdf + * inst/doc/BalloonPlot.pdf, inst/doc/BalloonPlot.tex: Minor + modifications to fit the code properly on pdf 2005-11-07 14:22 warnes - * trunk/gplots/inst/doc/BalloonPlot.R: Add R code that generates - plots + * inst/doc/BalloonPlot.R: Add R code that generates plots 2005-11-07 14:18 warnes - * trunk/gplots/inst/doc/Figure2.pdf, - trunk/gplots/inst/doc/Figure3.pdf, - trunk/gplots/inst/doc/Figure4.pdf: Add figures to CVS - * trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/BalloonPlot.tex, - trunk/gplots/inst/doc/Figure1.pdf: Text changes + * inst/doc/Figure2.pdf, inst/doc/Figure3.pdf, inst/doc/Figure4.pdf: + Add figures to CVS +2005-11-07 14:18 warnes + + * inst/doc/BalloonPlot.pdf, inst/doc/BalloonPlot.tex, + inst/doc/Figure1.pdf: Text changes + 2005-11-04 21:48 warnes - * trunk/gplots/R/balloonplot.R: Fix some alignment issues. + * R/balloonplot.R: Fix some alignment issues. 2005-11-04 19:05 warnes - * trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/Table.pdf: Remove Table.pdf since it is no - longer needed + * inst/doc/BalloonPlot.pdf, inst/doc/Table.pdf: Remove Table.pdf + since it is no longer needed 2005-11-04 19:04 warnes - * trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/BalloonPlot.tex, - trunk/gplots/inst/doc/Figure1.pdf: Nitin's Changes + * inst/doc/BalloonPlot.pdf, inst/doc/BalloonPlot.tex, + inst/doc/Figure1.pdf: Nitin's Changes 2005-11-04 19:00 warnes - * trunk/gplots/inst/doc/SurvivedPop.pdf, - trunk/gplots/inst/doc/SurvivedPopWhite.pdf, - trunk/gplots/inst/doc/SurvivedProp.pdf, - trunk/gplots/inst/doc/TotalPop.pdf: Add figure plots + * inst/doc/SurvivedPop.pdf, inst/doc/SurvivedPopWhite.pdf, + inst/doc/SurvivedProp.pdf, inst/doc/TotalPop.pdf: Add figure + plots 2005-11-04 18:59 warnes - * trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/BalloonPlot.tex: Fix paths + * inst/doc/BalloonPlot.pdf, inst/doc/BalloonPlot.tex: Fix paths 2005-10-20 18:36 nj7w - * trunk/gplots/inst/doc/Figure1.eps, - trunk/gplots/inst/doc/Table.eps: added the eps version of figures + * inst/doc/Figure1.eps, inst/doc/Table.eps: added the eps version + of figures 2005-10-20 18:35 nj7w - * trunk/gplots/inst/doc/BalloonPlot.pdf: Updated BallonPlot.pdf + * inst/doc/BalloonPlot.pdf: Updated BallonPlot.pdf 2005-10-20 18:34 nj7w - * trunk/gplots/inst/doc/SurvivedPop.pdf, - trunk/gplots/inst/doc/SurvivedPopWhite.pdf, - trunk/gplots/inst/doc/SurvivedProp.pdf, - trunk/gplots/inst/doc/TotalPop.pdf: Removed Old Figure + * inst/doc/SurvivedPop.pdf, inst/doc/SurvivedPopWhite.pdf, + inst/doc/SurvivedProp.pdf, inst/doc/TotalPop.pdf: Removed Old + Figure 2005-10-20 18:31 nj7w - * trunk/gplots/inst/doc/Figure1.pdf, - trunk/gplots/inst/doc/Table.pdf: Added the new figure - for - total popluation - Balloonplot + * inst/doc/Figure1.pdf, inst/doc/Table.pdf: Added the new figure - + for total popluation - Balloonplot 2005-10-20 18:29 nj7w - * trunk/gplots/inst/doc/BalloonPlot.tex: Modified the BallonPlot - article + * inst/doc/BalloonPlot.tex: Modified the BallonPlot article 2005-10-20 14:12 nj7w - * trunk/gplots/inst/doc/BalloonPlot.tex: Added references + * inst/doc/BalloonPlot.tex: Added references 2005-10-19 16:57 arnima - * trunk/gplots/man/rich.color.Rd: The last example now displays - the correct heat.colors. + * man/rich.color.Rd: The last example now displays the correct + heat.colors. Default 'palette' argument is now a single string, not a vector. 2005-10-19 16:56 arnima - * trunk/gplots/R/rich.color.R: Default 'palette' argument is now a - single string, not a vector. + * R/rich.color.R: Default 'palette' argument is now a single + string, not a vector. 2005-10-14 19:13 warnes - * trunk/gplots/DESCRIPTION, trunk/gplots/R/balloonplot.R, - trunk/gplots/man/balloonplot.Rd: Formatting fixes: + * DESCRIPTION, R/balloonplot.R, man/balloonplot.Rd: Formatting + fixes: - Handle multiple row or column category variables - Separate rows/columns of category labels by lines - Fix handling of 'cumsum' plots on row/column labels @@ -390,54 +444,50 @@ 2005-10-13 20:00 warnes - * trunk/gplots/man/balloonplot.Rd: Add example using Titanic data - that exercises the multi-factor + * man/balloonplot.Rd: Add example using Titanic data that exercises + the multi-factor display. 2005-10-11 21:20 warnes - * trunk/gplots/R/balloonplot.R: Initial changes to allow multiple - x and y factor variables. Yet to + * R/balloonplot.R: Initial changes to allow multiple x and y factor + variables. Yet to be done: 1) remove extra 'boxes'. 2) omit duplicated values 2005-10-04 19:39 warnes - * trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/BalloonPlot.tex: more minor fixes + * inst/doc/BalloonPlot.pdf, inst/doc/BalloonPlot.tex: more minor + fixes 2005-10-04 19:29 warnes - * trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/BalloonPlot.tex: fix spacing + * inst/doc/BalloonPlot.pdf, inst/doc/BalloonPlot.tex: fix spacing 2005-10-04 19:08 warnes - * trunk/gplots/inst/doc/Rnews.sty: Inlcude Rnews.sty + * inst/doc/Rnews.sty: Inlcude Rnews.sty 2005-10-04 19:07 warnes - * trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/BalloonPlot.tex: Some textual edits. + * inst/doc/BalloonPlot.pdf, inst/doc/BalloonPlot.tex: Some textual + edits. 2005-10-03 16:23 nj7w - * trunk/gplots/inst/doc/SurvivedPop.pdf, - trunk/gplots/inst/doc/SurvivedPopWhite.pdf, - trunk/gplots/inst/doc/SurvivedProp.pdf, - trunk/gplots/inst/doc/TotalPop.pdf: Added figures for the R-News - Article + * inst/doc/SurvivedPop.pdf, inst/doc/SurvivedPopWhite.pdf, + inst/doc/SurvivedProp.pdf, inst/doc/TotalPop.pdf: Added figures + for the R-News Article 2005-09-29 21:02 nj7w - * trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/BalloonPlot.tex: Updated the documentation - - added the name of the person who asked the question + * inst/doc/BalloonPlot.pdf, inst/doc/BalloonPlot.tex: Updated the + documentation - added the name of the person who asked the + question 2005-09-29 20:29 nj7w - * trunk/gplots/inst, trunk/gplots/inst/doc, - trunk/gplots/inst/doc/BalloonPlot.pdf, - trunk/gplots/inst/doc/BalloonPlot.tex: Added R-news article + * inst, inst/doc, inst/doc/BalloonPlot.pdf, + inst/doc/BalloonPlot.tex: Added R-news article 2005-09-12 15:44 nj7w @@ -446,47 +496,47 @@ trunk/gdata/man/nobs.Rd, trunk/gdata/man/read.xls.Rd, trunk/gdata/man/rename.vars.Rd, trunk/gdata/man/trim.Rd, trunk/gdata/man/unmatrix.Rd, trunk/gmodels/man/fast.prcomp.Rd, - trunk/gmodels/man/glh.test.Rd, trunk/gplots/man/hist2d.Rd, - trunk/gplots/man/ooplot.Rd, trunk/gplots/man/residplot.Rd, - trunk/gplots/man/sinkplot.Rd, trunk/gplots/man/smartlegend.Rd, - trunk/gplots/man/space.Rd, trunk/gtools/man/assert.Rd, + trunk/gmodels/man/glh.test.Rd, man/hist2d.Rd, man/ooplot.Rd, + man/residplot.Rd, man/sinkplot.Rd, man/smartlegend.Rd, + man/space.Rd, trunk/gtools/man/assert.Rd, trunk/gtools/man/dirichlet.Rd, trunk/gtools/man/permute.Rd, trunk/gtools/man/scat.Rd: Updated Greg's email 2005-09-12 14:45 nj7w - * trunk/gplots/R/balloonplot.R: Updated version of balloonplot - - by Romain Francois <fra...@fr...> + * R/balloonplot.R: Updated version of balloonplot - by Romain + Francois <fra...@fr...> 2005-09-09 20:34 nj7w - * trunk/gplots/ChangeLog, trunk/gplots/DESCRIPTION: Updated the - version and ChangeLog + * ChangeLog, DESCRIPTION: Updated the version and ChangeLog 2005-09-09 20:32 nj7w - * trunk/gplots/R/balloonplot.R, trunk/gplots/man/balloonplot.Rd: - Changes in ballon plot based on Romain Francois - (fra...@fr...) suggestions + * R/balloonplot.R, man/balloonplot.Rd: Changes in ballon plot based + on Romain Francois (fra...@fr...) suggestions 2005-09-06 21:41 nj7w - * trunk/gplots/DESCRIPTION: Updated package dependencies - * trunk/gplots/NEWS: Added NEWS + * DESCRIPTION: Updated package dependencies +2005-09-06 21:41 nj7w + + * NEWS: Added NEWS + 2005-09-02 23:10 nj7w - * trunk/gmodels/ChangeLog, trunk/gplots/ChangeLog: Added ChangeLog + * trunk/gmodels/ChangeLog, ChangeLog: Added ChangeLog 2005-08-31 16:28 nj7w - * trunk/gdata/DESCRIPTION, trunk/gmodels/DESCRIPTION, - trunk/gplots/DESCRIPTION: Added DESCRIPTION file + * trunk/gdata/DESCRIPTION, trunk/gmodels/DESCRIPTION, DESCRIPTION: + Added DESCRIPTION file 2005-08-31 16:27 nj7w * trunk/gdata/DESCRIPTION.in, trunk/gmodels/DESCRIPTION.in, - trunk/gplots/DESCRIPTION.in: removed DESCRIPTION.in + DESCRIPTION.in: removed DESCRIPTION.in 2005-06-09 14:20 nj7w @@ -498,8 +548,7 @@ trunk/gdata/R/matchcols.R, trunk/gdata/R/nobs.R, trunk/gdata/R/read.xls.R, trunk/gdata/R/rename.vars.R, trunk/gdata/R/reorder.R, trunk/gdata/R/trim.R, - trunk/gdata/R/unmatrix.R, - trunk/gdata/inst/perl/IO/AtomicFile.pm, + trunk/gdata/R/unmatrix.R, trunk/gdata/inst/perl/IO/AtomicFile.pm, trunk/gdata/inst/perl/IO/InnerFile.pm, trunk/gdata/inst/perl/IO/Lines.pm, trunk/gdata/inst/perl/IO/Scalar.pm, @@ -518,24 +567,15 @@ trunk/gmodels/man/CrossTable.Rd, trunk/gmodels/man/ci.Rd, trunk/gmodels/man/coefFrame.Rd, trunk/gmodels/man/estimable.Rd, trunk/gmodels/man/fast.prcomp.Rd, - trunk/gmodels/man/fit.contrast.Rd, - trunk/gmodels/man/glh.test.Rd, - trunk/gmodels/man/make.contrasts.Rd, - trunk/gplots/R/balloonplot.R, trunk/gplots/R/bandplot.R, - trunk/gplots/R/boxplot.n.R, trunk/gplots/R/colorpanel.R, - trunk/gplots/R/heatmap.2.R, trunk/gplots/R/hist2d.R, - trunk/gplots/R/lowess.R, trunk/gplots/R/ooplot.R, - trunk/gplots/R/overplot.R, trunk/gplots/R/plotCI.R, - trunk/gplots/R/plotmeans.R, trunk/gplots/R/qqnorm.aov.R, - trunk/gplots/R/residplot.R, trunk/gplots/R/rich.color.R, - trunk/gplots/R/sinkplot.R, trunk/gplots/R/smartlegend.R, - trunk/gplots/R/space.R, trunk/gplots/R/textplot.R, - trunk/gplots/R/wapply.R, trunk/gplots/man/1, - trunk/gplots/man/bandplot.Rd, trunk/gplots/man/barplot2.Rd, - trunk/gplots/man/boxplot.n.Rd, trunk/gplots/man/hist2d.Rd, - trunk/gplots/man/lowess.Rd, trunk/gplots/man/plotCI.Rd, - trunk/gplots/man/plotmeans.Rd, trunk/gplots/man/residplot.Rd, - trunk/gplots/man/space.Rd, trunk/gplots/man/wapply.Rd, + trunk/gmodels/man/fit.contrast.Rd, trunk/gmodels/man/glh.test.Rd, + trunk/gmodels/man/make.contrasts.Rd, R/balloonplot.R, + R/bandplot.R, R/boxplot.n.R, R/colorpanel.R, R/heatmap.2.R, + R/hist2d.R, R/lowess.R, R/ooplot.R, R/overplot.R, R/plotCI.R, + R/plotmeans.R, R/qqnorm.aov.R, R/residplot.R, R/rich.color.R, + R/sinkplot.R, R/smartlegend.R, R/space.R, R/textplot.R, + R/wapply.R, man/1, man/bandplot.Rd, man/barplot2.Rd, + man/boxplot.n.Rd, man/hist2d.Rd, man/lowess.Rd, man/plotCI.Rd, + man/plotmeans.Rd, man/residplot.Rd, man/space.Rd, man/wapply.Rd, trunk/gtools/R/RSCompat.S, trunk/gtools/R/combinations.R, trunk/gtools/R/dirichlet.R, trunk/gtools/R/foldchange.R, trunk/gtools/R/invalid.R, trunk/gtools/R/logit.R, @@ -553,22 +593,21 @@ 2005-06-09 14:15 nj7w - * trunk/gplots/R/barplot2.R: Changes based on Marc Schwartz's - suggestions to handel 0's and NA's appropriately. + * R/barplot2.R: Changes based on Marc Schwartz's suggestions to + handel 0's and NA's appropriately. 2005-05-13 18:59 nj7w * trunk/gdata/R/read.xls.R, trunk/gmodels/man/CrossTable.Rd, - trunk/gplots/man/heatmap.2.Rd: 1) Using dQuote.ascii function in - read.xls as the new version of dQuote doesn't work proprly with - UTF-8 locale. + man/heatmap.2.Rd: 1) Using dQuote.ascii function in read.xls as + the new version of dQuote doesn't work proprly with UTF-8 locale. 2) Modified CrossTable.Rd usage in gmodels 3) Modified heatmap.2 usage in gplots. 2005-04-04 14:23 warnes - * trunk/gplots/R/overplot.R: Explicitly reference package - containing lowess.formula in + * R/overplot.R: Explicitly reference package containing + lowess.formula in panel.overplot(). This should fix the error reported by Troels Ring <tr...@gv...>. @@ -577,57 +616,55 @@ * trunk/gdata/NAMESPACE, trunk/gdata/man/elem.Rd, trunk/gdata/man/env.Rd, trunk/gdata/man/ll.Rd, - trunk/gdata/man/read.xls.Rd, trunk/gplots/R/heatmap.2.R, - trunk/gplots/man/heatmap.2.Rd, trunk/gplots/man/rich.color.Rd, - trunk/gplots/man/sinkplot.Rd, trunk/gplots/man/textplot.Rd: *** - empty log message *** + trunk/gdata/man/read.xls.Rd, R/heatmap.2.R, man/heatmap.2.Rd, + man/rich.color.Rd, man/sinkplot.Rd, man/textplot.Rd: *** empty + log message *** 2005-02-25 23:22 warnes * trunk/gdata/R/elem.R, trunk/gdata/R/env.R, trunk/gdata/R/ll.R, trunk/gdata/man/Args.Rd, trunk/gdata/man/env.Rd, - trunk/gdata/man/ll.Rd, trunk/gplots/man/rich.color.Rd: Integrate - changes submitted by Arni Magnusson + trunk/gdata/man/ll.Rd, man/rich.color.Rd: Integrate changes + submitted by Arni Magnusson 2005-02-25 22:31 warnes - * trunk/gplots/NAMESPACE: Add dependency imports from 'stats' - package. + * NAMESPACE: Add dependency imports from 'stats' package. 2005-02-22 21:01 warnes - * trunk/gplots/R/bandplot.R: Fix problem in passing graphical - parameters (xlim,etc).@ + * R/bandplot.R: Fix problem in passing graphical parameters + (xlim,etc).@ 2005-02-08 16:41 warnes - * trunk/gplots/DESCRIPTION.in: Improve package title. + * DESCRIPTION.in: Improve package title. 2005-02-08 16:40 warnes - * trunk/gplots/R/heatmap.2.R: Ignore missing values when computing - symmetric range. + * R/heatmap.2.R: Ignore missing values when computing symmetric + range. 2005-02-02 19:25 warnes - * trunk/gplots/man/plotmeans.Rd: Add more extensive example. + * man/plotmeans.Rd: Add more extensive example. 2005-01-14 19:05 warnes - * trunk/gplots/R/textplot.R: Code can be simplified because R now - supports selecting a fixed width font. + * R/textplot.R: Code can be simplified because R now supports + selecting a fixed width font. 2005-01-12 20:50 warnes * trunk/gdata/DESCRIPTION.in, trunk/gmodels/DESCRIPTION.in, - trunk/gplots/DESCRIPTION.in, trunk/gtools/DESCRIPTION.in: Add - dependency on R 1.9.0+ to prevent poeple from installing on old + DESCRIPTION.in, trunk/gtools/DESCRIPTION.in: Add dependency on R + 1.9.0+ to prevent poeple from installing on old versions of R which don't support namespaces. 2004-11-30 01:06 warnes - * trunk/gplots/R/heatmap.2.R, trunk/gplots/man/heatmap.2.Rd: 1. - Add new parameters for controlling color key: + * R/heatmap.2.R, man/heatmap.2.Rd: 1. Add new parameters for + controlling color key: - If `symkey==TRUE', the color key will be made symmetric about 0. - The `densadj' parameter can be used to modify the smoother @@ -640,8 +677,7 @@ 3. Vector of length 2 giving the width (colsep) or height (rowsep) the separator box - drawn by colsep and rowsep as a function of the width - (colsep) or + drawn by colsep and rowsep as a function of the width (colsep) or height (rowsep) of a cell. 4. Appropriate changes to the corresponding help page, plus some @@ -649,8 +685,8 @@ 2004-11-03 19:43 warnes - * trunk/gplots/R/heatmap.2.R: Fix bugs in layout of cell notes. - They were being plotted top down + * R/heatmap.2.R: Fix bugs in layout of cell notes. They were being + plotted top down rather than bottom up. Further reordering of the x matrix didn't also reorder the notes. Both issues should now be resolved. @@ -659,18 +695,19 @@ * trunk/gdata/DESCRIPTION, trunk/gdata/DESCRIPTION.in, trunk/gdata/NAMESPACE, trunk/gdata/man/.Rhistory, trunk/gmodels/DESCRIPTION, trunk/gmodels/DESCRIPTION.in, - trunk/gplots/DESCRIPTION, trunk/gplots/DESCRIPTION.in, - trunk/gplots/man/sinkplot.Rd, trunk/gplots/man/textplot.Rd, + DESCRIPTION, DESCRIPTION.in, man/sinkplot.Rd, man/textplot.Rd, trunk/gregmisc/.Rhistory, trunk/gregmisc/DESCRIPTION, trunk/gtools/DESCRIPTION, trunk/gtools/DESCRIPTION.in, trunk/gtools/man/running.Rd: Updated to pass R CMD check. 2004-09-03 22:50 warneg - * trunk/gplots/man/textplot.Rd: Provide explicit package for call - to nobs. - * trunk/gplots/man/heatmap.2.Rd: Fix typos. + * man/textplot.Rd: Provide explicit package for call to nobs. +2004-09-03 22:50 warneg + + * man/heatmap.2.Rd: Fix typos. + 2004-09-03 17:27 warneg * trunk/gdata/DESCRIPTION, trunk/gdata/DESCRIPTION.in, @@ -688,58 +725,49 @@ trunk/gmodels/R/fast.prcomp.R, trunk/gmodels/R/fit.contrast.R, trunk/gmodels/R/glh.test.R, trunk/gmodels/R/make.contrasts.R, trunk/gmodels/man/estimable.Rd, - trunk/gmodels/man/fit.contrast.Rd, - trunk/gmodels/man/glh.test.Rd, - trunk/gmodels/man/make.contrasts.Rd, trunk/gplots/DESCRIPTION, - trunk/gplots/NAMESPACE, trunk/gplots/R/balloonplot.R, - trunk/gplots/R/bandplot.R, trunk/gplots/R/barplot2.R, - trunk/gplots/R/boxplot.n.R, trunk/gplots/R/colorpanel.R, - trunk/gplots/R/heatmap.2.R, trunk/gplots/R/hist2d.R, - trunk/gplots/R/lowess.R, trunk/gplots/R/ooplot.R, - trunk/gplots/R/overplot.R, trunk/gplots/R/plotCI.R, - trunk/gplots/R/plotmeans.R, trunk/gplots/R/qqnorm.aov.R, - trunk/gplots/R/residplot.R, trunk/gplots/R/rich.color.R, - trunk/gplots/R/sinkplot.R, trunk/gplots/R/smartlegend.R, - trunk/gplots/R/space.R, trunk/gplots/R/textplot.R, - trunk/gplots/R/wapply.R, trunk/gtools/DESCRIPTION, - trunk/gtools/NAMESPACE, trunk/gtools/R/dirichlet.R, - trunk/gtools/R/foldchange.R, trunk/gtools/R/invalid.R, - trunk/gtools/R/mixedsort.R, trunk/gtools/R/oddeven.R, - trunk/gtools/R/permute.R, trunk/gtools/R/quantcut.R, - trunk/gtools/R/running.R, trunk/gtools/man/running.Rd: initial - bundle checkin + trunk/gmodels/man/fit.contrast.Rd, trunk/gmodels/man/glh.test.Rd, + trunk/gmodels/man/make.contrasts.Rd, DESCRIPTION, NAMESPACE, + R/balloonplot.R, R/bandplot.R, R/barplot2.R, R/boxplot.n.R, + R/colorpanel.R, R/heatmap.2.R, R/hist2d.R, R/lowess.R, + R/ooplot.R, R/overplot.R, R/plotCI.R, R/plotmeans.R, + R/qqnorm.aov.R, R/residplot.R, R/rich.color.R, R/sinkplot.R, + R/smartlegend.R, R/space.R, R/textplot.R, R/wapply.R, + trunk/gtools/DESCRIPTION, trunk/gtools/NAMESPACE, + trunk/gtools/R/dirichlet.R, trunk/gtools/R/foldchange.R, + trunk/gtools/R/invalid.R, trunk/gtools/R/mixedsort.R, + trunk/gtools/R/oddeven.R, trunk/gtools/R/permute.R, + trunk/gtools/R/quantcut.R, trunk/gtools/R/running.R, + trunk/gtools/man/running.Rd: initial bundle checkin 2004-09-02 17:14 warneg * trunk/gdata/DESCRIPTION, trunk/gdata/DESCRIPTION.in, trunk/gdata/NAMESPACE, trunk/gdata/man/.Rhistory, trunk/gmodels/DESCRIPTION, trunk/gmodels/DESCRIPTION.in, - trunk/gmodels/NAMESPACE, trunk/gplots/DESCRIPTION, - trunk/gplots/DESCRIPTION.in, trunk/gplots/NAMESPACE, - trunk/gplots/man/1, trunk/gplots/man/residplot.Rd, - trunk/gregmisc/.Rhistory, trunk/gtools/DESCRIPTION, - trunk/gtools/DESCRIPTION.in, trunk/gtools/NAMESPACE: Initial - revision + trunk/gmodels/NAMESPACE, DESCRIPTION, DESCRIPTION.in, NAMESPACE, + man/1, man/residplot.Rd, trunk/gregmisc/.Rhistory, + trunk/gtools/DESCRIPTION, trunk/gtools/DESCRIPTION.in, + trunk/gtools/NAMESPACE: Initial revision 2004-07-29 14:49 warnes - * trunk/gplots/R/plotCI.R, trunk/gplots/man/plotCI.Rd: Integrate - changes from the version of plotCI maintained by Martin Maechler. + * R/plotCI.R, man/plotCI.Rd: Integrate changes from the version of + plotCI maintained by Martin Maechler. 2004-06-30 19:32 warnes - * trunk/gplots/R/textplot.R: Remove commented-out code. + * R/textplot.R: Remove commented-out code. 2004-06-30 19:26 warnes - * trunk/gplots/R/textplot.R: Fixed text size calculations + * R/textplot.R: Fixed text size calculations 2004-06-28 20:16 warnes - * trunk/gplots/R/barplot2.R, trunk/gplots/man/barplot2.Rd: - - Default 2-d color set to grey as in (v2.0.0) r-devel - - The default (v1.9.1) barplot method now handles vectors and - 1-d arrays + * R/barplot2.R, man/barplot2.Rd: - Default 2-d color set to grey as + in (v2.0.0) r-devel + - The default (v1.9.1) barplot method now handles vectors and 1-d + arrays (e.g., obtained by table()) the same, and uses grey instead of heat color palettes in these cases. (Also fixes PR#6776.) - Updated to reflect the addition of 'offset' argument in base @@ -748,234 +776,223 @@ 2004-06-24 16:57 warnes - * trunk/gplots/R/heatmap.2.R, trunk/gplots/man/heatmap.2.Rd: Add - ability to specify color of NA cells. + * R/heatmap.2.R, man/heatmap.2.Rd: Add ability to specify color of + NA cells. 2004-05-27 15:11 warnes - * trunk/gplots/man/plotCI.Rd: Fix spelling error. + * man/plotCI.Rd: Fix spelling error. 2004-05-26 14:56 warnes - * trunk/gplots/R/overplot.R: One more fix to get it right. + * R/overplot.R: One more fix to get it right. 2004-05-26 13:50 warnes - * trunk/gplots/R/overplot.R: Use triple-colon operator ':::' to - access plot.formula from the graphics package. + * R/overplot.R: Use triple-colon operator ':::' to access + plot.formula from the graphics package. 2004-05-26 13:19 warnes - * trunk/gplots/man/rich.color.Rd: Replace 'F' by 'FALSE' to pass R - CMD check. + * man/rich.color.Rd: Replace 'F' by 'FALSE' to pass R CMD check. 2004-05-25 18:32 warnes - * trunk/gplots/R/overplot.R: Work around bug in R 1.9.X due to - plot.formula() not having the same + * R/overplot.R: Work around bug in R 1.9.X due to plot.formula() + not having the same arguments as plot(). 2004-05-25 17:33 warnes - * trunk/gplots/R/rich.color.R, trunk/gplots/man/rich.color.Rd: Add - rich.colors() submitted by Arni Magnusson - <arnima@u.washington.edu>. + * R/rich.color.R, man/rich.color.Rd: Add rich.colors() submitted by + Arni Magnusson <arnima@u.washington.edu>. 2004-05-25 02:58 warnes - * trunk/gplots/R/ooplot.R, trunk/gplots/man/ooplot.Rd: ?? + * R/ooplot.R, man/ooplot.Rd: ?? 2004-05-24 23:43 warnes - * trunk/gplots/R/plotCI.R, trunk/gplots/R/plotmeans.R: Modified to - use invalid() to check arguments instead of missing(). + * R/plotCI.R, R/plotmeans.R: Modified to use invalid() to check + arguments instead of missing(). This fixes some build errors under R-1.9.0-Patched. 2004-04-22 15:44 warnes - * trunk/gplots/R/ooplot.R, trunk/gplots/man/ooplot.Rd: Integrate - changes from Lodewijk Bonebakker <bon...@co...> + * R/ooplot.R, man/ooplot.Rd: Integrate changes from Lodewijk + Bonebakker <bon...@co...> 2004-04-13 13:42 warnes - * trunk/gplots/R/space.R, trunk/gplots/man/space.Rd: Add ability - to space points along 'y' direction. + * R/space.R, man/space.Rd: Add ability to space points along 'y' + direction. 2004-04-02 19:06 warnes - * trunk/gplots/R/smartlegend.R: Fixed smartlegend() positioning - when x and/or y axis are log-scale. + * R/smartlegend.R: Fixed smartlegend() positioning when x and/or y + axis are log-scale. 2004-03-30 19:04 warnes - * trunk/gplots/R/textplot.R, trunk/gregmisc/DESCRIPTION: - Fix bug - in textplot() reported by Wright, Kevin - <kev...@pi...>. + * R/textplot.R, trunk/gregmisc/DESCRIPTION: - Fix bug in textplot() + reported by Wright, Kevin <kev...@pi...>. 2004-03-26 22:27 warnes - * trunk/gplots/man/textplot.Rd: Update to match changes in - textplot() code. + * man/textplot.Rd: Update to match changes in textplot() code. 2004-03-26 22:25 warnes - * trunk/gplots/man/ooplot.Rd: Remove Windows EOL characters. + * man/ooplot.Rd: Remove Windows EOL characters. 2004-03-26 22:20 warnes - * trunk/gplots/man/barplot2.Rd: - Remove some commented-out code. + * man/barplot2.Rd: - Remove some commented-out code. - Remove cvs log tag. 2004-03-26 22:16 warnes - * trunk/gplots/R/textplot.R: Misc changes. + * R/textplot.R: Misc changes. 2004-02-17 22:22 warnes - * trunk/gplots/man/ooplot.Rd: Minor fix to ooplot documentation. + * man/ooplot.Rd: Minor fix to ooplot documentation. 2004-02-17 22:21 warnes - * trunk/gplots/R/ooplot.R, trunk/gplots/man/ooplot.Rd: Integrate - ooplot updates provided by Lodewijk Bonebakker + * R/ooplot.R, man/ooplot.Rd: Integrate ooplot updates provided by + Lodewijk Bonebakker <bon...@co...> 2004-02-02 16:26 warnes - * trunk/gplots/R/colorpanel.R, trunk/gplots/man/colorpanel.Rd: - - Add colorpanel function, which generates a smoothly varying band - of + * R/colorpanel.R, man/colorpanel.Rd: - Add colorpanel function, + which generates a smoothly varying band of colors over a three color range (lo, mid, high). 2004-01-21 12:07 warnes - * trunk/gplots/man/textplot.Rd: - Correct arguments to halign to - match code. + * man/textplot.Rd: - Correct arguments to halign to match code. 2004-01-21 05:17 warnes - * trunk/gplots/R/lowess.R: Track R 1.9.0's move of 'lowess' from - the base package to the (new) + * R/lowess.R: Track R 1.9.0's move of 'lowess' from the base + package to the (new) stats package. 2004-01-21 04:44 warnes - * trunk/gplots/man/sinkplot.Rd: - Fix sinkplot() example by - replacing 'T' with 'TRUE'. + * man/sinkplot.Rd: - Fix sinkplot() example by replacing 'T' with + 'TRUE'. 2004-01-21 04:42 warnes - * trunk/gplots/man/ooplot.Rd: - Add some more details to the - ooplot() documentation. The + * man/ooplot.Rd: - Add some more details to the ooplot() + documentation. The documentation is *not* complete. 2004-01-21 04:31 warnes - * trunk/gplots/R/textplot.R, trunk/gtools/R/capture.R: - Mark - sprint() as depreciated. + * R/textplot.R, trunk/gtools/R/capture.R: - Mark sprint() as + depreciated. - Replace references to sprint with capture.output() - Use match.arg for halign and valign arguments to textplot.default. - Fix textplot.character so that a vector of characters is properly - displayed. Previouslt, character vectors were plotted on top - of each + displayed. Previouslt, character vectors were plotted on top of + each other. 2004-01-19 23:43 warnes - * trunk/gplots/R/sinkplot.R, trunk/gplots/man/sinkplot.Rd: New - function sinkplot(), as requested on R-devel by Kevin Wright + * R/sinkplot.R, man/sinkplot.Rd: New function sinkplot(), as + requested on R-devel by Kevin Wright <kw...@es...> in https://www.stat.math.ethz.ch/pipermail/r-devel/2004-January/028483.html. 2004-01-15 05:14 warnes - * trunk/gplots/R/ooplot.R, trunk/gplots/man/ooplot.Rd: Add initial - code and docs for ooplot() function submitted by Lodewijk + * R/ooplot.R, man/ooplot.Rd: Add initial code and docs for ooplot() + function submitted by Lodewijk Bonebakker <bon...@co...>. 2003-12-03 02:46 warnes - * trunk/gdata/man/elem.Rd, trunk/gdata/man/ll.Rd, - trunk/gplots/man/lowess.Rd, trunk/gplots/man/textplot.Rd, - trunk/gplots/man/wapply.Rd, trunk/gtools/man/foldchange.Rd: - + * trunk/gdata/man/elem.Rd, trunk/gdata/man/ll.Rd, man/lowess.Rd, + man/textplot.Rd, man/wapply.Rd, trunk/gtools/man/foldchange.Rd: - match function argument defaults with 'usage' 2003-12-03 02:42 warnes - * trunk/gplots/R/heatmap.2.R, trunk/gplots/man/heatmap.2.Rd: - Fix - buglets in heatmap function + * R/heatmap.2.R, man/heatmap.2.Rd: - Fix buglets in heatmap + function - Make a slight enhancement to the example code. 2003-12-02 22:49 warnes - * trunk/gplots/R/heatmap.2.R: Integrated some suggestions from - Sean Davis <sd...@ma...>. + * R/heatmap.2.R: Integrated some suggestions from Sean Davis + <sd...@ma...>. 2003-12-02 18:22 warnes - * trunk/gplots/man/heatmap.2.Rd: - Make final example use 16 - colors instead of 8. This looks nicer. + * man/heatmap.2.Rd: - Make final example use 16 colors instead of + 8. This looks nicer. 2003-12-02 16:58 warnes - * trunk/gplots/man/barplot2.Rd: - Remove '%' character from - example code to avoid errors. + * man/barplot2.Rd: - Remove '%' character from example code to + avoid errors. 2003-12-02 16:54 warnes - * trunk/gplots/R/plotCI.R: - Add '...' parameter to call to text - to allow user to control size/color/etc. + * R/plotCI.R: - Add '...' parameter to call to text to allow user + to control size/color/etc. 2003-12-01 16:00 warnes - * trunk/gplots/man/barplot2.Rd: - updated to match changes to - barplot() in base. + * man/barplot2.Rd: - updated to match changes to barplot() in base. 2003-12-01 15:59 warnes - * trunk/gplots/data, trunk/gplots/data/rtPCR.rda: - Renamed - rtPCR.Rda to rtPCR.rda so that R will properly load the file + * data, data/rtPCR.rda: - Renamed rtPCR.Rda to rtPCR.rda so that R + will properly load the file when data(rtPCR) is executed. 2003-12-01 15:55 warnes - * trunk/gplots/R/barplot2.R: - Follow patches applied to barplot() - in base. + * R/barplot2.R: - Follow patches applied to barplot() in base. 2003-11-24 21:32 warnes - * trunk/gplots/man/heatmap.2.Rd: Fix unbalanced braces. + * man/heatmap.2.Rd: Fix unbalanced braces. 2003-11-24 15:09 warnes - * trunk/gplots/R/overplot.R, trunk/gplots/man/overplot.Rd: Fix - errors reported by R CMD check. + * R/overplot.R, man/overplot.Rd: Fix errors reported by R CMD + check. 2003-11-21 23:13 warnes - * trunk/gplots/man/overplot.Rd: Added missing closing brace. + * man/overplot.Rd: Added missing closing brace. 2003-11-21 23:08 warnes - * trunk/gplots/man/rtPCR.Rd: Initial addition of these files. - Used in examples of overplot(). + * man/rtPCR.Rd: Initial addition of these files. Used in examples + of overplot(). 2003-11-21 22:59 warnes - * trunk/gplots/R/heatmap.2.R, trunk/gplots/man/heatmap.2.Rd: - Applied my enhancements to the heatmap() code from R 1.8.0, and - added + * R/heatmap.2.R, man/heatmap.2.Rd: Applied my enhancements to the + heatmap() code from R 1.8.0, and added documentation of these changes. 2003-11-21 22:58 warnes - * trunk/gplots/R/overplot.R, trunk/gplots/man/overplot.Rd: - - Discovered that axis(N) does the right thing without needing to - be - given location for tick marks. This allowed simplification of - the code. + * R/overplot.R, man/overplot.Rd: - Discovered that axis(N) does the + right thing without needing to be + given location for tick marks. This allowed simplification of the + code. - Minor other changes for distribution @@ -983,30 +1000,29 @@ 2003-11-21 19:50 warnes - * trunk/gplots/R/heatmap.2.R, trunk/gplots/man/heatmap.2.Rd: - - Integrated my extensions into the R 1.8.0 version of heatmap. + * R/heatmap.2.R, man/heatmap.2.Rd: - Integrated my extensions into + the R 1.8.0 version of heatmap. - Add Rd documentation. 2003-11-19 14:52 warnes - * trunk/gplots/man/bandplot.Rd: Remove extranious NULL that - confused R CMD check. + * man/bandplot.Rd: Remove extranious NULL that confused R CMD + check. 2003-11-18 18:59 warnes - * trunk/gplots/man/barplot2.Rd: - Tiny fix to remove R CMD check - error. + * man/barplot2.Rd: - Tiny fix to remove R CMD check error. 2003-11-18 18:58 warnes - * trunk/gplots/man/smartlegend.Rd: - Added missing closing brace. + * man/smartlegend.Rd: - Added missing closing brace. 2003-11-18 18:45 warnes * trunk/gdata/R/elem.R, trunk/gdata/R/env.R, trunk/gdata/R/is.what.R, trunk/gdata/R/keep.R, - trunk/gdata/R/ll.R, trunk/gplots/R/overplot.R: - Convert from - MS-Dos to Unix line endings. + trunk/gdata/R/ll.R, R/overplot.R: - Convert from MS-Dos to Unix + line endings. - Reformat to 80 columns. 2003-11-10 22:11 warnes @@ -1015,61 +1031,56 @@ trunk/gdata/R/is.what.R, trunk/gdata/R/keep.R, trunk/gdata/R/ll.R, trunk/gdata/man/elem.Rd, trunk/gdata/man/env.Rd, trunk/gdata/man/is.what.Rd, - trunk/gdata/man/keep.Rd, trunk/gdata/man/ll.Rd, - trunk/gplots/R/heatmap.2.R, trunk/gplots/R/overplot.R, - trunk/gplots/R/plotmeans.R, trunk/gplots/R/space.R, - trunk/gplots/R/wapply.R, trunk/gregmisc/DESCRIPTION, - trunk/gtools/R/capture.R, trunk/gtools/man/capture.Rd: - Add - files contributed by Arni Magnusson + trunk/gdata/man/keep.Rd, trunk/gdata/man/ll.Rd, R/heatmap.2.R, + R/overplot.R, R/plotmeans.R, R/space.R, R/wapply.R, + trunk/gregmisc/DESCRIPTION, trunk/gtools/R/capture.R, + trunk/gtools/man/capture.Rd: - Add files contributed by Arni + Magnusson <arnima@u.washington.edu>. As well as some of my own. 2003-08-19 14:58 warnes - * trunk/gplots/R/heatmap.2.R: - Copy of local changes. + * R/heatmap.2.R: - Copy of local changes. 2003-08-19 14:57 warnes - * trunk/gplots/R/heatmap.2.R: - Checkin before re-integrating - local changes. + * R/heatmap.2.R: - Checkin before re-integrating local changes. 2003-06-19 21:23 warnes - * trunk/gplots/R/heatmap.2.R: - Added enhanced heatmap function. + * R/heatmap.2.R: - Added enhanced heatmap function. 2003-06-09 15:10 warnes - * trunk/gplots/man/smartlegend.Rd: - Add help text for smartlegend. + * man/smartlegend.Rd: - Add help text for smartlegend. 2003-06-09 14:57 warnes - * trunk/gplots/R/smartlegend.R: - New function smartlegend(). + * R/smartlegend.R: - New function smartlegend(). 2003-04-22 17:28 warnes - * trunk/gplots/R/plotmeans.R: - Fixeed warning messing caused when - 'connect' is a vector. + * R/plotmeans.R: - Fixeed warning messing caused when 'connect' is + a vector. 2003-04-22 15:34 warnes - * trunk/gplots/R/barplot2.R: Update from Marc Schwartz, modified - by Gregory Warnes: + * R/barplot2.R: Update from Marc Schwartz, modified by Gregory + Warnes: - Modified dim() checks for 'ci.l' and 'ci.u' against 'height' - to remove R v1.7.0 if() based error msgs for vector - conditions. + to remove R v1.7.0 if() based error msgs for vector conditions. 2003-04-04 13:49 warnes - * trunk/gplots/R/balloonplot.R, trunk/gplots/man/qqnorm.aov.Rd, - trunk/gtools/R/dirichlet.R: - Change occurences of 'T' to 'TRUE' + * R/balloonplot.R, man/qqnorm.aov.Rd, trunk/gtools/R/dirichlet.R: - + Change occurences of 'T' to 'TRUE' 2003-04-04 13:44 warnes - * trunk/gplots/man/textplot.Rd: - Updated to match changes in - textplot function: + * man/textplot.Rd: - Updated to match changes in textplot function: - Added textplot.character - - Renamed arguments "col.margin" and "row.margin" to "cmar", - and + - Renamed arguments "col.margin" and "row.margin" to "cmar", and "rmar" so that specifying "col='red'" is possible. - Fixed R CMD check errors - Improve comments in example @@ -1077,65 +1088,62 @@ 2003-04-04 13:41 warnes - * trunk/gplots/R/textplot.R: - Added textplot.character to handle - character strings. + * R/textplot.R: - Added textplot.character to handle character + strings. - Moved test for vector and matrix arguments to textplot.default. - Renamed arguments "col.margin" and "row.margin" to "cmar", and "rmar" so that specifying "col='red'" is possible. 2003-04-02 22:29 warnes - * trunk/gplots/R/textplot.R, trunk/gplots/man/textplot.Rd: - Added - textplot function and friends, as well as documentation. + * R/textplot.R, man/textplot.Rd: - Added textplot function and + friends, as well as documentation. 2003-03-08 16:30 warnes - * trunk/gplots/man/balloonplot.Rd: - Forgot to update arglist in - \usage section. + * man/balloonplot.Rd: - Forgot to update arglist in \usage section. 2003-03-08 16:22 warnes - * trunk/gplots/R/balloonplot.R, trunk/gplots/man/balloonplot.Rd: - - Added parameters for rotation of and amount of space allocated - for + * R/balloonplot.R, man/balloonplot.Rd: - Added parameters for + rotation of and amount of space allocated for the row and column labels. 2003-03-07 15:48 warnes - * trunk/gmodels/R/fast.prcomp.R, trunk/gplots/R/hist2d.R, - trunk/gplots/R/qqnorm.aov.R, trunk/gregmisc/DESCRIPTION, - trunk/gtools/R/RSCompat.S: - Minor changes to code to allow the - package to be provided as an + * trunk/gmodels/R/fast.prcomp.R, R/hist2d.R, R/qqnorm.aov.R, + trunk/gregmisc/DESCRIPTION, trunk/gtools/R/RSCompat.S: - Minor + changes to code to allow the package to be provided as an S-Plus chapter. 2003-03-07 15:43 warnes - * trunk/gplots/R/lowess.R: - Add 'NULL' as the last element of if - statement that defines + * R/lowess.R: - Add 'NULL' as the last element of if statement that + defines lowess.default so that when the file is sourced, S-Plus doesn't display the function definition. 2003-03-07 15:41 warnes - * trunk/gplots/R/lowess.R: - Specify where the defualt lowess - function should be found. + * R/lowess.R: - Specify where the defualt lowess function should be + found. - Use getFunction in S-Plus instead of 'get' 2003-01-30 21:43 warnes - * trunk/gplots/R/barplot2.R, trunk/gplots/man/barplot2.Rd: - Added - argument 'add' to allow for the addition of a barplot to an + * R/barplot2.R, man/barplot2.Rd: - Added argument 'add' to allow + for the addition of a barplot to an existing graphic. Default is FALSE 2003-01-20 18:35 warnes - * trunk/gplots/R/balloonplot.R, trunk/gplots/man/balloonplot.Rd: - - Updated balloonplot help page. + * R/balloonplot.R, man/balloonplot.Rd: - Updated balloonplot help + page. 2003-01-20 17:13 warnes - * trunk/gplots/R/wapply.R, trunk/gplots/man/wapply.Rd: - Updated - wapply.R to allow specification of evaluation points when + * R/wapply.R, man/wapply.Rd: - Updated wapply.R to allow + specification of evaluation points when method is 'width' or 'range' using the 'pts' argument. - Updated wapply.Rd to add 'pts' argument - Fixed typos, spelling errors, gramatical errors and lack of @@ -1144,62 +1152,58 @@ 2003-01-03 21:34 warnes - * trunk/gplots/R/balloonplot.R, trunk/gplots/man/balloonplot.Rd: - - Initial checkin of balloonplot functions and documentation. + * R/balloonplot.R, man/balloonplot.Rd: - Initial checkin of + balloonplot functions and documentation. 2003-01-03 19:23 warnes - * trunk/gplots/man/space.Rd: - Added reference to and comparison - example of sunflowerplot. + * man/space.Rd: - Added reference to and comparison example of + sunflowerplot. - Added code to put example plots on same plot window using par(mfrow=...). 2003-01-02 16:09 warnes - * trunk/gplots/R/barplot2.R: - Changed assignment statements that - used "=" to "<-" to avoid syntax + * R/barplot2.R: - Changed assignment statements that used "=" to + "<-" to avoid syntax errors in older versions of the S language. 2003-01-02 16:07 warnes - * trunk/gplots/R/lowess.R: - Added wrapper code so that R-specific - fiddling won't be executed + * R/lowess.R: - Added wrapper code so that R-specific fiddling + won't be executed under S-Plus. 2003-01-02 15:40 warnes - * trunk/gplots/R/qqnorm.aov.R, trunk/gplots/man/qqnorm.aov.Rd: - - Renamed first parameter to match qqnorm generic. + * R/qqnorm.aov.R, man/qqnorm.aov.Rd: - Renamed first parameter to + match qqnorm generic. 2003-01-02 15:14 warnes - * trunk/gplots/man/qqnorm.aov.Rd: Added additional help text from - Kjeitl. + * man/qqnorm.aov.Rd: Added additional help text from Kjeitl. 2002-12-31 19:50 warnes - * trunk/gplots/R/qqnorm.aov.R, trunk/gplots/man/qqnorm.aov.Rd: - Initial checkin of qqnorm.aov function and documentation - submitted by + * R/qqnorm.aov.R, man/qqnorm.aov.Rd: Initial checkin of qqnorm.aov + function and documentation submitted by Kjetil Halvorsen <kj...@ju...>. 2002-11-04 14:21 warnes - * trunk/gplots/R/barplot2.R, trunk/gplots/man/barplot2.Rd: Updates - from Marc Schwartz: + * R/barplot2.R, man/barplot2.Rd: Updates from Marc Schwartz: - - Updated underlying code to be based upon the new barplot() in - R v1.6.1 + - Updated underlying code to be based upon the new barplot() in R + v1.6.1 - This now uses the 'axis.lty' and 'border' arguments - In R v1.6.0, R Core introduced a new function called axTicks(). This is an R equivalent of the C code for CreateAtVector in plot.c. This now enables me to get the axis tick mark positions consistently - when the 'height' related axis is either linear or log. Thus, - I can - now have consistent tick marks and can plot grid lines in - either + when the 'height' related axis is either linear or log. Thus, I + can + now have consistent tick marks and can plot grid lines in either situation. If 'plot.grid = TRUE' and 'grid.inc' is specified, then I still use pretty() to determine the tick marks and lines. @@ -1207,23 +1211,22 @@ 2002-10-30 02:21 warnes - * trunk/gplots/R/plot.lm.R: - Commented out plot.lm() code since - recent changes in R have broken it. + * R/plot.lm.R: - Commented out plot.lm() code since recent changes + in R have broken it. 2002-10-11 18:02 warnes - * trunk/gplots/R/barplot2.R: - Fixed log scale errors in legend() - call + * R/barplot2.R: - Fixed log scale errors in legend() call 2002-10-01 18:16 warnes - * trunk/gplots/man/hist2d.Rd: - Added examples of using 'contour' - and 'filled.contour' for display. + * man/hist2d.Rd: - Added examples of using 'contour' and + 'filled.contour' for display. 2002-09-24 14:53 warnes - * trunk/gplots/R/plotmeans.R: - Changed digits=options("digits") - which produces a list of length 1 + * R/plotmeans.R: - Changed digits=options("digits") which produces + a list of length 1 to digits=getOption("digits") which returns a vector of length one. The former was causing an error when passed to round(). @@ -1231,10 +1234,10 @@ 2002-09-23 14:27 warnes * trunk/gmodels/man/CrossTable.Rd, trunk/gmodels/man/glh.test.Rd, - trunk/gplots/man/barplot2.Rd: - Fixed syntax errors in - barplot2.Rd and CrossTable.Rd - - Fixed incorrect translation of 'F' (distribution) to 'FALSE' - in glh.test.Rd + man/barplot2.Rd: - Fixed syntax errors in barplot2.Rd and ... [truncated message content] |
From: <wa...@us...> - 2006-11-14 18:00:14
|
Revision: 1007 http://svn.sourceforge.net/r-gregmisc/?rev=1007&view=rev Author: warnes Date: 2006-11-14 09:59:51 -0800 (Tue, 14 Nov 2006) Log Message: ----------- Update version number Modified Paths: -------------- trunk/gplots/DESCRIPTION Modified: trunk/gplots/DESCRIPTION =================================================================== --- trunk/gplots/DESCRIPTION 2006-11-14 17:57:22 UTC (rev 1006) +++ trunk/gplots/DESCRIPTION 2006-11-14 17:59:51 UTC (rev 1007) @@ -4,7 +4,7 @@ Depends: R (>= 1.9.0), gtools, gdata, stats Recommends: datasets Suggests: gtools, gdata -Version: 2.3.1 +Version: 2.3.2 Author: Gregory R. Warnes. Includes R source code and/or documentation contributed by Ben Bolker and Thomas Lumley Maintainer: Gregory R. Warnes <wa...@bs...> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-11-10 23:52:04
|
Revision: 1004 http://svn.sourceforge.net/r-gregmisc/?rev=1004&view=rev Author: ggorjan Date: 2006-11-10 15:51:57 -0800 (Fri, 10 Nov 2006) Log Message: ----------- just formatting Modified Paths: -------------- trunk/gdata/NAMESPACE trunk/gdata/NEWS Modified: trunk/gdata/NAMESPACE =================================================================== --- trunk/gdata/NAMESPACE 2006-11-03 01:49:02 UTC (rev 1003) +++ trunk/gdata/NAMESPACE 2006-11-10 23:51:57 UTC (rev 1004) @@ -44,27 +44,25 @@ importFrom(stats, reorder) importFrom(gtools, mixedsort) -S3method(nobs, data.frame) -S3method(nobs, default) -S3method(nobs, lm) -S3method(trim, character) -S3method(trim, default) -S3method(trim, factor) -S3method(trim, list) -S3method(trim, data.frame) S3method(reorder, factor) +## drop.levels stuff S3method(drop.levels, default) S3method(drop.levels, factor) S3method(drop.levels, list) S3method(drop.levels, data.frame) +## 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) @@ -77,10 +75,12 @@ S3method(unique, levelsMap) S3method(sort, levelsMap) -S3method("mapLevels<-", default) -S3method("mapLevels<-", list) -S3method("mapLevels<-", data.frame) +## nobs stuff +S3method(nobs, data.frame) +S3method(nobs, default) +S3method(nobs, lm) +## unknown stuff S3method(isUnknown, default) S3method(isUnknown, POSIXlt) S3method(isUnknown, list) @@ -96,3 +96,10 @@ 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) Modified: trunk/gdata/NEWS =================================================================== --- trunk/gdata/NEWS 2006-11-03 01:49:02 UTC (rev 1003) +++ trunk/gdata/NEWS 2006-11-10 23:51:57 UTC (rev 1004) @@ -14,7 +14,7 @@ - Added c() method for factors based on mapLevels() functions. -- Added write.fwf, which writes file in *F*ixed *W*idth *f*ormat. +- Added write.fwf, which writes file in *F*ixed *W*idth *F*ormat. CHANGES FROM 2.1.X to 2.3.0 (2006-09-19) --------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-11-03 01:49:09
|
Revision: 1003 http://svn.sourceforge.net/r-gregmisc/?rev=1003&view=rev Author: ggorjan Date: 2006-11-02 17:49:02 -0800 (Thu, 02 Nov 2006) Log Message: ----------- ignores Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svn:ignore + *.Rcheck *.tar.gz This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-11-02 15:08:48
|
Revision: 1002 http://svn.sourceforge.net/r-gregmisc/?rev=1002&view=rev Author: ggorjan Date: 2006-11-02 07:08:32 -0800 (Thu, 02 Nov 2006) Log Message: ----------- typos Modified Paths: -------------- trunk/gdata/man/mapLevels.Rd trunk/gdata/man/unknown.Rd Modified: trunk/gdata/man/mapLevels.Rd =================================================================== --- trunk/gdata/man/mapLevels.Rd 2006-10-30 22:54:51 UTC (rev 1001) +++ trunk/gdata/man/mapLevels.Rd 2006-11-02 15:08:32 UTC (rev 1002) @@ -2,7 +2,7 @@ %-------------------------------------------------------------------------- % What: Mapping levels % $Id: mapLevels.Rd,v 1.1 2006/03/29 13:47:10 ggorjan Exp ggorjan $ -% Time-stamp: <2006-10-15 18:36:28 ggorjan> +% Time-stamp: <2006-11-01 00:15:57 ggorjan> %-------------------------------------------------------------------------- \name{mapLevels} @@ -144,7 +144,7 @@ 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 occours, if length of \code{value} is not +\dQuote{listLevelsMap}. Recycling occurs, if length of \code{value} is not the same as number of components/columns of a \dQuote{list/data.frame}. } Modified: trunk/gdata/man/unknown.Rd =================================================================== --- trunk/gdata/man/unknown.Rd 2006-10-30 22:54:51 UTC (rev 1001) +++ trunk/gdata/man/unknown.Rd 2006-11-02 15:08:32 UTC (rev 1002) @@ -2,7 +2,7 @@ %-------------------------------------------------------------------------- % What: Change given unknown value to NA and vice versa man page % $Id$ -% Time-stamp: <2006-10-15 03:52:48 ggorjan> +% Time-stamp: <2006-11-01 00:15:08 ggorjan> %-------------------------------------------------------------------------- \name{unknownToNA} @@ -60,9 +60,10 @@ 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 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 utility function for testing for unknown values. +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 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}, @@ -75,10 +76,10 @@ coercing to vector is applied. Argument \code{unknown} can be feed also with \dQuote{list} in \dQuote{list} and \dQuote{data.frame} methods. -If names \dQuote{list} or \dQuote{vector} is passed to argument +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 occours in all \dQuote{list} and \dQuote{data.frame} methods, +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. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-30 22:54:56
|
Revision: 1001 http://svn.sourceforge.net/r-gregmisc/?rev=1001&view=rev Author: ggorjan Date: 2006-10-30 14:54:51 -0800 (Mon, 30 Oct 2006) Log Message: ----------- some more examples for use of read.fwf after write.fwf Modified Paths: -------------- trunk/gdata/man/write.fwf.Rd Modified: trunk/gdata/man/write.fwf.Rd =================================================================== --- trunk/gdata/man/write.fwf.Rd 2006-10-30 22:34:19 UTC (rev 1000) +++ trunk/gdata/man/write.fwf.Rd 2006-10-30 22:54:51 UTC (rev 1001) @@ -2,7 +2,7 @@ %-------------------------------------------------------------------------- % What: Write fixed width format man page % $Id$ -% Time-stamp: <2006-10-30 20:01:16 ggorjan> +% Time-stamp: <2006-10-30 23:52:00 ggorjan> %-------------------------------------------------------------------------- \name{write.fwf} @@ -179,21 +179,22 @@ formatInfo <- write.fwf(x=testData, file=file, formatInfo=TRUE) ## 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) <- unlist(strsplit(readLines(con=file, n=1), split=" ")) + colnames(tmp) <- read.table(file=file, nrow=1, as.is=TRUE) tmp - \dontrun{ - ## How to persuade read.fwf to accept header properly? - read.fwf(file=file, widths=formatInfo$width + 1, header=TRUE) + ## ... 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)) - } - - ## This works, but without header - read.fwf(file=file, widths=formatInfo$width + 1, header=FALSE, skip=1) - - ## This works, but we have to use quotes + ## ... with header - with the use of quotes write.fwf(x=testData, file=file, quote=TRUE) read.table(file=file, header=TRUE, strip.white=TRUE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-30 22:34:27
|
Revision: 1000 http://svn.sourceforge.net/r-gregmisc/?rev=1000&view=rev Author: ggorjan Date: 2006-10-30 14:34:19 -0800 (Mon, 30 Oct 2006) Log Message: ----------- ignore for report files Property Changed: ---------------- trunk/gdata/inst/unitTests/ Property changes on: trunk/gdata/inst/unitTests ___________________________________________________________________ Name: svn:ignore + report.txt report.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-30 19:19:05
|
Revision: 999 http://svn.sourceforge.net/r-gregmisc/?rev=999&view=rev Author: ggorjan Date: 2006-10-30 11:18:52 -0800 (Mon, 30 Oct 2006) Log Message: ----------- Id tag from source Modified Paths: -------------- trunk/gdata/tests/tests.write.fwf.Rout.save Modified: trunk/gdata/tests/tests.write.fwf.Rout.save =================================================================== --- trunk/gdata/tests/tests.write.fwf.Rout.save 2006-10-30 19:07:20 UTC (rev 998) +++ trunk/gdata/tests/tests.write.fwf.Rout.save 2006-10-30 19:18:52 UTC (rev 999) @@ -21,7 +21,7 @@ > ### tests.write.fwf.R > ###------------------------------------------------------------------------ > ### What: Tests for write.fwf -> ### $Id$ +> ### $Id: tests.write.fwf.R 997 2006-10-30 19:04:53Z ggorjan $ > ### Time-stamp: <2006-10-30 19:54:59 ggorjan> > ###------------------------------------------------------------------------ > @@ -187,5 +187,5 @@ > ### tests.write.fwf.R ends > > proc.time() -[1] 1.283 0.028 1.311 0.000 0.000 +[1] 1.279 0.038 1.306 0.000 0.000 > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-30 19:07:30
|
Revision: 998 http://svn.sourceforge.net/r-gregmisc/?rev=998&view=rev Author: ggorjan Date: 2006-10-30 11:07:20 -0800 (Mon, 30 Oct 2006) Log Message: ----------- removing unused import Modified Paths: -------------- trunk/gdata/NAMESPACE Modified: trunk/gdata/NAMESPACE =================================================================== --- trunk/gdata/NAMESPACE 2006-10-30 19:04:53 UTC (rev 997) +++ trunk/gdata/NAMESPACE 2006-10-30 19:07:20 UTC (rev 998) @@ -41,7 +41,7 @@ NAToUnknown ) -importFrom(stats, reorder, na.omit) +importFrom(stats, reorder) importFrom(gtools, mixedsort) S3method(nobs, data.frame) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-30 19:05:08
|
Revision: 997 http://svn.sourceforge.net/r-gregmisc/?rev=997&view=rev Author: ggorjan Date: 2006-10-30 11:04:53 -0800 (Mon, 30 Oct 2006) Log Message: ----------- Id tag Property Changed: ---------------- trunk/gdata/R/write.fwf.R trunk/gdata/inst/unitTests/runit.write.fwf.R trunk/gdata/man/write.fwf.Rd trunk/gdata/tests/tests.write.fwf.R Property changes on: trunk/gdata/R/write.fwf.R ___________________________________________________________________ Name: svn:keywords + Id Property changes on: trunk/gdata/inst/unitTests/runit.write.fwf.R ___________________________________________________________________ Name: svn:keywords + Id Property changes on: trunk/gdata/man/write.fwf.Rd ___________________________________________________________________ Name: svn:keywords + Id Property changes on: trunk/gdata/tests/tests.write.fwf.R ___________________________________________________________________ Name: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-30 19:02:47
|
Revision: 996 http://svn.sourceforge.net/r-gregmisc/?rev=996&view=rev Author: ggorjan Date: 2006-10-30 11:02:13 -0800 (Mon, 30 Oct 2006) Log Message: ----------- write.fwf Modified Paths: -------------- trunk/gdata/NAMESPACE trunk/gdata/NEWS Added Paths: ----------- trunk/gdata/R/write.fwf.R trunk/gdata/inst/unitTests/runit.write.fwf.R trunk/gdata/man/write.fwf.Rd trunk/gdata/tests/tests.write.fwf.R trunk/gdata/tests/tests.write.fwf.Rout.save Modified: trunk/gdata/NAMESPACE =================================================================== --- trunk/gdata/NAMESPACE 2006-10-30 17:27:38 UTC (rev 995) +++ trunk/gdata/NAMESPACE 2006-10-30 19:02:13 UTC (rev 996) @@ -25,7 +25,7 @@ unmatrix, upperTriangle, "upperTriangle<-", -## write.fwf, + write.fwf, ## mapLevels stuff mapLevels, @@ -85,7 +85,7 @@ S3method(isUnknown, POSIXlt) S3method(isUnknown, list) S3method(isUnknown, data.frame) -## S3method(isUnknown, matrix) +S3method(isUnknown, matrix) S3method(unknownToNA, default) S3method(unknownToNA, factor) Modified: trunk/gdata/NEWS =================================================================== --- trunk/gdata/NEWS 2006-10-30 17:27:38 UTC (rev 995) +++ trunk/gdata/NEWS 2006-10-30 19:02:13 UTC (rev 996) @@ -12,6 +12,10 @@ - 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 FROM 2.1.X to 2.3.0 (2006-09-19) --------------------------------------- Added: trunk/gdata/R/write.fwf.R =================================================================== --- trunk/gdata/R/write.fwf.R (rev 0) +++ trunk/gdata/R/write.fwf.R 2006-10-30 19:02:13 UTC (rev 996) @@ -0,0 +1,104 @@ +### write.fwf.R +###------------------------------------------------------------------------ +### What: Write fixed width format +### $Id$ +### Time-stamp: <2006-10-30 18:58:40 ggorjan> +###------------------------------------------------------------------------ + +write.fwf <- function(x, file="", append=FALSE, quote=FALSE, sep=" ", + na="", rownames=FALSE, colnames=TRUE, rowCol=NULL, + justify="right", formatInfo=FALSE, quoteInfo=TRUE, ...) +{ + if(!(is.data.frame(x) || is.matrix(x))) + stop("'x' must be a data.frame or matrix") + if(rownames) { + x <- cbind(rownames(x), x) + rowColVal <- ifelse(!is.null(rowCol), rowCol, "row") + colnames(x)[1] <- rowColVal + } + colnamesMy <- colnames(x) + + ## --- Format info --- + + if(formatInfo) { + retFormat <- data.frame(colname=colnamesMy, + nlevels=0, + position=0, + width=0, + digits=0, + exp=0) + retFormat$colname <- as.character(retFormat$colname) + + isNum <- sapply(x, is.numeric) + ## is.numeric picks also Date and POSIXt + isNum <- isNum & !(sapply(x, inherits, what="Date") | + sapply(x, inherits, what="POSIXt")) + + ## Numeric is a bit special and we need to get info before format turns + ## all to character + if(any(isNum)) { + tmp <- lapply(x[, isNum, drop=FALSE], format.info, ...) + tmp1 <- sapply(tmp, length) + tmp <- t(as.data.frame(tmp)) + j <- 1 + for(i in which(isNum)) { + retFormat[i, 4:(3+tmp1[j])] <- tmp[j, 1:tmp1[j]] + ## length 1 for exp should mean 1 and not 1+1 + if(tmp1[j] > 2 && tmp[j, 3] > 1) + retFormat[i, "exp"] <- retFormat[i, "exp"] + 1 + j <- j + 1 + } + } + } + + ## --- Format --- + + x <- apply(X=x, MARGIN=2, + FUN=function(z) { + ## NAToUnknown is used since format corces NA to "NA" and + ## then argument na in write.table does not do its job + format(gdata:::NAToUnknown.default(as.character(z), + unknown=as.character(na)), + justify=justify, ...) }) + if(formatInfo) { + if(any(!isNum)) { # need apply as x is now a matrix + retFormat[!isNum, "width"] <- apply(X=x[, !isNum, drop=FALSE], MARGIN=2, + FUN=function(z) format.info(z)[1]) + retFormat[!isNum, "nlevels"] <- apply(X=x[, !isNum, drop=FALSE], MARGIN=2, + FUN=function(z) length(unique(z))) + } + } + + ## --- 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, row.names=FALSE, col.names=FALSE, ...) + } + + write.table(x=x, file=file, append=(colnames || append), quote=quote, + sep=sep, row.names=FALSE, col.names=FALSE, ...) + + ## --- Return format and fixed width information --- + + if(formatInfo) { + ## be carefull 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) + 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) + } +} + +###------------------------------------------------------------------------ +### write.fwf.R ends here Added: trunk/gdata/inst/unitTests/runit.write.fwf.R =================================================================== --- trunk/gdata/inst/unitTests/runit.write.fwf.R (rev 0) +++ trunk/gdata/inst/unitTests/runit.write.fwf.R 2006-10-30 19:02:13 UTC (rev 996) @@ -0,0 +1,97 @@ +### runit.write.fwf.R +###------------------------------------------------------------------------ +### What: Unit tests for write.fwf +### $Id$ +### Time-stamp: <2006-10-30 18:49:04 ggorjan> +###------------------------------------------------------------------------ + +### {{{ --- Test setup --- + +if(FALSE) { + library("RUnit") + library("gdata") +} + +### }}} +### {{{ --- write.fwf --- + +test.write.fwf <- function() +{ + + ## 'x' must be a data.frame or matrix + checkException(write.fwf(1:10)) + checkException(write.fwf(list(1:10))) + + testData <- data.frame(num1=c(1:10, NA), + num2=c(NA, seq(from=1, to=5.5, by=0.5)), + num3=c(NA, rnorm(n=10, mean=1e6, sd=3e5)), + int1=c(as.integer(1:4), NA, as.integer(5:10)), + fac1=factor(c(NA, letters[1:10])), + fac2=factor(c(letters[6:15], NA)), + cha1=c(letters[17:26], NA), + cha2=c(NA, letters[26: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 --- + ## in 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) + formatInfo <- write.fwf(testData[, c("num1", "num2")], formatInfo=TRUE) + checkEquals(formatInfo, formatInfoT) + + ## 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) + formatInfoR <- write.fwf(testData[, c("num1", "num2")], formatInfo=TRUE, + rownames=TRUE, rowCol="row") + checkEquals(formatInfoR, formatInfoTR) + + ## quoteInfo alone does not have any effect + formatInfoI <- write.fwf(testData[, c("num1", "num2")], formatInfo=TRUE, + quoteInfo=TRUE) + checkEquals(formatInfoI, formatInfoT) + + ## quote + formatInfoQ <- write.fwf(testData[, c("num1", "num2")], formatInfo=TRUE, + quote=TRUE) + formatInfoTQ <- formatInfoT + formatInfoTQ$position <- c(1, 6) + formatInfoTQ$width <- c(4, 5) + checkEquals(formatInfoQ, formatInfoTQ) + + ## quote without quoteInfo + formatInfoQI <- write.fwf(testData[, c("num1", "num2")], formatInfo=TRUE, + quote=TRUE, quoteInfo=FALSE) + formatInfoTQI <- formatInfoT + formatInfoTQI$position <- c(2, 6) + checkEquals(formatInfoQI, formatInfoTQI) +} + +### }}} +### {{{ Dear Emacs +## Local variables: +## folded-file: t +## End: +### }}} + +###------------------------------------------------------------------------ +### runit.write.fwf.R ends here Added: trunk/gdata/man/write.fwf.Rd =================================================================== --- trunk/gdata/man/write.fwf.Rd (rev 0) +++ trunk/gdata/man/write.fwf.Rd 2006-10-30 19:02:13 UTC (rev 996) @@ -0,0 +1,208 @@ +% write.fwf.Rd +%-------------------------------------------------------------------------- +% What: Write fixed width format man page +% $Id$ +% Time-stamp: <2006-10-30 20:01:16 ggorjan> +%-------------------------------------------------------------------------- + +\name{write.fwf} + +\alias{write.fwf} + +\concept{data output} +\concept{data export} + +\title{Write object in fixed width format} + +\description{ +\code{write.fwf} writes object in *f*ixed *w*idth *f*ormat. +} + +\usage{ + +write.fwf(x, file="", append=FALSE, quote=FALSE, sep=" ", na="", + rownames=FALSE, colnames=TRUE, rowCol=NULL, justify="right", + formatInfo=FALSE, quoteInfo=TRUE, \ldots) + +} + +\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 + i.e. \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, allignment of character columns} + \item{formatInfo}{logical, return information on number of levels, + widths and format} + \item{quoteInfo}{logical, should \code{formatInfo} account for quotes} + \item{\ldots}{further arguments to \code{\link{format.info}}, + \code{\link{format}} and \code{\link{write.table}}} +} + +\details{ + +Output is similar to \code{print(x)} or \code{format(x)}. Formating 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 \ldots. + +\code{quote} can be used to quote fields in the output. Since all +columns of \code{x} are converted to character during the output, all +columns will be quoted! The following is needed for \code{read.fwf} or +any other tools outside \R. If quotes are used, \code{\link{read.table}} +can be easily used to read the data back into \R. Check examples. Do read +details on \code{quoteInfo}. + +Use only *true* character i.e. not "\t" or similar for \code{sep} as +number of characters in \code{sep} is needed internally. + +Use \code{na} to convert missing/unknown values. Only single value can +be specified. Take a look at \code{\link{NAToUnknown}} 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 (at least in \R 2.4.0) it +is not "easy" to import data back to \R with \code{\link{read.fwf}} if +you also export rownames. That is the reason, that default is +\code{rownames=FALSE}. + +Information about format of output can be returned if +\code{formatInfo=TRUE}. Returned value is described in value +section. Result is provided by \code{\link{format.info}} and care was +taken to handle numeric properly. If output contains rownames, returned +value accounts for this. Additionally, if \code{rowCol} is not +\code{NULL} then returned value contains also information about format +of rownames. + +If \code{quote=TRUE} output is 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 data back to \R if \code{quote=TRUE & quoteInfo=FALSE} was +specifed for export. \code{quoteInfo} applies only when +\code{quote=TRUE}. Assume there is a file with quoted data as shown +bellow (column numbers in first three line 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 (symbolically) + +\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 +} + +} + +\value{ + +Besides its effect to write/export data \code{write.fwf} can provide +information on format and width. 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 + testData <- data.frame(num1=c(1:10, NA), + num2=c(NA, seq(from=1, to=5.5, by=0.5)), + num3=c(NA, rnorm(n=10, mean=1e6, sd=3e5)), + int1=c(as.integer(1:4), NA, as.integer(5:10)), + fac1=factor(c(NA, letters[1:10])), + fac2=factor(c(letters[6:15], NA)), + cha1=c(letters[17:26], NA), + cha2=c(NA, letters[26: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 - or ------------ + write.fwf(x=testData, na="-") + write.fwf(x=testData, na="------------") + + ## Some other separator than space + write.fwf(x=testData[, 1:4], sep="-mySep-") + + ## Write to file and report format and fixed width information + file <- tempfile("test.txt") + formatInfo <- write.fwf(x=testData, file=file, formatInfo=TRUE) + + ## Read exported data back to R (note +1 due to separator) + tmp <- read.fwf(file=file, widths=formatInfo$width + 1, skip=1, + strip.white=TRUE) + colnames(tmp) <- unlist(strsplit(readLines(con=file, n=1), split=" ")) + tmp + + \dontrun{ + ## How to persuade read.fwf to accept header properly? + read.fwf(file=file, widths=formatInfo$width + 1, header=TRUE) + + } + + ## This works, but without header + read.fwf(file=file, widths=formatInfo$width + 1, header=FALSE, skip=1) + + ## This works, but we have to use 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} + +%-------------------------------------------------------------------------- +% write.fwf.Rd ends here Added: trunk/gdata/tests/tests.write.fwf.R =================================================================== --- trunk/gdata/tests/tests.write.fwf.R (rev 0) +++ trunk/gdata/tests/tests.write.fwf.R 2006-10-30 19:02:13 UTC (rev 996) @@ -0,0 +1,61 @@ +### tests.write.fwf.R +###------------------------------------------------------------------------ +### What: Tests for write.fwf +### $Id$ +### Time-stamp: <2006-10-30 19:54:59 ggorjan> +###------------------------------------------------------------------------ + +library(gdata) + +## --- Test data --- + +num <- c(733070.345678, 1214213.78765456, 553823.798765678, + 1085022.8876545678, 571063.88765456, 606718.3876545678, + 1053686.6, 971024.187656, 631193.398765456, 879431.1) + +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(5:10)), + fac1=factor(c(NA, letters[1:10])), + fac2=factor(c(letters[6:15], NA)), + cha1=c(letters[17:26], NA), + cha2=c(NA, letters[26: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 - or ------------ +write.fwf(x=testData, na="-") +write.fwf(x=testData, na="------------") + +## Some other separator than space +write.fwf(testData[, 1:4], sep="-mySep-") + +## With quotes +write.fwf(testData, quote=TRUE) + +## Without rownames +write.fwf(testData, rownames=FALSE) + +## Without colnames +write.fwf(testData, colnames=FALSE) + +## Without rownames and colnames +write.fwf(testData, rownames=FALSE, colnames=FALSE) + +## With rownames and colnames and rowCol +write.fwf(testData, rowCol="HI!") + +## formatInfo in unit tests + +###------------------------------------------------------------------------ +### tests.write.fwf.R ends Added: trunk/gdata/tests/tests.write.fwf.Rout.save =================================================================== --- trunk/gdata/tests/tests.write.fwf.Rout.save (rev 0) +++ trunk/gdata/tests/tests.write.fwf.Rout.save 2006-10-30 19:02:13 UTC (rev 996) @@ -0,0 +1,191 @@ + +R version 2.4.0 (2006-10-03) +Copyright (C) 2006 The R Foundation for Statistical Computing +ISBN 3-900051-07-0 + +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. + + Natural language support but running in an English locale + +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. + +> invisible(options(echo = TRUE)) +> ### tests.write.fwf.R +> ###------------------------------------------------------------------------ +> ### What: Tests for write.fwf +> ### $Id$ +> ### Time-stamp: <2006-10-30 19:54:59 ggorjan> +> ###------------------------------------------------------------------------ +> +> library(gdata) +> +> ## --- Test data --- +> +> num <- c(733070.345678, 1214213.78765456, 553823.798765678, ++ 1085022.8876545678, 571063.88765456, 606718.3876545678, ++ 1053686.6, 971024.187656, 631193.398765456, 879431.1) +> +> 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(5:10)), ++ fac1=factor(c(NA, letters[1:10])), ++ fac2=factor(c(letters[6:15], NA)), ++ cha1=c(letters[17:26], NA), ++ cha2=c(NA, letters[26: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 z 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 5 e k v v 1900-01-01 1900-01-01 01:01:01 + 7 3.5 606718.4 6 f l w u 1900-01-01 1900-01-01 01:01:01 + 8 4.0 1053686.6 7 g m x t 1900-01-01 1900-01-01 01:01:01 + 9 4.5 971024.2 8 h n y s 1900-01-01 1900-01-01 01:01:01 +10 5.0 631193.4 9 i o z r 1900-01-01 1900-01-01 01:01:01 + 5.5 879431.1 10 j q 1900-01-01 1900-01-01 01:01:01 +> +> ## NA should be - or ------------ +> 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 z - 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 5 e k v v 1900-01-01 1900-01-01 01:01:01 + 7 3.5 606718.4 6 f l w u 1900-01-01 1900-01-01 01:01:01 + 8 4.0 1053686.6 7 g m x t 1900-01-01 1900-01-01 01:01:01 + 9 4.5 971024.2 8 h n y s 1900-01-01 1900-01-01 01:01:01 +10 5.0 631193.4 9 i o z r 1900-01-01 1900-01-01 01:01:01 + - 5.5 879431.1 10 j - - q 1900-01-01 1900-01-01 01:01:01 +> 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 z ------------ 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 5 e k v v 1900-01-01 1900-01-01 01:01:01 + 7 3.5 606718.4 6 f l w u 1900-01-01 1900-01-01 01:01:01 + 8 4.0 1053686.6 7 g m x t 1900-01-01 1900-01-01 01:01:01 + 9 4.5 971024.2 8 h n y s 1900-01-01 1900-01-01 01:01:01 + 10 5.0 631193.4 9 i o z r 1900-01-01 1900-01-01 01:01:01 +------------ 5.5 879431.1 10 j ------------ ------------ 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-mySep- 733070.345678-mySep- 2 + 3-mySep-1.5-mySep-1214213.78765456-mySep- 3 + 4-mySep- 2-mySep-553823.798765678-mySep- 4 + 5-mySep-2.5-mySep-1085022.88765457-mySep- + 6-mySep- 3-mySep- 571063.88765456-mySep- 5 + 7-mySep-3.5-mySep-606718.387654568-mySep- 6 + 8-mySep- 4-mySep- 1053686.6-mySep- 7 + 9-mySep-4.5-mySep- 971024.187656-mySep- 8 +10-mySep- 5-mySep-631193.398765456-mySep- 9 + -mySep-5.5-mySep- 879431.1-mySep-10 +> +> ## 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" "z" " " "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" " 5" "e" "k" "v" "v" "1900-01-01" "1900-01-01 01:01:01" +" 7" "3.5" " 606718.4" " 6" "f" "l" "w" "u" "1900-01-01" "1900-01-01 01:01:01" +" 8" "4.0" "1053686.6" " 7" "g" "m" "x" "t" "1900-01-01" "1900-01-01 01:01:01" +" 9" "4.5" " 971024.2" " 8" "h" "n" "y" "s" "1900-01-01" "1900-01-01 01:01:01" +"10" "5.0" " 631193.4" " 9" "i" "o" "z" "r" "1900-01-01" "1900-01-01 01:01:01" +" " "5.5" " 879431.1" "10" "j" " " " " "q" "1900-01-01" "1900-01-01 01:01:01" +> +> ## Without rownames +> write.fwf(testData, rownames=FALSE) +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 z 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 5 e k v v 1900-01-01 1900-01-01 01:01:01 + 7 3.5 606718.4 6 f l w u 1900-01-01 1900-01-01 01:01:01 + 8 4.0 1053686.6 7 g m x t 1900-01-01 1900-01-01 01:01:01 + 9 4.5 971024.2 8 h n y s 1900-01-01 1900-01-01 01:01:01 +10 5.0 631193.4 9 i o z r 1900-01-01 1900-01-01 01:01:01 + 5.5 879431.1 10 j 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 z 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 5 e k v v 1900-01-01 1900-01-01 01:01:01 + 7 3.5 606718.4 6 f l w u 1900-01-01 1900-01-01 01:01:01 + 8 4.0 1053686.6 7 g m x t 1900-01-01 1900-01-01 01:01:01 + 9 4.5 971024.2 8 h n y s 1900-01-01 1900-01-01 01:01:01 +10 5.0 631193.4 9 i o z r 1900-01-01 1900-01-01 01:01:01 + 5.5 879431.1 10 j q 1900-01-01 1900-01-01 01:01:01 +> +> ## Without rownames and colnames +> write.fwf(testData, rownames=FALSE, colnames=FALSE) + 1 1 f q 1900-01-01 1900-01-01 01:01:01 + 2 1.0 733070.3 2 a g r z 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 5 e k v v 1900-01-01 1900-01-01 01:01:01 + 7 3.5 606718.4 6 f l w u 1900-01-01 1900-01-01 01:01:01 + 8 4.0 1053686.6 7 g m x t 1900-01-01 1900-01-01 01:01:01 + 9 4.5 971024.2 8 h n y s 1900-01-01 1900-01-01 01:01:01 +10 5.0 631193.4 9 i o z r 1900-01-01 1900-01-01 01:01:01 + 5.5 879431.1 10 j q 1900-01-01 1900-01-01 01:01:01 +> +> ## With rownames and colnames and rowCol +> write.fwf(testData, rowCol="HI!") +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 z 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 5 e k v v 1900-01-01 1900-01-01 01:01:01 + 7 3.5 606718.4 6 f l w u 1900-01-01 1900-01-01 01:01:01 + 8 4.0 1053686.6 7 g m x t 1900-01-01 1900-01-01 01:01:01 + 9 4.5 971024.2 8 h n y s 1900-01-01 1900-01-01 01:01:01 +10 5.0 631193.4 9 i o z r 1900-01-01 1900-01-01 01:01:01 + 5.5 879431.1 10 j q 1900-01-01 1900-01-01 01:01:01 +> +> ## formatInfo in unit tests +> +> ###------------------------------------------------------------------------ +> ### tests.write.fwf.R ends +> +> proc.time() +[1] 1.283 0.028 1.311 0.000 0.000 +> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-30 17:27:49
|
Revision: 995 http://svn.sourceforge.net/r-gregmisc/?rev=995&view=rev Author: ggorjan Date: 2006-10-30 09:27:38 -0800 (Mon, 30 Oct 2006) Log Message: ----------- Id tag Property Changed: ---------------- trunk/gdata/inst/unitTests/runit.reorder.factor.R Property changes on: trunk/gdata/inst/unitTests/runit.reorder.factor.R ___________________________________________________________________ Name: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-30 17:26:47
|
Revision: 994 http://svn.sourceforge.net/r-gregmisc/?rev=994&view=rev Author: ggorjan Date: 2006-10-30 09:26:32 -0800 (Mon, 30 Oct 2006) Log Message: ----------- added unit tests for reorder.factor Added Paths: ----------- trunk/gdata/inst/unitTests/runit.reorder.factor.R Added: trunk/gdata/inst/unitTests/runit.reorder.factor.R =================================================================== --- trunk/gdata/inst/unitTests/runit.reorder.factor.R (rev 0) +++ trunk/gdata/inst/unitTests/runit.reorder.factor.R 2006-10-30 17:26:32 UTC (rev 994) @@ -0,0 +1,64 @@ +### runit.reorder.factor.R +###------------------------------------------------------------------------ +### What: Tests for reorder.factor +### $Id$ +### Time-stamp: <2006-10-30 18:25:05 ggorjan> +###------------------------------------------------------------------------ + +### {{{ --- Test setup --- + +if(FALSE) { + library("RUnit") + library("gdata") +} + +### }}} +### {{{ --- reorder.factor --- + +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) +} + +### }}} +### {{{ Dear Emacs +## Local variables: +## folded-file: t +## End: +### }}} + +###------------------------------------------------------------------------ +### runit.reorder.factor.R ends here Property changes on: trunk/gdata/inst/unitTests/runit.reorder.factor.R ___________________________________________________________________ Name: svn:keyword + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-30 17:10:39
|
Revision: 993 http://svn.sourceforge.net/r-gregmisc/?rev=993&view=rev Author: ggorjan Date: 2006-10-30 09:10:08 -0800 (Mon, 30 Oct 2006) Log Message: ----------- mapply keeps names in R 2.4; POSIX unit tests solved; $ should work now Modified Paths: -------------- trunk/gdata/R/mapLevels.R trunk/gdata/R/unknown.R trunk/gdata/inst/unitTests/runit.unknown.R Property Changed: ---------------- trunk/gdata/R/c.factor.R trunk/gdata/R/mapLevels.R trunk/gdata/R/unknown.R trunk/gdata/inst/unitTests/runit.drop.levels.R trunk/gdata/inst/unitTests/runit.mapLevels.R trunk/gdata/inst/unitTests/runit.trim.R trunk/gdata/inst/unitTests/runit.unknown.R trunk/gdata/man/c.factor.Rd trunk/gdata/man/unknown.Rd trunk/gdata/tests/doRUnit.R Property changes on: trunk/gdata/R/c.factor.R ___________________________________________________________________ Name: svn:keywords + Id Modified: trunk/gdata/R/mapLevels.R =================================================================== --- trunk/gdata/R/mapLevels.R 2006-10-29 16:08:40 UTC (rev 992) +++ trunk/gdata/R/mapLevels.R 2006-10-30 17:10:08 UTC (rev 993) @@ -1,7 +1,7 @@ ### mapLevels.R ###------------------------------------------------------------------------ ### What: Mapping levels -### $Id: mapLevels.R,v 1.1 2006/03/29 13:47:15 ggorjan Exp ggorjan $ +### $Id$ ### Time-stamp: <2006-10-29 16:45:20 ggorjan> ###------------------------------------------------------------------------ Property changes on: trunk/gdata/R/mapLevels.R ___________________________________________________________________ Name: svn:keywords + Id Modified: trunk/gdata/R/unknown.R =================================================================== --- trunk/gdata/R/unknown.R 2006-10-29 16:08:40 UTC (rev 992) +++ trunk/gdata/R/unknown.R 2006-10-30 17:10:08 UTC (rev 993) @@ -1,12 +1,11 @@ ### unknown.R ###------------------------------------------------------------------------ ### What: Change given unknown value to NA and vice versa -### $Id$ -### Time-stamp: <2006-10-29 17:08:21 ggorjan> +### $Id:$ +### Time-stamp: <2006-10-30 18:06:17 ggorjan> ###------------------------------------------------------------------------ ### {{{ isUnknown - ###------------------------------------------------------------------------ isUnknown <- function(x, unknown=NA, ...) @@ -34,10 +33,7 @@ isUnknown.list <- function(x, unknown=NA, ...) { unknown <- gdata:::.unknownList(x=x, unknown=unknown) - ## FIXME - do I still need attributes here; R 2.4 - ## attrX <- attributes(x) x <- mapply(FUN="isUnknown", x=x, unknown=unknown, ..., SIMPLIFY=FALSE) - ## attributes(x) <- attrX x } @@ -53,7 +49,6 @@ ### }}} ### {{{ unknownToNA - ###------------------------------------------------------------------------ unknownToNA <- function(x, unknown, warning=FALSE, ...) @@ -87,11 +82,8 @@ unknownToNA.list <- function(x, unknown, warning=FALSE, ...) { unknown <- gdata:::.unknownList(x=x, unknown=unknown) - ## FIXME - do I still need attributes here; R 2.4 - ## attrX <- attributes(x) x <- mapply(FUN="unknownToNA", x=x, unknown=unknown, warning=warning, SIMPLIFY=FALSE) - ## attributes(x) <- attrX return(x) } @@ -103,7 +95,6 @@ ### }}} ### {{{ NAToUnknown - ###------------------------------------------------------------------------ NAToUnknown <- function(x, unknown, force=FALSE, call.=FALSE, ...) @@ -148,11 +139,8 @@ NAToUnknown.list <- function(x, unknown, force=FALSE, call.=FALSE, ...) { unknown <- gdata:::.unknownList(x=x, unknown=unknown) - ## FIXME - do I still need attributes here; R 2.4 - ## attrX <- attributes(x) x <- mapply(FUN="NAToUnknown", x=x, unknown=unknown, force=force, call.=call., SIMPLIFY=FALSE) - ## attributes(x) <- attrX x } Property changes on: trunk/gdata/R/unknown.R ___________________________________________________________________ Name: svn:keywords + Id Property changes on: trunk/gdata/inst/unitTests/runit.drop.levels.R ___________________________________________________________________ Name: svn:keywords + Id Property changes on: trunk/gdata/inst/unitTests/runit.mapLevels.R ___________________________________________________________________ Name: svn:keywords + Id Property changes on: trunk/gdata/inst/unitTests/runit.trim.R ___________________________________________________________________ Name: svn:keywords + Id Modified: trunk/gdata/inst/unitTests/runit.unknown.R =================================================================== --- trunk/gdata/inst/unitTests/runit.unknown.R 2006-10-29 16:08:40 UTC (rev 992) +++ trunk/gdata/inst/unitTests/runit.unknown.R 2006-10-30 17:10:08 UTC (rev 993) @@ -2,7 +2,7 @@ ###------------------------------------------------------------------------ ### What: Tests for Change given unknown value to NA and vice versa methods ### $Id$ -### Time-stamp: <2006-10-29 17:06:04 ggorjan> +### Time-stamp: <2006-10-30 17:46:21 ggorjan> ###------------------------------------------------------------------------ ### {{{ --- Test setup --- @@ -48,28 +48,31 @@ xFacUnkLevTest <- c(1, 0, 0, 0, 0, 0, 0, 0, 1) xFacUnkLevTest <- as.logical(xFacUnkLevTest) -dateUnk <- as.Date("1900-1-1") -xDate <- c(as.Date("2006-08-31"), NA) -xDateUnk <- c(as.Date("2006-08-31"), dateUnk) -xDateTest <- c(FALSE, TRUE) +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(as.Date("2006-08-31"), dateUnk, NA) -xDate1Test <- c(FALSE, TRUE, FALSE) +xDate1Unk <- c(tmp, dateUnk, NA) +xDate1Test <- c(FALSE, TRUE, FALSE) -POSIXltUnk <- strptime("1900-1-1", format="%Y-%m-%d") -xPOSIXlt <- c(strptime("2006-08-31", format="%Y-%m-%d"), NA) -xPOSIXltUnk <- c(strptime("2006-08-31", format="%Y-%m-%d"), POSIXltUnk) -xPOSIXltTest <- c(FALSE, TRUE) +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(strptime("2006-08-31", format="%Y-%m-%d"), POSIXltUnk, NA) -xPOSIXlt1Test <- c(FALSE, TRUE, FALSE) +xPOSIXlt1Unk <- c(tmp, POSIXltUnk, NA) +xPOSIXlt1Test <- c(FALSE, TRUE, FALSE) -POSIXctUnk <- as.POSIXct(strptime("1900-1-1 01:01:01", format="%Y-%m-%d %H:%M:%S")) -xPOSIXct <- c(as.POSIXct(strptime("2006-08-31 01:01:01", format="%Y-%m-%d %H:%M:%S")), NA) -xPOSIXctUnk <- c(as.POSIXct(strptime("2006-08-31 01:01:01", format="%Y-%m-%d %H:%M:%S")), POSIXctUnk) +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(as.POSIXct(strptime("2006-08-31 01:01:01", format="%Y-%m-%d %H:%M:%S")), POSIXctUnk, NA) +xPOSIXct1Unk <- c(tmp, POSIXctUnk, NA) xPOSIXct1Test <- xPOSIXlt1Test ### }}} @@ -427,8 +430,7 @@ ## Date-time classes checkIdentical(NAToUnknown(xDate, unknown=dateUnk), xDateUnk) - ## FIXME - ## checkIdentical(NAToUnknown(xPOSIXlt, unknown=POSIXltUnk), xPOSIXltUnk) + checkIdentical(NAToUnknown(xPOSIXlt, unknown=POSIXltUnk), xPOSIXltUnk) checkIdentical(NAToUnknown(xPOSIXct, unknown=POSIXctUnk), xPOSIXctUnk) ## --- lists and data.frames --- Property changes on: trunk/gdata/inst/unitTests/runit.unknown.R ___________________________________________________________________ Name: svn:keywords + Id Property changes on: trunk/gdata/man/c.factor.Rd ___________________________________________________________________ Name: svn:keywords + Id Property changes on: trunk/gdata/man/unknown.Rd ___________________________________________________________________ Name: svn:keywords + Id Property changes on: trunk/gdata/tests/doRUnit.R ___________________________________________________________________ Name: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-29 16:08:52
|
Revision: 992 http://svn.sourceforge.net/r-gregmisc/?rev=992&view=rev Author: ggorjan Date: 2006-10-29 08:08:40 -0800 (Sun, 29 Oct 2006) Log Message: ----------- fixed problem in tests; added unknown methods and tests for matrices Modified Paths: -------------- trunk/gdata/NEWS trunk/gdata/R/unknown.R trunk/gdata/inst/unitTests/runit.unknown.R trunk/gdata/man/unknown.Rd Modified: trunk/gdata/NEWS =================================================================== --- trunk/gdata/NEWS 2006-10-29 15:47:33 UTC (rev 991) +++ trunk/gdata/NEWS 2006-10-29 16:08:40 UTC (rev 992) @@ -10,6 +10,8 @@ - trim() gains ... argument. +- Added "unknown" methods for matrices. + CHANGES FROM 2.1.X to 2.3.0 (2006-09-19) --------------------------------------- Modified: trunk/gdata/R/unknown.R =================================================================== --- trunk/gdata/R/unknown.R 2006-10-29 15:47:33 UTC (rev 991) +++ trunk/gdata/R/unknown.R 2006-10-29 16:08:40 UTC (rev 992) @@ -2,14 +2,15 @@ ###------------------------------------------------------------------------ ### What: Change given unknown value to NA and vice versa ### $Id$ -### Time-stamp: <2006-09-10 03:52:39 ggorjan> +### Time-stamp: <2006-10-29 17:08:21 ggorjan> ###------------------------------------------------------------------------ ### {{{ isUnknown + ###------------------------------------------------------------------------ isUnknown <- function(x, unknown=NA, ...) - UseMethod("isUnknown") + UseMethod("isUnknown", x=x) isUnknown.default <- function(x, unknown=NA, ...) { @@ -21,10 +22,12 @@ 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(unknown, ...) + unknown <- as.character(x=unknown, ...) } isUnknown.default(x=as.character(x), unknown=unknown) } @@ -32,9 +35,9 @@ isUnknown.list <- function(x, unknown=NA, ...) { unknown <- gdata:::.unknownList(x=x, unknown=unknown) ## FIXME - do I still need attributes here; R 2.4 - attrX <- attributes(x) + ## attrX <- attributes(x) x <- mapply(FUN="isUnknown", x=x, unknown=unknown, ..., SIMPLIFY=FALSE) - attributes(x) <- attrX + ## attributes(x) <- attrX x } @@ -44,14 +47,19 @@ x } +isUnknown.matrix <- function(x, unknown=NA, ...) + apply(X=x, MARGIN=ifelse(ncol(x) > nrow(x), 1, 2), FUN=isUnknown, + unknown=unknown) + ### }}} ### {{{ unknownToNA + ###------------------------------------------------------------------------ -unknownToNA <- function(x, unknown, warning=FALSE) +unknownToNA <- function(x, unknown, warning=FALSE, ...) UseMethod("unknownToNA") -unknownToNA.default <- function(x, unknown, warning=FALSE) +unknownToNA.default <- function(x, unknown, warning=FALSE, ...) { if(warning) { if(any(is.na(x))) @@ -61,7 +69,7 @@ x } -unknownToNA.factor <- function(x, unknown, warning=FALSE) +unknownToNA.factor <- function(x, unknown, warning=FALSE, ...) { ## could put this func into default method, but I need unlisted unknown ## for levels handling @@ -76,18 +84,18 @@ factor(x, levels=levs) } -unknownToNA.list <- function(x, unknown, warning=FALSE) +unknownToNA.list <- function(x, unknown, warning=FALSE, ...) { unknown <- gdata:::.unknownList(x=x, unknown=unknown) ## FIXME - do I still need attributes here; R 2.4 - attrX <- attributes(x) + ## attrX <- attributes(x) x <- mapply(FUN="unknownToNA", x=x, unknown=unknown, warning=warning, SIMPLIFY=FALSE) - attributes(x) <- attrX + ## attributes(x) <- attrX return(x) } -unknownToNA.data.frame <- function(x, unknown, warning=FALSE) +unknownToNA.data.frame <- function(x, unknown, warning=FALSE, ...) { x[] <- unknownToNA.list(x=x, unknown=unknown, warning=warning) x @@ -95,12 +103,13 @@ ### }}} ### {{{ NAToUnknown + ###------------------------------------------------------------------------ -NAToUnknown <- function(x, unknown, force=FALSE, call.=FALSE) +NAToUnknown <- function(x, unknown, force=FALSE, call.=FALSE, ...) UseMethod("NAToUnknown") -NAToUnknown.default <- function(x, unknown, force=FALSE, call.=FALSE) +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") @@ -120,7 +129,7 @@ x } -NAToUnknown.factor <- function(x, unknown, force=FALSE, call.=FALSE) +NAToUnknown.factor <- function(x, unknown, force=FALSE, call.=FALSE, ...) { if(length(unknown) != 1) stop("'unknown' must be a single value") @@ -136,18 +145,18 @@ x } -NAToUnknown.list <- function(x, unknown, force=FALSE, call.=FALSE) +NAToUnknown.list <- function(x, unknown, force=FALSE, call.=FALSE, ...) { unknown <- gdata:::.unknownList(x=x, unknown=unknown) ## FIXME - do I still need attributes here; R 2.4 - attrX <- attributes(x) + ## attrX <- attributes(x) x <- mapply(FUN="NAToUnknown", x=x, unknown=unknown, force=force, call.=call., SIMPLIFY=FALSE) - attributes(x) <- attrX + ## attributes(x) <- attrX x } -NAToUnknown.data.frame <- function(x, unknown, force=FALSE, call.=FALSE) +NAToUnknown.data.frame <- function(x, unknown, force=FALSE, call.=FALSE, ...) { x[] <- NAToUnknown.list(x=x, unknown=unknown, force=force, call.=call.) x Modified: trunk/gdata/inst/unitTests/runit.unknown.R =================================================================== --- trunk/gdata/inst/unitTests/runit.unknown.R 2006-10-29 15:47:33 UTC (rev 991) +++ trunk/gdata/inst/unitTests/runit.unknown.R 2006-10-29 16:08:40 UTC (rev 992) @@ -2,7 +2,7 @@ ###------------------------------------------------------------------------ ### What: Tests for Change given unknown value to NA and vice versa methods ### $Id$ -### Time-stamp: <2006-09-07 15:33:50 ggorjan> +### Time-stamp: <2006-10-29 17:06:04 ggorjan> ###------------------------------------------------------------------------ ### {{{ --- Test setup --- @@ -125,7 +125,7 @@ xDFUnk1 <- as.data.frame(xListNUnk1) xDFUnk1$cha <- as.character(xDFUnk1$cha) xDFUnk1Test <- as.data.frame(xListUnk1Test) -colnames(xDFUnk1Test) <- names(xListNUnk1) +names(xDFUnk1Test) <- names(xListNUnk1) unkC2 <- c(0, "notAvail") xListUnk2 <- list(as.integer(c(unkC2[1], 1, 2, unkC2[1], 5, 6, 7, 8, 9)), @@ -165,6 +165,20 @@ 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" @@ -280,6 +294,11 @@ ## 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) } ### }}} @@ -310,8 +329,7 @@ ## Date-time classes checkIdentical(unknownToNA(xDateUnk, unknown=dateUnk), xDate) - ## FIXME uncomment in R 2.4 - ## checkIdentical(unknownToNA(xPOSIXltUnk, unknown=POSIXltUnk), xPOSIXlt) + checkIdentical(unknownToNA(xPOSIXltUnk, unknown=POSIXltUnk), xPOSIXlt) checkIdentical(unknownToNA(xPOSIXctUnk, unknown=POSIXctUnk), xPOSIXct) ## --- lists and data.frames --- @@ -368,6 +386,10 @@ 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) } ### }}} @@ -405,7 +427,7 @@ ## Date-time classes checkIdentical(NAToUnknown(xDate, unknown=dateUnk), xDateUnk) - ## FIXME uncomment in R 2.4 + ## FIXME ## checkIdentical(NAToUnknown(xPOSIXlt, unknown=POSIXltUnk), xPOSIXltUnk) checkIdentical(NAToUnknown(xPOSIXct, unknown=POSIXctUnk), xPOSIXctUnk) @@ -464,6 +486,9 @@ ## 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) } ### }}} Modified: trunk/gdata/man/unknown.Rd =================================================================== --- trunk/gdata/man/unknown.Rd 2006-10-29 15:47:33 UTC (rev 991) +++ trunk/gdata/man/unknown.Rd 2006-10-29 16:08:40 UTC (rev 992) @@ -2,7 +2,7 @@ %-------------------------------------------------------------------------- % What: Change given unknown value to NA and vice versa man page % $Id$ -% Time-stamp: <2006-09-07 15:38:12 ggorjan> +% Time-stamp: <2006-10-15 03:52:48 ggorjan> %-------------------------------------------------------------------------- \name{unknownToNA} @@ -12,6 +12,7 @@ \alias{isUnknown.POSIXlt} \alias{isUnknown.list} \alias{isUnknown.data.frame} +\alias{isUnknown.matrix} \alias{unknownToNA} \alias{unknownToNA.default} @@ -39,8 +40,8 @@ \usage{ isUnknown(x, unknown=NA, \ldots) -unknownToNA(x, unknown, warning=FALSE) -NAToUnknown(x, unknown, force=FALSE, call.=FALSE) +unknownToNA(x, unknown, warning=FALSE, \ldots) +NAToUnknown(x, unknown, force=FALSE, call.=FALSE, \ldots) } @@ -49,7 +50,8 @@ \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{\ldots}{arguments pased to as.character POSIXlt method} + \item{\ldots}{arguments pased to other methods (as.character for POSIXlt + in case of isUnknown)} \item{call.}{logical, look in \code{\link{warning}}} } @@ -65,8 +67,8 @@ 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}. For others default -method might work just fine. +\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, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-29 15:47:44
|
Revision: 991 http://svn.sourceforge.net/r-gregmisc/?rev=991&view=rev Author: ggorjan Date: 2006-10-29 07:47:33 -0800 (Sun, 29 Oct 2006) Log Message: ----------- sort is generic now; mapply keeps names in R 2.4.0; some codetools suggestions fixed Modified Paths: -------------- trunk/gdata/R/drop.levels.R trunk/gdata/R/mapLevels.R trunk/gdata/inst/unitTests/runit.mapLevels.R trunk/gdata/man/mapLevels.Rd trunk/gdata/tests/doRUnit.R Modified: trunk/gdata/R/drop.levels.R =================================================================== --- trunk/gdata/R/drop.levels.R 2006-10-29 15:34:19 UTC (rev 990) +++ trunk/gdata/R/drop.levels.R 2006-10-29 15:47:33 UTC (rev 991) @@ -1,6 +1,6 @@ drop.levels <- function(x, reorder=TRUE, ...) - UseMethod("drop.levels") + UseMethod("drop.levels", x=x) drop.levels.default <- function(x, reorder=TRUE, ...) x Modified: trunk/gdata/R/mapLevels.R =================================================================== --- trunk/gdata/R/mapLevels.R 2006-10-29 15:34:19 UTC (rev 990) +++ trunk/gdata/R/mapLevels.R 2006-10-29 15:47:33 UTC (rev 991) @@ -2,7 +2,7 @@ ###------------------------------------------------------------------------ ### What: Mapping levels ### $Id: mapLevels.R,v 1.1 2006/03/29 13:47:15 ggorjan Exp ggorjan $ -### Time-stamp: <2006-09-10 03:54:56 ggorjan> +### Time-stamp: <2006-10-29 16:45:20 ggorjan> ###------------------------------------------------------------------------ ### {{{ mapLevels @@ -12,7 +12,7 @@ mapLevels <- function(x, codes=TRUE, sort=TRUE, drop=FALSE, combine=FALSE, ...) { - UseMethod("mapLevels") + UseMethod("mapLevels", x=x) } mapLevels.default <- function(x, codes=TRUE, sort=TRUE, drop=FALSE, @@ -88,10 +88,10 @@ .unlistLevelsMap <- function(x, ind=FALSE) { y <- unlist(x, use.names=FALSE) - length <- sapply(x, FUN=length) - names(y) <- rep(names(x), times=length) + len <- sapply(x, FUN=length) + names(y) <- rep(names(x), times=len) if(ind) { - return(list(y, rep(1:length(x), times=length), length)) + return(list(y, rep(1:length(x), times=len), len)) } else { return(y) } @@ -214,6 +214,7 @@ { x <- list(...) class(x) <- "listLevelsMap" + ## we use recursive=TRUE here because ... is a lists of lists c(x, sort=sort, recursive=TRUE) } @@ -231,7 +232,7 @@ x <- unlist(x, recursive=FALSE) ## how to merge components with the same name? class(x) <- "levelsMap" - if(sort) x <- sort.levelsMap(x) + if(sort) x <- sort(x) x <- unique(x) } x @@ -330,13 +331,7 @@ dQuote("listLevelsMap"), dQuote("levelsMap"))) } } - ## FIXME: mapply drops names - if(!is.null(names(x))) { - isNamed <- TRUE - namesX <- names(x) - } x <- mapply(FUN="mapLevels<-", x=x, value=value, SIMPLIFY=FALSE) - if(isNamed) names(x) <- namesX x } Modified: trunk/gdata/inst/unitTests/runit.mapLevels.R =================================================================== --- trunk/gdata/inst/unitTests/runit.mapLevels.R 2006-10-29 15:34:19 UTC (rev 990) +++ trunk/gdata/inst/unitTests/runit.mapLevels.R 2006-10-29 15:47:33 UTC (rev 991) @@ -2,16 +2,280 @@ ###------------------------------------------------------------------------ ### What: Unit tests for mapLevels et al. ### $Id$ -### Time-stamp: <2006-08-31 02:24:20 ggorjan> +### Time-stamp: <2006-10-29 16:41:41 ggorjan> ###------------------------------------------------------------------------ -### {{{ --- Test setup --- if(FALSE) { library("RUnit") library("gdata") } ### }}} -### {{{ mapLevels, is.*, as.*, [.* 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) } ### }}} -### {{{ .check* 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 } ### }}} -### {{{ c.* 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.levelsMap(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) } ### }}} -### {{{ unique 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)) } ### }}} -### {{{ mapLevels<- "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 } ### }}} -### {{{ Dear Emacs ## Local variables: ## folded-file: t ## End: ### }}} +### {{{ --- Test setup --- +if(FALSE) { + library("RUnit") + library("gdata") +} + +### }}} +### {{{ mapLevels, is.*, as.*, [.* + +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) +} + +### }}} +### {{{ .check* + +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 +} + +### }}} +### {{{ c.* + +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) +} + +### }}} +### {{{ unique + +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)) +} + +### }}} +### {{{ mapLevels<- + +"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 + +} + +### }}} +### {{{ Dear Emacs +## Local variables: +## folded-file: t +## End: +### }}} + ###------------------------------------------------------------------------ ### runit.mapLevels.R ends here Modified: trunk/gdata/man/mapLevels.Rd =================================================================== --- trunk/gdata/man/mapLevels.Rd 2006-10-29 15:34:19 UTC (rev 990) +++ trunk/gdata/man/mapLevels.Rd 2006-10-29 15:47:33 UTC (rev 991) @@ -2,7 +2,7 @@ %-------------------------------------------------------------------------- % What: Mapping levels % $Id: mapLevels.Rd,v 1.1 2006/03/29 13:47:10 ggorjan Exp ggorjan $ -% Time-stamp: <2006-08-31 02:43:29 ggorjan> +% Time-stamp: <2006-10-15 18:36:28 ggorjan> %-------------------------------------------------------------------------- \name{mapLevels} @@ -144,7 +144,7 @@ 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{levelsMap}. Recycling occours, if length of \code{value} is not +\dQuote{listLevelsMap}. Recycling occours, if length of \code{value} is not the same as number of components/columns of a \dQuote{list/data.frame}. } Modified: trunk/gdata/tests/doRUnit.R =================================================================== --- trunk/gdata/tests/doRUnit.R 2006-10-29 15:34:19 UTC (rev 990) +++ trunk/gdata/tests/doRUnit.R 2006-10-29 15:47:33 UTC (rev 991) @@ -2,7 +2,7 @@ ###------------------------------------------------------------------------ ### What: Run RUnit tests ### $Id$ -### Time-stamp: <2006-09-18 13:14:34 ggorjan> +### Time-stamp: <2006-10-29 16:37:40 ggorjan> ###------------------------------------------------------------------------ if(require("RUnit", quietly=TRUE)) { @@ -26,8 +26,7 @@ ## --- Testing --- ## Define tests - testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), - dirs=path) + testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), dirs=path) ## Run tests <- runTestSuite(testSuite) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-29 15:34:33
|
Revision: 990 http://svn.sourceforge.net/r-gregmisc/?rev=990&view=rev Author: ggorjan Date: 2006-10-29 07:34:19 -0800 (Sun, 29 Oct 2006) Log Message: ----------- sort is generic from R 2.4.0 Modified Paths: -------------- trunk/gdata/DESCRIPTION trunk/gdata/NAMESPACE Modified: trunk/gdata/DESCRIPTION =================================================================== --- trunk/gdata/DESCRIPTION 2006-10-29 15:28:26 UTC (rev 989) +++ trunk/gdata/DESCRIPTION 2006-10-29 15:34:19 UTC (rev 990) @@ -1,7 +1,7 @@ Package: gdata Title: Various R programming tools for data manipulation Description: Various R programming tools for data manipulation -Depends: R (>= 1.9.0) +Depends: R (>= 2.4.0) Imports: gtools Version: 2.3.1 Author: Gregory R. Warnes. Includes R source code and/or documentation Modified: trunk/gdata/NAMESPACE =================================================================== --- trunk/gdata/NAMESPACE 2006-10-29 15:28:26 UTC (rev 989) +++ trunk/gdata/NAMESPACE 2006-10-29 15:34:19 UTC (rev 990) @@ -25,6 +25,7 @@ unmatrix, upperTriangle, "upperTriangle<-", +## write.fwf, ## mapLevels stuff mapLevels, @@ -32,7 +33,6 @@ as.listLevelsMap, is.levelsMap, is.listLevelsMap, - sort.levelsMap, ## FIXME remove in R 2.4 "mapLevels<-", ## unknown stuff @@ -44,15 +44,15 @@ importFrom(stats, reorder, na.omit) importFrom(gtools, mixedsort) -S3method(nobs,data.frame) -S3method(nobs,default) -S3method(nobs,lm) +S3method(nobs, data.frame) +S3method(nobs, default) +S3method(nobs, lm) S3method(trim, character) S3method(trim, default) S3method(trim, factor) S3method(trim, list) S3method(trim, data.frame) -S3method(reorder,factor) +S3method(reorder, factor) S3method(drop.levels, default) S3method(drop.levels, factor) @@ -75,7 +75,7 @@ S3method(c, listLevelsMap) S3method(unique, levelsMap) -## S3method(sort, levelsMap) ## FIXME uncomment in R 2.4 +S3method(sort, levelsMap) S3method("mapLevels<-", default) S3method("mapLevels<-", list) @@ -85,6 +85,7 @@ S3method(isUnknown, POSIXlt) S3method(isUnknown, list) S3method(isUnknown, data.frame) +## S3method(isUnknown, matrix) S3method(unknownToNA, default) S3method(unknownToNA, factor) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-29 15:28:35
|
Revision: 989 http://svn.sourceforge.net/r-gregmisc/?rev=989&view=rev Author: ggorjan Date: 2006-10-29 07:28:26 -0800 (Sun, 29 Oct 2006) Log Message: ----------- trim() gains ... argument; version bump Modified Paths: -------------- trunk/gdata/DESCRIPTION trunk/gdata/NEWS trunk/gdata/R/trim.R trunk/gdata/man/trim.Rd Modified: trunk/gdata/DESCRIPTION =================================================================== --- trunk/gdata/DESCRIPTION 2006-10-29 12:55:08 UTC (rev 988) +++ trunk/gdata/DESCRIPTION 2006-10-29 15:28:26 UTC (rev 989) @@ -3,7 +3,7 @@ Description: Various R programming tools for data manipulation Depends: R (>= 1.9.0) Imports: gtools -Version: 2.3.0 +Version: 2.3.1 Author: Gregory R. Warnes. Includes R source code and/or documentation contributed by Ben Bolker, Gregor Gorjanc, and Thomas Lumley Maintainer: Gregory Warnes <gre...@ur...> Modified: trunk/gdata/NEWS =================================================================== --- trunk/gdata/NEWS 2006-10-29 12:55:08 UTC (rev 988) +++ trunk/gdata/NEWS 2006-10-29 15:28:26 UTC (rev 989) @@ -8,6 +8,8 @@ reorder(trt, new.order=c("PLACEBO", "300 MG", "600 MG", "1200 MG")) +- trim() gains ... argument. + CHANGES FROM 2.1.X to 2.3.0 (2006-09-19) --------------------------------------- Modified: trunk/gdata/R/trim.R =================================================================== --- trunk/gdata/R/trim.R 2006-10-29 12:55:08 UTC (rev 988) +++ trunk/gdata/R/trim.R 2006-10-29 15:28:26 UTC (rev 989) @@ -1,30 +1,34 @@ # $Id$ -trim <- function(s, recode.factor=TRUE) +trim <- function(s, recode.factor=TRUE, ...) UseMethod("trim", s) -trim.default <- function(s, recode.factor=TRUE) +trim.default <- function(s, recode.factor=TRUE, ...) s -trim.character <- function(s, recode.factor=TRUE) +trim.character <- function(s, recode.factor=TRUE, ...) { s <- sub(pattern="^ +", replacement="", x=s) s <- sub(pattern=" +$", replacement="", x=s) s } -trim.factor <- function(s, recode.factor=TRUE) +trim.factor <- function(s, recode.factor=TRUE, ...) { levels(s) <- trim(levels(s)) - if(recode.factor) s <- reorder.factor(s, sort=sort) + 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.list <- function(s, recode.factor=TRUE, ...) + lapply(s, trim, recode.factor=recode.factor, ...) -trim.data.frame <- function(s, recode.factor=TRUE) +trim.data.frame <- function(s, recode.factor=TRUE, ...) { - s[] <- trim.list(s, recode.factor=recode.factor) + s[] <- trim.list(s, recode.factor=recode.factor, ...) s } Modified: trunk/gdata/man/trim.Rd =================================================================== --- trunk/gdata/man/trim.Rd 2006-10-29 12:55:08 UTC (rev 988) +++ trunk/gdata/man/trim.Rd 2006-10-29 15:28:26 UTC (rev 989) @@ -6,11 +6,13 @@ related objects. } \usage{ -trim(s, recode.factor=TRUE) +trim(s, recode.factor=TRUE, \ldots) } \arguments{ \item{s}{object to be processed} - \item{recode.factor}{Should levels of a factor be recoded, see below} + \item{recode.factor}{should levels of a factor be recoded, see below} + \item{\ldots}{arguments passed to other methods, currently only to + \code{\link{reorder.factor}} for factors} } \details{ @@ -20,19 +22,22 @@ 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}. +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{wa...@bs...} with +\author{Gregory R. Warnes \email{wa...@bs...} with contributions by Gregor Gorjanc} \seealso{ \code{\link[base]{sub}}, \code{\link[base]{gsub}} as well as - argument \code{strip.white} in \code{\link{read.table}}} + argument \code{strip.white} in \code{\link{read.table}} and + \code{\link{reorder.factor}} +} \examples{ s <- " this is an example string " trim(s) @@ -43,17 +48,14 @@ trim(f) levels(trim(f)) -trim(f,recode.factor=FALSE) -levels(trim(f,recode.factor=FALSE)) +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} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gg...@us...> - 2006-10-29 12:55:20
|
Revision: 988 http://svn.sourceforge.net/r-gregmisc/?rev=988&view=rev Author: ggorjan Date: 2006-10-29 04:55:08 -0800 (Sun, 29 Oct 2006) Log Message: ----------- Fixed collision bug with stats version of reorder.factor Modified Paths: -------------- trunk/gdata/NEWS trunk/gdata/R/reorder.R trunk/gdata/man/reorder.Rd Modified: trunk/gdata/NEWS =================================================================== --- trunk/gdata/NEWS 2006-10-27 21:15:22 UTC (rev 987) +++ trunk/gdata/NEWS 2006-10-29 12:55:08 UTC (rev 988) @@ -1,3 +1,13 @@ +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")) + CHANGES FROM 2.1.X to 2.3.0 (2006-09-19) --------------------------------------- @@ -12,7 +22,7 @@ - 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 @@ -54,6 +64,4 @@ - Updated ll.Rd documentation - - Fixed bug in Args.R, is.what.R, ll.R - - + - Fixed bug in Args.R, is.what.R, ll.R Modified: trunk/gdata/R/reorder.R =================================================================== --- trunk/gdata/R/reorder.R 2006-10-27 21:15:22 UTC (rev 987) +++ trunk/gdata/R/reorder.R 2006-10-29 12:55:08 UTC (rev 988) @@ -3,31 +3,26 @@ # Reorder the levels of a factor. reorder.factor <- function(x, - order, X, FUN, - sort=mixedsort, - make.ordered = is.ordered(x), - ... ) - { - constructor <- if (make.ordered) ordered else factor + ..., + order=is.ordered(x), + new.order, + sort=mixedsort) +{ + constructor <- if (order) ordered else factor - if (!missing(order)) + if (!missing(new.order)) { - if (is.numeric(order)) - order = levels(x)[order] + if (is.numeric(new.order)) + new.order <- levels(x)[new.order] else - order = order + new.order <- new.order } else if (!missing(FUN)) - order = names(sort(tapply(X, x, FUN, ...))) + new.order <- names(sort(tapply(X, x, FUN, ...))) else - order = sort(levels(x)) + new.order <- sort(levels(x)) - constructor( x, levels=order) - - } - - - - + constructor(x, levels=new.order) +} Modified: trunk/gdata/man/reorder.Rd =================================================================== --- trunk/gdata/man/reorder.Rd 2006-10-27 21:15:22 UTC (rev 987) +++ trunk/gdata/man/reorder.Rd 2006-10-29 12:55:08 UTC (rev 988) @@ -1,6 +1,5 @@ % $Id$ - \name{reorder.factor} \alias{reorder.factor} \title{Reorder the Levels of a Factor} @@ -9,61 +8,61 @@ } \usage{ \method{reorder}{factor}(x, - order, X, FUN, - sort=mixedsort, - make.ordered = is.ordered(x), - ... ) + ..., + order=is.ordered(x), + new.order, + sort=mixedsort) } \arguments{ - \item{x}{factor.} - \item{order}{A vector of indexes or a vector of label names giving the - order of the new factor levels.} + \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{sort}{function to use to sort the factor level names} - \item{make.ordered}{logical value indicating whether the returned - object should be an \code{'ordered'} factor.} - \item{...}{Optional parameters to FUN.} + \code{x}, to determine factor order} + \item{...}{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{order}, - \code{X} \emph{and} \code{FUN}, or \code{sort} are provided. + 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{order} is provided: For a numeric vector, the new factor level names - are constructed by reordering the factor levels according to the - numeric values. For vectors, \code{order} gives the list of new factor - level names. In either case levels omitted from \code{order} will - become missing values. - If \code{X} \emph{and} \code{Fun} are provided: The data in \code{X} - is grouped by the levels of \code{data} and \code{FUN} is applied. + 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 provided: For a numeric vector, the new factor + level names are constructed by reordering the factor levels according + to the numeric values. For vectors, \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 applying the supplied function - to the existing factor level names. With \code{order="mixedsort"} the + to the existing factor level names. With \code{sort=mixedsort} 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 be numeric rules for the - numeric sections. See \code{mixedsort} for details. - + sections (including ignoring case), and the numeric rules for the + numeric sections. See \code{\link[gtools]{mixedsort}} for details. } \value{ - A new factor with the levels ordered as specified. + A new factor with reordered levels } -\author{ Gregory R. Warnes \email{wa...@bs...}} +\author{Gregory R. Warnes \email{wa...@bs...}} -\seealso{ \code{\link{factor}}, \code{\link[stats]{reorder}} } +\seealso{\code{\link{factor}} and \code{\link[stats]{reorder}}} \examples{ # Create a 4 level example factor - trt <- factor( sample( c("PLACEBO","300 MG", "600 MG", "1200 MG"), + 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. @@ -73,18 +72,17 @@ trt2 <- reorder(trt) summary(trt2) # using indexes: - trt3 <- reorder(trt, c(4,2,3,1)) + trt3 <- reorder(trt, new.order=c(4, 2, 3, 1)) summary(trt3) # using label names: - trt4 <- reorder(trt, c("PLACEBO","300 MG", "600 MG", "1200 MG") ) + trt4 <- reorder(trt, new.order=c("PLACEBO", "300 MG", "600 MG", "1200 MG")) summary(trt4) # using frequency trt5 <- reorder(trt, X=as.numeric(trt), FUN=length) summary(trt5) - # drop out the '300 MG' level - trt6 <- reorder(trt, c("PLACEBO", "600 MG", "1200 MG") ) + trt6 <- reorder(trt, new.order=c("PLACEBO", "600 MG", "1200 MG")) summary(trt6) } \keyword{ manip } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2006-10-27 21:15:40
|
Revision: 987 http://svn.sourceforge.net/r-gregmisc/?rev=987&view=rev Author: warnes Date: 2006-10-27 14:15:22 -0700 (Fri, 27 Oct 2006) Log Message: ----------- Add c() method for factor objects, submitted by Gregor Gorjanc Added Paths: ----------- trunk/gdata/R/c.factor.R trunk/gdata/man/c.factor.Rd Added: trunk/gdata/R/c.factor.R =================================================================== --- trunk/gdata/R/c.factor.R (rev 0) +++ trunk/gdata/R/c.factor.R 2006-10-27 21:15:22 UTC (rev 987) @@ -0,0 +1,18 @@ +# $Id$ + +c.factor <- function(..., + recursive=FALSE # ignored + ) +{ + dots <- list(...) # recursive below is not related to one above! + mapCha <- c(mapLevels(dots, codes=FALSE), recursive=TRUE) + class(mapCha) <- "levelsMap" + dots <- unlist(lapply(dots, "mapLevels<-", mapCha)) + mapLevels(dots) <- mapLevels(as.character(mapCha)) + dots +} + + + + + Added: trunk/gdata/man/c.factor.Rd =================================================================== --- trunk/gdata/man/c.factor.Rd (rev 0) +++ trunk/gdata/man/c.factor.Rd 2006-10-27 21:15:22 UTC (rev 987) @@ -0,0 +1,35 @@ +%% $Id$ + +\name{c.factor} +\alias{c.factor} +\title{Combine factors, properly handling levels} +\description{ + This method for \code{c} combines factors while properly preserves level + information. +} +\usage{ +c.factor(..., recursive = FALSE) +} +\arguments{ + \item{\dots}{ factors to be combined } + \item{recursive}{ ignored } +} +\details{ + +} +\value{ + A single factor object. The levels on the new object are created by + concatinating the levels of the provided factors, with any duplicate + level names merged, and with the factor coding modified appropriately. +} +\author{Gregor Gorjan} +\seealso{ \code{\link[base]{c}} } +\examples{ +f1 <- factor(letters[1:10]) +f2 <- factor(letters[5:14]) + +c(f1,f2) + +} +\keyword{manip} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2006-09-19 21:09:44
|
Revision: 986 http://svn.sourceforge.net/r-gregmisc/?rev=986&view=rev Author: warnes Date: 2006-09-19 14:08:40 -0700 (Tue, 19 Sep 2006) Log Message: ----------- Update NEWS file for 2.3.0 release Modified Paths: -------------- trunk/gdata/NEWS Modified: trunk/gdata/NEWS =================================================================== --- trunk/gdata/NEWS 2006-09-19 20:52:46 UTC (rev 985) +++ trunk/gdata/NEWS 2006-09-19 21:08:40 UTC (rev 986) @@ -1,3 +1,25 @@ +CHANGES FROM 2.1.X to 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 GDATA 2.1.2 ----------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2006-09-19 20:54:50
|
Revision: 985 http://svn.sourceforge.net/r-gregmisc/?rev=985&view=rev Author: warnes Date: 2006-09-19 13:52:46 -0700 (Tue, 19 Sep 2006) Log Message: ----------- Explicitly set the local in runit.trim.R to one where leading spaces affect sort order so that the unit test works properly. Modified Paths: -------------- trunk/gdata/inst/unitTests/runit.trim.R Modified: trunk/gdata/inst/unitTests/runit.trim.R =================================================================== --- trunk/gdata/inst/unitTests/runit.trim.R 2006-09-18 20:33:30 UTC (rev 984) +++ trunk/gdata/inst/unitTests/runit.trim.R 2006-09-19 20:52:46 UTC (rev 985) @@ -17,6 +17,9 @@ 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" @@ -37,6 +40,8 @@ ) checkIdentical(trim(lTrim), lTrimR) checkIdentical(trim(dfTrim), dfTrimR) + + Sys.setlocale(category="LC_COLLATE", locale=tmp) } ### }}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |