[R-gregmisc-users] SF.net SVN: r-gregmisc:[1711] trunk/gtools/R/mixedsort.R
Brought to you by:
warnes
From: <wa...@us...> - 2013-09-23 15:19:09
|
Revision: 1711 http://sourceforge.net/p/r-gregmisc/code/1711 Author: warnes Date: 2013-09-23 15:19:06 +0000 (Mon, 23 Sep 2013) Log Message: ----------- Use 'suppressWarnings() instead of 'options(warn=-1)' in 'mixedorder()'. Modified Paths: -------------- trunk/gtools/R/mixedsort.R Modified: trunk/gtools/R/mixedsort.R =================================================================== --- trunk/gtools/R/mixedsort.R 2013-07-18 14:09:14 UTC (rev 1710) +++ trunk/gtools/R/mixedsort.R 2013-09-23 15:19:06 UTC (rev 1711) @@ -13,19 +13,12 @@ numeric <- function(x) { - optwarn = options("warn") - on.exit( options(optwarn) ) - options(warn=-1) - as.numeric(x) + suppressWarnings( as.numeric(x) ) } nonnumeric <- function(x) { - optwarn = options("warn") - on.exit( options(optwarn) ) - options(warn=-1) - - ifelse(is.na(as.numeric(x)), toupper(x), NA) + suppressWarnings( ifelse(is.na(as.numeric(x)), toupper(x), NA) ) } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |