R Under development (unstable) (2021-04-16 r80178) -- "Unsuffered Consequences" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > .proctime00 <- proc.time() > > isall.equal <- function(x,y) + typeof(x) == typeof(y) && is.logical(r <- all.equal(x,y, tolerance=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)) [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)) > > res <- try(as.array( x ), silent = TRUE) > if(!inherits(res, 'try-error')) + report({if(is.array(x)) { cat('IS: ');all.equal(x, res, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=0) + } else !isall.equal(x, res)}) > f <- try(as.Date( x ), silent = TRUE) > if(!inherits(f, 'try-error')) report(identical(f, as.Date( f ))) [1] TRUE > f <- try(as.POSIXct( x ), silent = TRUE) > if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f ))) [1] TRUE > f <- try(as.POSIXlt( x ), silent = TRUE) > if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f ))) [1] TRUE > 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 ))) [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) 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 in report(is.vector(res)) : x is not TRUE Calls: report -> stopifnot > 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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=0) + } else !isall.equal(x, res)}) [1] FALSE Error in report({ : x is not TRUE Calls: report -> stopifnot > res <- try(as.stepfun( x ), silent = TRUE) > if(!inherits(res, 'try-error')) + report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tolerance=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, tolerance=0) + } else !isall.equal(x, res)}) > f <- try(as.Date( x ), silent = TRUE) > if(!inherits(f, 'try-error')) report(identical(f, as.Date( f ))) [1] TRUE > f <- try(as.POSIXct( x ), silent = TRUE) > if(!inherits(f, 'try-error')) report(identical(f, as.POSIXct( f ))) [1] TRUE > f <- try(as.POSIXlt( x ), silent = TRUE) > if(!inherits(f, 'try-error')) report(identical(f, as.POSIXlt( f ))) [1] TRUE > 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)) [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)) > 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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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 ))) [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 ))) > 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) 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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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) : NAs introduced by coercion to integer range > 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) : NAs introduced by coercion to integer range > 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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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) : NAs introduced by coercion to integer range > if(!inherits(res, 'try-error')) + report({if(is.numeric_version(x)) { cat('IS: ');all.equal(x, res, tolerance=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, tolerance=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) : NAs introduced by coercion to integer range > if(!inherits(res, 'try-error')) + report({if(is.package_version(x)) { cat('IS: ');all.equal(x, res, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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) : NAs introduced by coercion to integer range > 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) : NAs introduced by coercion to integer range > 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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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)) [1] TRUE > 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)) [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)) > 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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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 ))) [1] TRUE > 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 ))) [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 ))) > 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) Warning message: In xtfrm.data.frame(x) : cannot xtfrm data frames > 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)) [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) Warning message: In xtfrm.data.frame(x) : cannot xtfrm data frames > 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) 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 in report(is.vector(res)) : x is not TRUE Calls: report -> stopifnot > 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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=0) + } else !isall.equal(x, res)}) [1] TRUE > res <- try(as.factor( x ), silent = TRUE) Warning message: In xtfrm.data.frame(x) : cannot xtfrm data frames > if(!inherits(res, 'try-error')) + report({if(is.factor(x)) { cat('IS: ');all.equal(x, res, tolerance=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, tolerance=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, tolerance=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, tolerance=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 in report({ : x are not all TRUE Calls: report -> stopifnot > res <- try(as.logical( x ), silent = TRUE) > if(!inherits(res, 'try-error')) + report({if(is.logical(x)) { cat('IS: ');all.equal(x, res, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=0) + } else !isall.equal(x, res)}) > res <- try(as.ordered( x ), silent = TRUE) Warning message: In xtfrm.data.frame(x) : cannot xtfrm data frames > if(!inherits(res, 'try-error')) + report({if(is.ordered(x)) { cat('IS: ');all.equal(x, res, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=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, tolerance=0) + } else !isall.equal(x, res)}) [1] FALSE Error in report({ : x is not TRUE Calls: report -> stopifnot > res <- try(as.stepfun( x ), silent = TRUE) > if(!inherits(res, 'try-error')) + report({if(is.stepfun(x)) { cat('IS: ');all.equal(x, res, tolerance=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, tolerance=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) Warning message: In xtfrm.data.frame(x) : cannot xtfrm data frames > 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 ))) [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) Warning message: In xtfrm.data.frame(x) : cannot xtfrm data frames > 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) 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') Time elapsed: 0.187 0.024 0.213 0 0 > >