Last data update: 2014.03.03

R: Boolean Equality Testing Function
omxCheckTrueR Documentation

Boolean Equality Testing Function

Description

This function tests whether an object is equal to TRUE.

Usage

omxCheckTrue(a)

Arguments

a

the value to test.

Details

Checks element-wise whether an object is equal to TRUE. If any of the elements are false, then an error will be thrown. If ‘a’ is TRUE, by default the function will print a statement informing the user the test has passed. To turn off these print statements use options("mxPrintUnitTests" = FALSE).

References

The OpenMx User's guide can be found at http://openmx.psyc.virginia.edu/documentation.

See Also

omxCheckCloseEnough, omxCheckWithinPercentError, omxCheckIdentical, omxCheckSetEquals, omxCheckEquals

Examples


omxCheckTrue(1 + 1 == 2)

omxCheckTrue(matrix(TRUE, 3, 3))

# Throws an error
try(omxCheckTrue(FALSE))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 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.

> library(OpenMx)
Loading required package: digest
Loading required package: MASS
Loading required package: Matrix
Loading required package: Rcpp
Loading required package: parallel

Attaching package: 'OpenMx'

The following objects are masked from 'package:Matrix':

    %&%, expm

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/OpenMx/omxCheckTrue.Rd_%03d_medium.png", width=480, height=480)
> ### Name: omxCheckTrue
> ### Title: Boolean Equality Testing Function
> ### Aliases: omxCheckTrue
> 
> ### ** Examples
> 
> 
> omxCheckTrue(1 + 1 == 2)
1 + 1 == 2 is true. 
> 
> omxCheckTrue(matrix(TRUE, 3, 3))
matrix(TRUE, 3, 3) is true. 
> 
> # Throws an error
> try(omxCheckTrue(FALSE))
Error in omxCheckTrue(FALSE) : FALSE is not true
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>