checkSize: Checks whether the size of a variable is larger than 0

checkSizeR Documentation

Checks whether the size of a variable is larger than 0

Description

Used to determine that all required variables are passed to a function Checks whether a vector has length > 0 or a data.table/data.frame has nrow > 0

Usage

checkSize(v)

Arguments

v

Variable (required)

Value

Logical: TRUE if size is not 0, false if size is 0

Examples

x <- c()
checkSize(x)

x <- c(2,5)
checkSize(x)

A <- c()
B <- c(1,2,3)
sapply(c("A","B"),function(x){checkSize(get(x))})

lshtm-vimc/prime documentation built on April 21, 2024, 3:21 a.m.