valid: valid, invalid

validR Documentation

valid, invalid

Description

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.

Usage

valid(x, margin = 1:2, n = FALSE)

invalid(x, margin = 1:2, n = FALSE)

Arguments

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. margin==1 indicates rows, margin==2 indicates columns, otherwise indicates rows and columns.

n

logical: should just the number of valid/invalid values returned or a logical matrix/vector

Value

a logical data frame, a logical vector or an integer

Examples

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)

sigbertklinke/smvgraph documentation built on Dec. 10, 2022, 9:13 a.m.