valid | R Documentation |
Computes the number a logical matrix or vector if all values are valid in x
or each colum or row of x
. Valid values for numeric variables are is.finite(v)
and for other types !is.na
Computes the number a logical matrix or vector if any values are valid in x
or each colum or row of x
.
valid(x, margin = 1:2, n = FALSE) invalid(x, margin = 1:2, n = FALSE)
x |
object: anything taht can be coerced to a data frame checked for valid/invalid values |
margin |
integer: a vector giving the subscripts for which valid/invalid values looked for, e.g. |
n |
logical: should just the number of valid/invalid values returned or a logical matrix/vector |
a logical data frame, a logical vector or an integer
data("testdata") valid(testdata) # matrix with logical entries if x has valid entry valid(testdata, n=TRUE) # number of valid entries in x valid(testdata, 1) # vector with logical entries if each row if x has valid entries valid(testdata, 1, n=TRUE) # number of rows with valid entries in x valid(testdata$xu)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.