[R-gregmisc-users] SF.net SVN: r-gregmisc:[1745] trunk/gtools/R/mixedsort.R
Brought to you by:
warnes
From: <wa...@us...> - 2013-11-06 14:51:18
|
Revision: 1745 http://sourceforge.net/p/r-gregmisc/code/1745 Author: warnes Date: 2013-11-06 14:51:16 +0000 (Wed, 06 Nov 2013) Log Message: ----------- Fix problem with mixedorder/mixedsort when there is only zero or one elements in the vector. Modified Paths: -------------- trunk/gtools/R/mixedsort.R Modified: trunk/gtools/R/mixedsort.R =================================================================== --- trunk/gtools/R/mixedsort.R 2013-10-21 23:33:29 UTC (rev 1744) +++ trunk/gtools/R/mixedsort.R 2013-11-06 14:51:16 UTC (rev 1745) @@ -9,6 +9,11 @@ # - Separately rank numbers and strings # - Combine orders so that strings follow numbers + if(length(x)<1) + return(NULL) + else if(length(x)==1) + return(1) + delim="\\$\\@\\$" numeric <- function(x) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |