[R] testInstalledBasic / testInstalledPackages
Trina Patel
trinarpatel at gmail.com
Tue Apr 16 18:44:31 CEST 2013
Hi,
I installed R 3.0.0 on a Windows 2008 Server.
When I submitted the following code in R64,
library(tools)
testInstalledBasic(scope="devel")
I get the following message in the R Console:
> library(tools)
> testInstalledBasic(scope="devel")
running tests of consistency of as/is.*
creating ‘isas-tests.R’
running code in ‘isas-tests.R’
comparing ‘isas-tests.Rout’ to ‘isas-tests.Rout.save’ ...2550a2551
> >
running tests of random deviate generation -- fails occasionally
running code in ‘p-r-random-tests.R’
comparing ‘p-r-random-tests.Rout’ to ‘p-r-random-tests.Rout.save’ ... OK
running tests of primitives
running code in ‘primitives.R’
running regexp regression tests
running code in ‘utf8-regex.R’
running tests to possibly trigger segfaults
creating ‘no-segfault.R’
running code in ‘no-segfault.R’
Warning message:
running command 'diff -bw
"C:\Users\TRINA_~1\AppData\Local\Temp\Rtmp2FwZXW\Rdiffa1a88562f12b"
"C:\Users\TRINA_~1\AppData\Local\Temp\Rtmp2FwZXW\Rdiffb1a8848c57620"'
had status 1
When I compare the isas-tests.Rout to isas-tests.Rout.save, as well
as the two diff files listed above, it seems that there is one extra
empty line in isas-tests.Rout.save. Is there any way to fix this error
without modifying the isas-tests.Rout.save file?
Next I submitted the following code,
testInstalledPackages(scope="base")
and got the message below in my R console:
> testInstalledPackages(scope="base")
Testing examples for package ‘base’
Testing examples for package ‘tools’
comparing ‘tools-Ex.Rout’ to ‘tools-Ex.Rout.save’ ...
621c621
< [1] "0cce1e42ef3fb133940946534fcf8896"
---
> [1] "eb723b61539feef013de476e68b5c50a"
When comparing the files tools-ex.rout and tools-ex-rout.save, it
seems this difference indicates an error in the md5sums for the file
C:\Program Files\R\R-3.0.0\COPYING. Does this indicate a problem with
my installation? Looking at the file C:\Program Files\R\R-3.0.0\MD5,
leads me to suspect there might be an error in the test itself.
Thanks for the help!
-------------- next part --------------
> .proctime00 <- proc.time()
>
> isall.equal <- function(x,y)
+ typeof(x) == typeof(y) && is.logical(r <- all.equal(x,y, tol=0)) && r
>
> report <- function(x) {print(x); stopifnot(x)}
> options(error = expression(NULL)) # don't stop on error in batch
> ##~~~~~~~~~~~~~~
>
> ###--------
> x <- integer(0)
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
[1] TRUE
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
[1] TRUE
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
[1] TRUE
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
[1] TRUE
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
[1] TRUE
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
[1] TRUE
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
Warning message:
In as.dist.default(x) : non-square matrix
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
>
> ###--------
> x <- NULL
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] FALSE
Error: x is not TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] FALSE
Error: x is not TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
[1] TRUE
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
[1] TRUE
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
[1] TRUE
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
[1] TRUE
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
>
> ###--------
> x <- list()
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
[1] TRUE
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
[1] TRUE
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
Warning message:
In as.dist.default(x) : non-square matrix
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
>
> ###--------
> x <- 1:1
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
[1] TRUE
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
[1] TRUE
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
[1] TRUE
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
[1] TRUE
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
[1] TRUE
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
[1] TRUE
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
[1] TRUE
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
[1] TRUE
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
[1] TRUE
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
[1] TRUE
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
[1] TRUE
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
[1] TRUE
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
[1] TRUE
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
[1] TRUE
>
> ###--------
> x <- pi
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
[1] TRUE
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
Warning message:
In lapply(strsplit(x[ok], "[.-]"), as.integer) :
inaccurate integer conversion in coercion
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
Warning message:
In lapply(strsplit(x[ok], "[.-]"), as.integer) :
inaccurate integer conversion in coercion
> if(!inherits(res, 'try-error')) report(is.package_version(res))
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
[1] TRUE
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
[1] TRUE
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
[1] TRUE
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
Warning message:
In lapply(strsplit(x[ok], "[.-]"), as.integer) :
inaccurate integer conversion in coercion
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
Warning message:
In lapply(strsplit(x[ok], "[.-]"), as.integer) :
inaccurate integer conversion in coercion
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
[1] TRUE
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
[1] TRUE
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
[1] TRUE
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
[1] TRUE
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
Warning message:
In lapply(strsplit(x[ok], "[.-]"), as.integer) :
inaccurate integer conversion in coercion
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
[1] TRUE
> f <- try(as.package_version( x ), silent = TRUE)
Warning message:
In lapply(strsplit(x[ok], "[.-]"), as.integer) :
inaccurate integer conversion in coercion
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
[1] TRUE
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
[1] TRUE
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
[1] TRUE
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
[1] TRUE
>
> ###--------
> x <- "1.3"
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
[1] TRUE
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
[1] TRUE
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
[1] TRUE
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
[1] TRUE
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
[1] TRUE
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
[1] TRUE
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
[1] TRUE
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
[1] TRUE
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
[1] TRUE
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
[1] TRUE
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
[1] TRUE
>
> ###--------
> x <- list(a = 1)
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
[1] TRUE
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
[1] TRUE
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
[1] TRUE
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
[1] TRUE
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
[1] TRUE
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
[1] TRUE
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
[1] TRUE
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
[1] TRUE
>
> ###--------
> x <- as.data.frame(character(0))
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
[1] TRUE
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
[1] TRUE
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
out-of-range values treated as 0 in coercion to raw
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] FALSE
Error: x is not TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] "Attributes: < names for target but not for current >"
[2] "Attributes: < Length mismatch: comparison on first 0 components >"
Error: x are not all TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
out-of-range values treated as 0 in coercion to raw
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] FALSE
Error: x is not TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
[1] TRUE
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
[1] TRUE
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
[1] TRUE
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
out-of-range values treated as 0 in coercion to raw
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
Warning message:
In as.dist.default(x) : non-square matrix
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
[1] TRUE
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
> cat('Time elapsed: ', proc.time() - .proctime00,'\n')
>
-------------- next part --------------
> .proctime00 <- proc.time()
>
> isall.equal <- function(x,y)
+ typeof(x) == typeof(y) && is.logical(r <- all.equal(x,y, tol=0)) && r
>
> report <- function(x) {print(x); stopifnot(x)}
> options(error = expression(NULL)) # don't stop on error in batch
> ##~~~~~~~~~~~~~~
>
> ###--------
> x <- integer(0)
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
[1] TRUE
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
[1] TRUE
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
[1] TRUE
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
[1] TRUE
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
[1] TRUE
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
[1] TRUE
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
Warning message:
In as.dist.default(x) : non-square matrix
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
>
> ###--------
> x <- NULL
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] FALSE
Error: x is not TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] FALSE
Error: x is not TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
[1] TRUE
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
[1] TRUE
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
[1] TRUE
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
[1] TRUE
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
>
> ###--------
> x <- list()
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
[1] TRUE
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
[1] TRUE
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
Warning message:
In as.dist.default(x) : non-square matrix
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
>
> ###--------
> x <- 1:1
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
[1] TRUE
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
[1] TRUE
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
[1] TRUE
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
[1] TRUE
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
[1] TRUE
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
[1] TRUE
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
[1] TRUE
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
[1] TRUE
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
[1] TRUE
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
[1] TRUE
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
[1] TRUE
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
[1] TRUE
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
[1] TRUE
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
[1] TRUE
>
> ###--------
> x <- pi
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
[1] TRUE
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
Warning message:
In lapply(strsplit(x[ok], "[.-]"), as.integer) :
inaccurate integer conversion in coercion
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
Warning message:
In lapply(strsplit(x[ok], "[.-]"), as.integer) :
inaccurate integer conversion in coercion
> if(!inherits(res, 'try-error')) report(is.package_version(res))
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
[1] TRUE
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
[1] TRUE
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
[1] TRUE
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
Warning message:
In lapply(strsplit(x[ok], "[.-]"), as.integer) :
inaccurate integer conversion in coercion
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
Warning message:
In lapply(strsplit(x[ok], "[.-]"), as.integer) :
inaccurate integer conversion in coercion
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
[1] TRUE
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
[1] TRUE
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
[1] TRUE
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
[1] TRUE
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
Warning message:
In lapply(strsplit(x[ok], "[.-]"), as.integer) :
inaccurate integer conversion in coercion
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
[1] TRUE
> f <- try(as.package_version( x ), silent = TRUE)
Warning message:
In lapply(strsplit(x[ok], "[.-]"), as.integer) :
inaccurate integer conversion in coercion
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
[1] TRUE
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
[1] TRUE
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
[1] TRUE
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
[1] TRUE
>
> ###--------
> x <- "1.3"
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
[1] TRUE
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
[1] TRUE
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
[1] TRUE
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
[1] TRUE
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
[1] TRUE
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
[1] TRUE
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
[1] TRUE
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
[1] TRUE
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
[1] TRUE
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
[1] TRUE
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
[1] TRUE
>
> ###--------
> x <- list(a = 1)
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
[1] TRUE
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
[1] TRUE
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
[1] TRUE
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
[1] TRUE
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
[1] TRUE
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
[1] TRUE
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
[1] TRUE
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
[1] TRUE
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
[1] TRUE
>
> ###--------
> x <- as.data.frame(character(0))
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.array(res))
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.call(res))
[1] TRUE
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.character(res))
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.complex(res))
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.data.frame(res))
[1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.double(res))
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.environment(res))
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.expression(res))
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.factor(res))
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.function(res))
[1] TRUE
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.integer(res))
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.list(res))
[1] TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.logical(res))
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.matrix(res))
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.name(res))
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.null(res))
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric(res))
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.numeric_version(res))
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ordered(res))
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.package_version(res))
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.pairlist(res))
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.qr(res))
> res <- try(as.raw( x ), silent = TRUE)
Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
out-of-range values treated as 0 in coercion to raw
> if(!inherits(res, 'try-error')) report(is.raw(res))
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.symbol(res))
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.table(res))
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.vector(res))
[1] FALSE
Error: x is not TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.stepfun(res))
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error')) report(is.ts(res))
>
> res <- try(as.array( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.call( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.call(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.character( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.character(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.complex( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.complex(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.data.frame(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] TRUE
> res <- try(as.double( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.double(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.environment( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.environment(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.expression( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.expression(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.factor( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.function( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.function(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.integer( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.integer(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.list( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.list(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
IS: [1] "Attributes: < names for target but not for current >"
[2] "Attributes: < Length mismatch: comparison on first 0 components >"
Error: x are not all TRUE
> res <- try(as.logical( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.matrix(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.name( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.name(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.null( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.null(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.pairlist(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.qr( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.qr(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.raw( x ), silent = TRUE)
Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
out-of-range values treated as 0 in coercion to raw
> if(!inherits(res, 'try-error'))
+ report({if(is.raw(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] TRUE
> res <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.symbol(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.table( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.table(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.vector( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.vector(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
[1] FALSE
Error: x is not TRUE
> res <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> res <- try(as.ts( x ), silent = TRUE)
> if(!inherits(res, 'try-error'))
+ report({if(is.ts(x)) { cat('IS: ');all.equal(x, res, tol=0)
+ } else !isall.equal(x, res)})
> f <- try(as.Date( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.Date( f )))
> f <- try(as.POSIXct( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f )))
> f <- try(as.POSIXlt( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f )))
> f <- try(as.array( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.array( f )))
> f <- try(as.call( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.call( f )))
[1] TRUE
> f <- try(as.character( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.character( f )))
[1] TRUE
> f <- try(as.complex( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.complex( f )))
[1] TRUE
> f <- try(as.data.frame( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.data.frame( f )))
[1] TRUE
> f <- try(as.difftime( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.difftime( f )))
> f <- try(as.double( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.double( f )))
[1] TRUE
> f <- try(as.environment( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.environment( f )))
[1] TRUE
> f <- try(as.expression( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.expression( f )))
[1] TRUE
> f <- try(as.factor( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.factor( f )))
> f <- try(as.function( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.function( f )))
[1] TRUE
> f <- try(as.hexmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hexmode( f )))
> f <- try(as.integer( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.integer( f )))
[1] TRUE
> f <- try(as.list( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.list( f )))
[1] TRUE
> f <- try(as.logical( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.logical( f )))
[1] TRUE
> f <- try(as.matrix( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.matrix( f )))
[1] TRUE
> f <- try(as.name( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.name( f )))
> f <- try(as.null( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.null( f )))
[1] TRUE
> f <- try(as.numeric( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric( f )))
[1] TRUE
> f <- try(as.numeric_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.numeric_version( f )))
> f <- try(as.octmode( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.octmode( f )))
> f <- try(as.ordered( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ordered( f )))
> f <- try(as.package_version( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.package_version( f )))
> f <- try(as.pairlist( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.pairlist( f )))
[1] TRUE
> f <- try(as.qr( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.qr( f )))
> f <- try(as.raw( x ), silent = TRUE)
Warning message:
In doTryCatch(return(expr), name, parentenv, handler) :
out-of-range values treated as 0 in coercion to raw
> if(!inherits(f, 'try-error')) report(identical(f, as.raw( f )))
[1] TRUE
> f <- try(as.single( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.single( f )))
[1] TRUE
> f <- try(as.symbol( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.symbol( f )))
> f <- try(as.table( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.table( f )))
> f <- try(as.vector( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.vector( f )))
[1] TRUE
> f <- try(as.dendrogram( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.dendrogram( f )))
> f <- try(as.dist( x ), silent = TRUE)
Warning message:
In as.dist.default(x) : non-square matrix
> if(!inherits(f, 'try-error')) report(identical(f, as.dist( f )))
[1] TRUE
> f <- try(as.formula( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.formula( f )))
[1] TRUE
> f <- try(as.hclust( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.hclust( f )))
> f <- try(as.stepfun( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.stepfun( f )))
> f <- try(as.ts( x ), silent = TRUE)
> if(!inherits(f, 'try-error')) report(identical(f, as.ts( f )))
> cat('Time elapsed: ', proc.time() - .proctime00,'\n')
>
>
More information about the R-help
mailing list